-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathFastShadowViewManager.java
More file actions
62 lines (48 loc) · 1.94 KB
/
Copy pathFastShadowViewManager.java
File metadata and controls
62 lines (48 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.reactnativefastshadow;
import android.graphics.Color;
import androidx.annotation.NonNull;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.views.view.ReactViewGroup;
import com.facebook.react.views.view.ReactViewManager;
public class FastShadowViewManager extends ReactViewManager {
private final FastShadowViewManagerImpl mFastShadowViewManagerImpl;
public FastShadowViewManager() {
mFastShadowViewManagerImpl = new FastShadowViewManagerImpl();
}
@Override
@NonNull
public String getName() {
return FastShadowViewManagerImpl.NAME;
}
@Override
public FastShadowView createViewInstance(ThemedReactContext context) {
return mFastShadowViewManagerImpl.createViewInstance(context);
}
@Override
public void onDropViewInstance(@NonNull ReactViewGroup view) {
super.onDropViewInstance(view);
((FastShadowView) view).releaseShadow();
}
@ReactProp(name = "shadowColor", customType = "Color", defaultInt = Color.BLACK)
public void setShadowColor(FastShadowView view, int color) {
mFastShadowViewManagerImpl.setShadowColor(view, color);
}
@ReactProp(name = "shadowOpacity", defaultFloat = 0)
public void setShadowOpacity(FastShadowView view, float opacity) {
mFastShadowViewManagerImpl.setShadowOpacity(view, opacity);
}
@ReactProp(name = "shadowRadius", defaultFloat = 3)
public void setShadowRadius(FastShadowView view, float radius) {
mFastShadowViewManagerImpl.setShadowRadius(view, radius);
}
@ReactProp(name = "shadowOffset")
public void setShadowOffset(FastShadowView view, ReadableMap offset) {
mFastShadowViewManagerImpl.setShadowOffset(view, offset);
}
@ReactProp(name = "cornerRadii")
public void setCornerRadii(FastShadowView view, ReadableMap borderRadius) {
mFastShadowViewManagerImpl.setCornerRadii(view, borderRadius);
}
}