同步
This commit is contained in:
parent
9f34c2f521
commit
b6407c360c
@ -14,9 +14,11 @@ import java.util.Map;
|
||||
public class FitModule extends ReactContextBaseJavaModule {
|
||||
private final ReactApplicationContext reactContext;
|
||||
private final String MANUFACTURER = Build.MANUFACTURER;
|
||||
private boolean FULLSCREEN = false;
|
||||
|
||||
public FitModule(ReactApplicationContext reactContext) {
|
||||
super(reactContext);
|
||||
this._checkFullScreen();
|
||||
this.reactContext = reactContext;
|
||||
}
|
||||
|
||||
@ -29,6 +31,7 @@ public class FitModule extends ReactContextBaseJavaModule {
|
||||
public Map<String, Object> getConstants(){
|
||||
final Map<String, Object> constants = new HashMap<>();
|
||||
constants.put("MANUFACTURER", MANUFACTURER);
|
||||
constants.put("FULLSCREEN", FULLSCREEN);
|
||||
return constants;
|
||||
}
|
||||
|
||||
@ -45,11 +48,9 @@ public class FitModule extends ReactContextBaseJavaModule {
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void checkFullScreen(Promise promise){
|
||||
if ("xiaomi".equalsIgnoreCase(MANUFACTURER)) {
|
||||
promise.resolve(_isXiaoMiFullScreen());
|
||||
private void _checkFullScreen(){
|
||||
if ("xiaomi".equalsIgnoreCase(MANUFACTURER)){
|
||||
this.FULLSCREEN = this._isXiaoMiFullScreen();
|
||||
}
|
||||
promise.reject("E");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user