mockingbot / react-native-immersive Goto Github PK
View Code? Open in Web Editor NEWAdd Toggle for Android Immersive FullScreen Layout
License: MIT License
Add Toggle for Android Immersive FullScreen Layout
License: MIT License
Hi,
Is there a way of getting this to work with Modals?
If a screenshot is taken on an android device, the bottom navigation panel comes up and Immersive.on()
is not closing it and it stays up until we reopen the app.
react-native-immersive - 2.0.0
react-native - 61.5
Hi, there is a mistake in redame file, you need to change:
compile project(':react-native-zip-archive') => compile project(':react-native-immersive')
import com.rnziparchive.RNZipArchivePackage; => import com.rnimmersive.RNImmersivePackage;
new RNZipArchivePackage() => new RNImmersivePackage()
I don't know if its ok to blame the "issue" here or at react-native-navigation
but maybe you can discover the Issue with it.
When I try to set the immersive mode nothing happens. Maybe the reason is the unusual way to start the native app with the react-native-navigation.
Feel free to close the issue when you think that I should bother the react-native-navigation
guys ๐
When I try to build my Android app, I'm getting the following error:
It seems like jcenter can't find any versions of gradle. When I add maven, gradle is found, but not the correct version.
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.+'
}
}
Changing the gradle version in the classpath to 3.1.4 fixed this issue for me. Did anyone else have this problem?
Would be nice to have support for Cocoapods, I can make a PR, just want to make sure you'll be up for this.
What i have done
I followed the installation process and these instructions to integrate the package into my project but things are not behaving like i expected.
What i'm trying to achieve
I want to disable Androids System Bottom Navigation wherever possible because it conflicts with my UI.
What i observed
It seems like every kind of modal opens the Android Navigation.
Other examples in my code base which opens the Android Navigation
Hi I can't seem to get Immersive to work. I get an error "undefined is not an object (evaluating 'RNImmersive.setImmersive')
package.json
{
"name": "wyse",
"version": "0.0.2",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "15.4.1",
"react-dom": "15.4.1",
"react-native": "0.42.0",
"react-native-immersive": "0.0.4",
"whatwg-fetch": "^1.0.0"
},
"jest": {
"preset": "jest-react-native"
},
"devDependencies": {
"babel-jest": "16.0.0",
"babel-preset-react-native": "1.9.0",
"jest": "16.0.2",
"jest-react-native": "16.1.0",
"react-test-renderer": "15.3.2"
}
}
settings.gradle
rootProject.name = 'wyse'
include ':app'
include ':react-native-immersive'
project(':react-native-immersive').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-immersive/android')
build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.wyse"
minSdkVersion 16
targetSdkVersion 23
versionCode 9
versionName "1.9"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
storeFile file("my-release-key.keystore")
storePassword "springbig"
keyAlias "my-key-alias"
keyPassword "springbig"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-immersive')
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
MainActivity.java
package com.wyse;
import com.facebook.react.ReactActivity;
import com.rnimmersive.RNImmersivePackage;
import java.util.List;
import java.util.Arrays;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.react.ReactPackage;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "wyse";
}
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(new MainReactPackage(), new RNImmersivePackage());
}
}
index.android.js
import React, {Component} from 'react';
import {AppRegistry, Navigator} from 'react-native';
import Immersive from 'react-native-immersive';
import Apple from './app/Apple';
import LoadingScreen from './app/LoadingScreen'
import LoginScreen from './app/LoginScreen';
import KeypadScreen from './app/KeypadScreen';
import InterestScreen from './app/InterestScreen';
import RewardScreen from './app/RewardScreen';
import RewardRedeemedScreen from './app/RewardRedeemedScreen';
class wyse extends Component {
render() {
Immersive.setImmersive(true);
return (
<Navigator initialRoute={{screen: 'LoadingScreen'}} renderScene={(route, nav) => {
return this.renderScene(route, nav)
}}/>
)
}
renderScene(route, nav) {
switch (route.screen) {
case "Apple":
return <Apple navigator={nav}/>
case "LoadingScreen":
return <LoadingScreen navigator={nav}/>
case "LoginScreen":
return <LoginScreen navigator={nav}/>
case "KeypadScreen":
return <KeypadScreen navigator={nav} tablet={route.tablet}/>
case 'InterestScreen':
return <InterestScreen navigator={nav} tablet={route.tablet} member={route.member}/>
case 'RewardScreen':
return <RewardScreen navigator={nav} tablet={route.tablet} member={route.member}/>
case "RewardRedeemedScreen":
return <RewardRedeemedScreen navigator={nav} tablet={route.tablet} reward={route.reward}/>
}
}
}
AppRegistry.registerComponent('wyse', () => wyse);
Hello. In general it successfully work with wix-react-native-router. But, it doesn't work if I use screen as a modal. Version of react-native-router is latest. Could you give any idea, how can I handle it.
In Release APK,
It does not work.
I think DEV is false in Release Mode.
could this work in Expo builds ยฟ?
After opening a modal window, the immersive mode is disabled.
I had to reactivate it after closing the modal window.
Same thing happens when the application comes back from sleep mode
Could not set StatusBar style to dark-content. It always forces to light-content, even setting StatusBar style directly blinks it's style to dark and then immediately switches to light.
Hello!
With React Native v0.47.1 I have the following error while running react-native run-android
:
/node_modules/react-native-immersive/android/src/main/java/com/rnimmersive/RNImmersivePackage.java:20: error: method does not override or implement a method from a supertype
@Override
^
1 error
I can bypass this error only after removing @Override
from:
@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}
This is the similar issue as this
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.