File tree Expand file tree Collapse file tree
android/src/main/java/com/lmy/header Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .lmy .header ;
22
3+ import android .graphics .Color ;
4+ import android .support .annotation .ColorInt ;
5+
36import com .facebook .react .uimanager .ThemedReactContext ;
47import com .facebook .react .uimanager .ViewGroupManager ;
8+ import com .facebook .react .uimanager .annotations .ReactProp ;
59
610/**
711 * Created by painter.g on 2018/3/12.
@@ -17,4 +21,16 @@ public String getName() {
1721 protected AnyHeader createViewInstance (ThemedReactContext reactContext ) {
1822 return new AnyHeader (reactContext );
1923 }
24+
25+ /**
26+ * 设置主调色
27+ * @param view
28+ * @param primaryColor
29+ */
30+ @ ReactProp (name = "primaryColor" )
31+ public void setPrimaryColor (AnyHeader view , String primaryColor ){
32+ if (primaryColor !=null && !"" .equals (primaryColor )){
33+ view .setPrimaryColor (Color .parseColor (primaryColor ));
34+ }
35+ }
2036}
You can’t perform that action at this time.
0 commit comments