├── .gitignore ├── .npmignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── android ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── me │ └── listenzz │ └── modal │ ├── TranslucentModalHostHelper.java │ ├── TranslucentModalHostManager.java │ ├── TranslucentModalHostShadowNode.java │ ├── TranslucentModalHostView.java │ └── TranslucentModalReactPackage.java ├── babel.config.js ├── metro.config.js ├── package.json ├── playground ├── App.js ├── android │ ├── .project │ ├── app │ │ ├── .classpath │ │ ├── .project │ │ ├── .settings │ │ │ └── org.eclipse.buildship.core.prefs │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── modaltranslucenttest │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle └── index.js └── screenshot ├── after.png └── before.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | yarn.lock 58 | package-lock.json -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | android/build/ 28 | build/ 29 | .idea 30 | .gradle 31 | local.properties 32 | *.iml 33 | 34 | # node.js 35 | # 36 | node_modules/ 37 | npm-debug.log 38 | yarn-error.log 39 | yarn.lock 40 | .vscode/ 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | *.keystore 46 | 47 | # fastlane 48 | # 49 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 50 | # screenshots whenever they are needed. 51 | # For more information about the recommended setup visit: 52 | # https://docs.fastlane.tools/best-practices/source-control/ 53 | 54 | */fastlane/report.xml 55 | */fastlane/Preview.html 56 | */fastlane/screenshots 57 | 58 | # Bundle artifact 59 | *.jsbundle 60 | 61 | playground/ -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true, 3 | "eslint.autoFixOnSave": true, 4 | "eslint.alwaysShowStatus": true, 5 | "prettier.disableLanguages": ["js"], 6 | "files.autoSave": "onFocusChange", 7 | "[javascript]": { 8 | "editor.tabSize": 2, 9 | "editor.formatOnSave": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 listenzz@163.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-modal-translucent 2 | 3 | Remove the StatusBar background for Modal on Android 4 | 5 | ### Before 6 | 7 | 8 | 9 | ### After 10 | 11 | 12 | 13 | ### Usage 14 | 15 | ```bash 16 | npm install react-native-modal-translucent --save 17 | # or 18 | yarn add react-native-modal-translucent 19 | ``` 20 | 21 | If your RN version is below 0.60, you need to link manually. 22 | 23 | ``` 24 | react-native link react-native-modal-translucent 25 | ``` 26 | 27 | Now run the App and see the Effect. 28 | 29 | ## Caveat 30 | 31 | If your react-native version is below 0.57, you need to update your android gradle. 32 | 33 | First, modify your android/build.gradle 34 | 35 | ```diff 36 | buildscript { 37 | + ext { 38 | + buildToolsVersion = "28.0.3" 39 | + minSdkVersion = 16 40 | + compileSdkVersion = 28 41 | + targetSdkVersion = 28 42 | + supportLibVersion = "28.0.0" 43 | + } 44 | 45 | repositories { 46 | + google() 47 | jcenter() 48 | - maven { 49 | - url 'https://maven.google.com/' 50 | - name 'Google' 51 | - } 52 | } 53 | 54 | dependencies { 55 | - classpath 'com.android.tools.build:gradle:2.3.3' 56 | + // make sure your gardle version here is equal or greater than 3.3.2 57 | + classpath 'com.android.tools.build:gradle:3.3.2' 58 | } 59 | } 60 | 61 | allprojects { 62 | repositories { 63 | mavenLocal() 64 | + google() 65 | jcenter() 66 | maven { 67 | url "$rootDir/../node_modules/react-native/android" 68 | } 69 | - maven { 70 | - url 'https://maven.google.com/' 71 | - name 'Google' 72 | - } 73 | } 74 | } 75 | 76 | -ext { 77 | - buildToolsVersion = "26.0.3" 78 | - minSdkVersion = 16 79 | - compileSdkVersion = 26 80 | - targetSdkVersion = 26 81 | - supportLibVersion = "26.1.0" 82 | -} 83 | 84 | 85 | +task wrapper(type: Wrapper) { 86 | + gradleVersion = '4.10.1' 87 | + distributionUrl = distributionUrl.replace("bin", "all") 88 | +} 89 | ``` 90 | 91 | Second, modify android/gradle/wrapper.gradle-wrapper.properties, make sure the gradle distribution is equal or greater than 4.4 92 | 93 | ```diff 94 | distributionBase=GRADLE_USER_HOME 95 | distributionPath=wrapper/dists 96 | zipStoreBase=GRADLE_USER_HOME 97 | zipStorePath=wrapper/dists 98 | -distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip 99 | +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip 100 | ``` 101 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | def safeExtGet(prop, fallback) { 2 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 3 | } 4 | 5 | apply plugin: 'com.android.library' 6 | 7 | android { 8 | compileSdkVersion safeExtGet('compileSdkVersion', 26) 9 | buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3') 10 | 11 | defaultConfig { 12 | minSdkVersion safeExtGet('minSdkVersion', 16) 13 | targetSdkVersion safeExtGet('targetSdkVersion', 26) 14 | versionCode 1 15 | versionName "1.0" 16 | } 17 | lintOptions { 18 | abortOnError false 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation "com.facebook.react:react-native:+" 24 | } 25 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/me/listenzz/modal/TranslucentModalHostHelper.java: -------------------------------------------------------------------------------- 1 | package me.listenzz.modal; 2 | 3 | import android.content.Context; 4 | import android.content.res.Resources; 5 | import android.content.res.TypedArray; 6 | import android.graphics.Point; 7 | import android.os.Build; 8 | import android.view.Display; 9 | import android.view.WindowManager; 10 | 11 | import com.facebook.infer.annotation.Assertions; 12 | 13 | public class TranslucentModalHostHelper { 14 | private static final Point MIN_POINT = new Point(); 15 | private static final Point MAX_POINT = new Point(); 16 | private static final Point SIZE_POINT = new Point(); 17 | 18 | /** 19 | * To get the size of the screen, we use information from the WindowManager and 20 | * default Display. We don't use DisplayMetricsHolder, or Display#getSize() because 21 | * they return values that include the status bar. We only want the values of what 22 | * will actually be shown on screen. 23 | * We use Display#getSize() to determine if the screen is in portrait or landscape. 24 | * We don't use getRotation because the 'natural' rotation will be portrait on phones 25 | * and landscape on tablets. 26 | * This should only be called on the native modules/shadow nodes thread. 27 | */ 28 | public static Point getModalHostSize(Context context) { 29 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); 30 | Display display = Assertions.assertNotNull(wm).getDefaultDisplay(); 31 | // getCurrentSizeRange will return the min and max width and height that the window can be 32 | display.getCurrentSizeRange(MIN_POINT, MAX_POINT); 33 | // getSize will return the dimensions of the screen in its current orientation 34 | display.getSize(SIZE_POINT); 35 | 36 | int[] attrs = {android.R.attr.windowFullscreen}; 37 | Resources.Theme theme = context.getTheme(); 38 | TypedArray ta = theme.obtainStyledAttributes(attrs); 39 | boolean windowFullscreen = ta.getBoolean(0, false); 40 | 41 | // We need to add the status bar height to the height if we have a fullscreen window, 42 | // because Display.getCurrentSizeRange doesn't include it. 43 | Resources resources = context.getResources(); 44 | int statusBarId = resources.getIdentifier("status_bar_height", "dimen", "android"); 45 | int statusBarHeight = 0; 46 | if ((windowFullscreen || Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) && statusBarId > 0) { 47 | statusBarHeight = (int) resources.getDimension(statusBarId); 48 | } 49 | 50 | if (SIZE_POINT.x < SIZE_POINT.y) { 51 | // If we are vertical the width value comes from min width and height comes from max height 52 | return new Point(MIN_POINT.x, MAX_POINT.y + statusBarHeight); 53 | } else { 54 | // If we are horizontal the width value comes from max width and height comes from min height 55 | return new Point(MAX_POINT.x, MIN_POINT.y + statusBarHeight); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /android/src/main/java/me/listenzz/modal/TranslucentModalHostManager.java: -------------------------------------------------------------------------------- 1 | package me.listenzz.modal; 2 | 3 | import com.facebook.react.module.annotations.ReactModule; 4 | import com.facebook.react.uimanager.LayoutShadowNode; 5 | import com.facebook.react.uimanager.ThemedReactContext; 6 | import com.facebook.react.views.modal.ReactModalHostManager; 7 | import com.facebook.react.views.modal.ReactModalHostView; 8 | 9 | @ReactModule(name = ReactModalHostManager.REACT_CLASS) 10 | public class TranslucentModalHostManager extends ReactModalHostManager { 11 | 12 | @Override 13 | public boolean canOverrideExistingModule() { 14 | return true; 15 | } 16 | 17 | @Override 18 | protected ReactModalHostView createViewInstance(ThemedReactContext reactContext) { 19 | return new TranslucentModalHostView(reactContext); 20 | } 21 | 22 | @Override 23 | public LayoutShadowNode createShadowNodeInstance() { 24 | return new TranslucentModalHostShadowNode(); 25 | } 26 | 27 | @Override 28 | public Class getShadowNodeClass() { 29 | return TranslucentModalHostShadowNode.class; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /android/src/main/java/me/listenzz/modal/TranslucentModalHostShadowNode.java: -------------------------------------------------------------------------------- 1 | package me.listenzz.modal; 2 | 3 | import android.graphics.Point; 4 | 5 | import com.facebook.react.uimanager.LayoutShadowNode; 6 | import com.facebook.react.uimanager.ReactShadowNodeImpl; 7 | 8 | public class TranslucentModalHostShadowNode extends LayoutShadowNode { 9 | 10 | @Override 11 | public void addChildAt(ReactShadowNodeImpl child, int i) { 12 | super.addChildAt(child, i); 13 | Point modalSize = TranslucentModalHostHelper.getModalHostSize(getThemedContext()); 14 | child.setStyleWidth(modalSize.x); 15 | child.setStyleHeight(modalSize.y); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /android/src/main/java/me/listenzz/modal/TranslucentModalHostView.java: -------------------------------------------------------------------------------- 1 | package me.listenzz.modal; 2 | 3 | import android.annotation.TargetApi; 4 | import android.app.Activity; 5 | import android.app.Dialog; 6 | import android.content.Context; 7 | import android.graphics.Color; 8 | import android.os.Build; 9 | import android.view.View; 10 | import android.view.Window; 11 | import android.view.WindowInsets; 12 | import android.view.WindowManager; 13 | 14 | import androidx.core.view.ViewCompat; 15 | 16 | import com.facebook.react.bridge.ReactContext; 17 | import com.facebook.react.views.modal.ReactModalHostView; 18 | 19 | public class TranslucentModalHostView extends ReactModalHostView { 20 | 21 | public TranslucentModalHostView(Context context) { 22 | super(context); 23 | } 24 | 25 | @Override 26 | protected void showOrUpdate() { 27 | super.showOrUpdate(); 28 | Dialog dialog = getDialog(); 29 | if (dialog != null) { 30 | setStatusBarTranslucent(dialog.getWindow(), true); 31 | setStatusBarColor(dialog.getWindow(), Color.TRANSPARENT); 32 | setStatusBarStyle(dialog.getWindow(), isDark()); 33 | } 34 | } 35 | 36 | @TargetApi(23) 37 | private boolean isDark() { 38 | Activity activity = ((ReactContext) getContext()).getCurrentActivity(); 39 | // fix activity NPE 40 | if (activity == null) { 41 | return true; 42 | } 43 | return (activity.getWindow().getDecorView().getSystemUiVisibility() & View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR) != 0; 44 | } 45 | 46 | public static void setStatusBarTranslucent(Window window, boolean translucent) { 47 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 48 | View decorView = window.getDecorView(); 49 | if (translucent) { 50 | decorView.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() { 51 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 52 | @Override 53 | public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) { 54 | WindowInsets defaultInsets = v.onApplyWindowInsets(insets); 55 | return defaultInsets.replaceSystemWindowInsets( 56 | defaultInsets.getSystemWindowInsetLeft(), 57 | 0, 58 | defaultInsets.getSystemWindowInsetRight(), 59 | defaultInsets.getSystemWindowInsetBottom()); 60 | } 61 | }); 62 | } else { 63 | decorView.setOnApplyWindowInsetsListener(null); 64 | } 65 | ViewCompat.requestApplyInsets(decorView); 66 | } 67 | } 68 | 69 | public static void setStatusBarColor(final Window window, int color) { 70 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 71 | window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); 72 | window.setStatusBarColor(color); 73 | } 74 | } 75 | 76 | public static void setStatusBarStyle(Window window, boolean dark) { 77 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 78 | View decorView = window.getDecorView(); 79 | decorView.setSystemUiVisibility( 80 | dark ? View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR : 0); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /android/src/main/java/me/listenzz/modal/TranslucentModalReactPackage.java: -------------------------------------------------------------------------------- 1 | package me.listenzz.modal; 2 | 3 | import com.facebook.react.ReactPackage; 4 | import com.facebook.react.bridge.NativeModule; 5 | import com.facebook.react.bridge.ReactApplicationContext; 6 | import com.facebook.react.uimanager.ViewManager; 7 | 8 | import java.util.Arrays; 9 | import java.util.Collections; 10 | import java.util.List; 11 | 12 | public class TranslucentModalReactPackage implements ReactPackage { 13 | 14 | @Override 15 | public List createNativeModules(ReactApplicationContext reactContext) { 16 | return Collections.emptyList(); 17 | } 18 | 19 | @Override 20 | public List createViewManagers(ReactApplicationContext reactContext) { 21 | return Arrays.asList(new TranslucentModalHostManager()); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | } 4 | -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: false, 14 | }, 15 | }), 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-modal-translucent", 3 | "version": "5.0.0", 4 | "description": "Remove the StatusBar background for Modal on Android.", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/listenzz/react-native-modal-translucent.git" 8 | }, 9 | "nativePackage": true, 10 | "author": "listen ", 11 | "license": "MIT", 12 | "homepage": "https://github.com/listenzz/react-native-modal-translucent", 13 | "keywords": [ 14 | "react-native", 15 | "modal", 16 | "translucent", 17 | "statusbar" 18 | ], 19 | "scripts": { 20 | "start": "react-native start", 21 | "test": "echo \"Error: no test specified\" && exit 1", 22 | "lint": "./node_modules/.bin/eslint --fix --ext .js ./ && echo \"lint finished\" " 23 | }, 24 | "peerDependencies": { 25 | "react": ">=16.0.0", 26 | "react-native": ">=0.60.0" 27 | }, 28 | "devDependencies": { 29 | "@babel/core": "^7.3.4", 30 | "@babel/runtime": "^7.3.4", 31 | "babel-jest": "^24.5.0", 32 | "jest": "^24.5.0", 33 | "metro-react-native-babel-preset": "^0.55.0", 34 | "react": "16.8.6", 35 | "react-native": "0.60.4" 36 | }, 37 | "jest": { 38 | "preset": "react-native" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /playground/App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from "react"; 8 | import { 9 | Modal, 10 | Text, 11 | TouchableHighlight, 12 | View, 13 | Platform, 14 | StatusBar 15 | } from "react-native"; 16 | 17 | export default class App extends Component { 18 | state = { 19 | modalVisible: false 20 | }; 21 | 22 | setModalVisible(visible) { 23 | this.setState({ modalVisible: visible }); 24 | } 25 | 26 | render() { 27 | return ( 28 | 38 | {Platform.OS === "android" && ( 39 | 45 | )} 46 | { 51 | this.setModalVisible(!this.state.modalVisible); 52 | }} 53 | > 54 | 63 | Hello Modal! 64 | { 66 | this.setModalVisible(!this.state.modalVisible); 67 | }} 68 | > 69 | Hide Modal 70 | 71 | 72 | 73 | 74 | { 76 | this.setModalVisible(true); 77 | }} 78 | > 79 | Show Modal 80 | 81 | 82 | ); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /playground/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ModalTranslucentTest 4 | Project ModalTranslucentTest created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /playground/android/app/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /playground/android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /playground/android/app/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir=.. 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /playground/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.modaltranslucenttest", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.modaltranslucenttest", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /playground/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | 4 | project.ext.react = [ 5 | root : "../../../", 6 | entryFile: "playground/index.js", 7 | enableHermes : true, 8 | hermesCommand : "../../../node_modules/hermesvm/%OS-BIN%/hermes", 9 | ] 10 | 11 | apply from: "../../../node_modules/react-native/react.gradle" 12 | 13 | def enableHermes = project.ext.react.get("enableHermes", false) 14 | 15 | android { 16 | compileSdkVersion rootProject.ext.compileSdkVersion 17 | buildToolsVersion rootProject.ext.buildToolsVersion 18 | 19 | defaultConfig { 20 | applicationId "com.modaltranslucenttest" 21 | minSdkVersion rootProject.ext.minSdkVersion 22 | targetSdkVersion rootProject.ext.targetSdkVersion 23 | versionCode 1 24 | versionName "1.0" 25 | } 26 | 27 | splits { 28 | abi { 29 | reset() 30 | enable true 31 | universalApk false // If true, also generate a universal APK 32 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 33 | } 34 | } 35 | 36 | buildTypes { 37 | release { 38 | minifyEnabled false 39 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 40 | } 41 | } 42 | 43 | packagingOptions { 44 | pickFirst '**/armeabi-v7a/libc++_shared.so' 45 | pickFirst '**/x86/libc++_shared.so' 46 | pickFirst '**/arm64-v8a/libc++_shared.so' 47 | pickFirst '**/x86_64/libc++_shared.so' 48 | pickFirst '**/x86/libjsc.so' 49 | pickFirst '**/armeabi-v7a/libjsc.so' 50 | } 51 | } 52 | 53 | dependencies { 54 | implementation "com.facebook.react:react-native:+" // From node_modules 55 | if (enableHermes) { 56 | def hermesPath = "../../../node_modules/hermesvm/android/" 57 | debugImplementation files(hermesPath + "hermes-debug.aar") 58 | releaseImplementation files(hermesPath + "hermes-release.aar") 59 | } else { 60 | 61 | } 62 | implementation project(":modal-translucent") 63 | } -------------------------------------------------------------------------------- /playground/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 55 | -dontwarn android.text.StaticLayout 56 | 57 | # okhttp 58 | 59 | -keepattributes Signature 60 | -keepattributes *Annotation* 61 | -keep class okhttp3.** { *; } 62 | -keep interface okhttp3.** { *; } 63 | -dontwarn okhttp3.** 64 | 65 | # okio 66 | 67 | -keep class sun.misc.Unsafe { *; } 68 | -dontwarn java.nio.file.* 69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 70 | -dontwarn okio.** 71 | -------------------------------------------------------------------------------- /playground/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 14 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /playground/android/app/src/main/java/com/modaltranslucenttest/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.modaltranslucenttest; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "ModalTranslucentTest"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /playground/android/app/src/main/java/com/modaltranslucenttest/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.modaltranslucenttest; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.facebook.react.ReactNativeHost; 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.shell.MainReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | import me.listenzz.modal.TranslucentModalReactPackage; 15 | 16 | public class MainApplication extends Application implements ReactApplication { 17 | 18 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 19 | @Override 20 | public boolean getUseDeveloperSupport() { 21 | return BuildConfig.DEBUG; 22 | } 23 | 24 | @Override 25 | protected List getPackages() { 26 | return Arrays.asList( 27 | new MainReactPackage(), 28 | new TranslucentModalReactPackage() 29 | ); 30 | } 31 | 32 | @Override 33 | protected String getJSMainModuleName() { 34 | return "playground/index"; 35 | } 36 | }; 37 | 38 | @Override 39 | public ReactNativeHost getReactNativeHost() { 40 | return mReactNativeHost; 41 | } 42 | 43 | @Override 44 | public void onCreate() { 45 | super.onCreate(); 46 | SoLoader.init(this, /* native exopackage */ false); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/react-native-modal-translucent/4893a22577316e1cd057ee45f87ea8a4144ef5e1/playground/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/react-native-modal-translucent/4893a22577316e1cd057ee45f87ea8a4144ef5e1/playground/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/react-native-modal-translucent/4893a22577316e1cd057ee45f87ea8a4144ef5e1/playground/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/react-native-modal-translucent/4893a22577316e1cd057ee45f87ea8a4144ef5e1/playground/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /playground/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ModalTranslucentTest 3 | 4 | -------------------------------------------------------------------------------- /playground/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /playground/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "28.0.3" 6 | minSdkVersion = 16 7 | compileSdkVersion = 28 8 | targetSdkVersion = 28 9 | supportLibVersion = "28.0.0" 10 | } 11 | repositories { 12 | google() 13 | jcenter() 14 | } 15 | dependencies { 16 | classpath 'com.android.tools.build:gradle:3.4.2' 17 | 18 | // NOTE: Do not place your application dependencies here; they belong 19 | // in the individual module build.gradle files 20 | } 21 | } 22 | 23 | allprojects { 24 | repositories { 25 | google() 26 | jcenter() 27 | maven { 28 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 29 | url("$rootDir/../../node_modules/react-native/android") 30 | } 31 | maven { 32 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 33 | url "$rootDir/../../node_modules/react-native/android" 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /playground/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /playground/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/react-native-modal-translucent/4893a22577316e1cd057ee45f87ea8a4144ef5e1/playground/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /playground/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 17:39:56 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /playground/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /playground/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /playground/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /playground/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /playground/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ModalTranslucentTest' 2 | 3 | include ':app' 4 | 5 | include ':modal-translucent' 6 | project(':modal-translucent').projectDir = new File(rootProject.projectDir, '../../android') 7 | -------------------------------------------------------------------------------- /playground/index.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from "react-native"; 2 | import App from "./App"; 3 | 4 | AppRegistry.registerComponent("ModalTranslucentTest", () => App); 5 | -------------------------------------------------------------------------------- /screenshot/after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/react-native-modal-translucent/4893a22577316e1cd057ee45f87ea8a4144ef5e1/screenshot/after.png -------------------------------------------------------------------------------- /screenshot/before.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/listenzz/react-native-modal-translucent/4893a22577316e1cd057ee45f87ea8a4144ef5e1/screenshot/before.jpg --------------------------------------------------------------------------------