This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.<appName>; | |
import android.os.Handler; | |
import android.view.View; | |
import com.facebook.react.bridge.ReactApplicationContext; | |
import com.facebook.react.bridge.ReactContextBaseJavaModule; | |
import com.facebook.react.bridge.ReactMethod; | |
public class ImmersiveMode extends ReactContextBaseJavaModule { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// previous imports | |
. . . | |
+ import android.os.Handler; | |
public class ImmersiveMode extends ReactContextBaseJavaModule { | |
// let's declare a handler for our UI thread; | |
+ Handler uiHandler; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
View, | |
TouchableOpacity, | |
Text, | |
NativeModules | |
} from "react-native"; | |
const Test = props => { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. . . | |
// other imports | |
+ import android.view.View; | |
+ import com.facebook.react.bridge.ReactMethod; | |
public class ImmersiveMode extends ReactContextBaseJavaModule { | |
. . . | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ImmersiveMode extends ReactContextBaseJavaModule { | |
. . . | |
// Previously added stuff | |
// our method takes one argument, systemUIFlags. | |
// It ends up being an integer, which is pretty neat-- more on that later. | |
private void setSystemUIFlags(int visibility) { | |
// here we get ourCurrentActivity | |
// from it, we grab the window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. . . | |
// lots of imports | |
public class MainApplication extends Application implements ReactApplication { | |
. . . | |
@Override | |
protected List<ReactPackage> getPackages() { | |
return Arrays.<ReactPackage>asList( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.<appName>; | |
import com.facebook.react.bridge.ReactApplicationContext; | |
import com.facebook.react.bridge.ReactContextBaseJavaModule; | |
public class ImmersiveMode extends ReactContextBaseJavaModule { | |
+ @Override | |
+ public String getName() { | |
+ return "ImmersiveMode"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.myApp; | |
import com.facebook.react.bridge.ReactApplicationContext; | |
import com.facebook.react.bridge.ReactContextBaseJavaModule; | |
import com.facebook.react.bridge.ReactMethod; | |
import com.facebook.react.bridge.Callback; | |
import android.view.View; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.<appName>; | |
import com.facebook.react.ReactPackage; | |
import com.facebook.react.bridge.NativeModule; | |
import com.facebook.react.bridge.ReactApplicationContext; | |
import com.facebook.react.uimanager.ViewManager; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.myApp; | |
. . . | |
// imports | |
. . . | |
public class MainActivity extends ReactActivity { | |
@Override | |
protected String getMainComponentName() { | |
return "MyApp"; |