diff --git a/android/app/build.gradle b/android/app/build.gradle index d8e435a6b..2d175ca28 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -153,6 +153,7 @@ configurations.all { } dependencies { + implementation project(':react-native-navigation-bar-color') implementation project(':bugsnag-react-native') implementation project(':react-native-version-number') implementation project(':react-native-code-push') diff --git a/android/app/src/main/java/app/esteem/mobile/MainApplication.java b/android/app/src/main/java/app/esteem/mobile/MainApplication.java index 6e4700569..3b1f71590 100644 --- a/android/app/src/main/java/app/esteem/mobile/MainApplication.java +++ b/android/app/src/main/java/app/esteem/mobile/MainApplication.java @@ -3,6 +3,7 @@ package app.esteem.mobile; import android.app.Application; import com.facebook.react.ReactApplication; +import com.thebylito.navigationbarcolor.NavigationBarColorPackage; import com.bugsnag.BugsnagReactNative; import com.apsl.versionnumber.RNVersionNumberPackage; import com.microsoft.codepush.react.CodePush; @@ -44,6 +45,7 @@ public class MainApplication extends Application implements ReactApplication { protected List getPackages() { return Arrays.asList( new MainReactPackage(), + new NavigationBarColorPackage(), BugsnagReactNative.getPackage(), new RNVersionNumberPackage(), new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG), diff --git a/android/settings.gradle b/android/settings.gradle index 9b95305dd..87f8bc753 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'eSteem' +include ':react-native-navigation-bar-color' +project(':react-native-navigation-bar-color').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation-bar-color/android') include ':bugsnag-react-native' project(':bugsnag-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/bugsnag-react-native/android') include ':react-native-version-number' diff --git a/package.json b/package.json index 554e984d7..fd58123dd 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "react-native-linear-gradient": "^2.4.2", "react-native-modal-dropdown": "^0.6.2", "react-native-modal-popover": "0.0.12", + "react-native-navigation-bar-color": "^0.1.0", "react-native-render-html": "^4.1.2", "react-native-scrollable-tab-view": "^0.10.0", "react-native-slider": "^0.11.0", diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index fc6cd1835..5f7bfa731 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -8,6 +8,7 @@ import { bindActionCreators } from 'redux'; import Push from 'appcenter-push'; import get from 'lodash/get'; import AppCenter from 'appcenter'; +import changeNavigationBarColor from 'react-native-navigation-bar-color'; // Languages import en from 'react-intl/locale-data/en'; @@ -112,6 +113,11 @@ class ApplicationContainer extends Component { if (_isDarkTheme !== nextProps.isDarkTheme || selectedLanguage !== nextProps.selectedLanguage) { this.setState({ isRenderRequire: false }, () => this.setState({ isRenderRequire: true })); + if (nextProps.isDarkTheme) { + changeNavigationBarColor('#1e2835'); + } else { + changeNavigationBarColor('#FFFFFF'); + } } if (isLogingOut !== nextProps.isLogingOut && nextProps.isLogingOut) { diff --git a/yarn.lock b/yarn.lock index 69816cd86..e8f8cff18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7584,6 +7584,11 @@ react-native-modal-popover@0.0.12: lodash.debounce "^4.0.8" prop-types "^15.6.2" +react-native-navigation-bar-color@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/react-native-navigation-bar-color/-/react-native-navigation-bar-color-0.1.0.tgz#358be3eb8630dbaf5993ec9cf07b279590984f2e" + integrity sha512-Hymvfg40MH4vYgXZ5QgCk9i6BqcaD9inFiBGSj3Gobk0bq7O2G/uccs0+Dmlpe12RfC+R+XX6yvW7NTwOppQrQ== + react-native-render-html@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/react-native-render-html/-/react-native-render-html-4.1.2.tgz#dfd06ac7e87ed68b6421750e88dd7895d284935b" @@ -8682,6 +8687,11 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" +sprintf-js@^1.0.3: + version "1.1.2" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673" + integrity sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -9242,10 +9252,13 @@ unbzip2-stream@^1.0.9: buffer "^5.2.1" through "^2.3.8" -underscore.string@~2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.4.0.tgz#8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b" - integrity sha1-jN2PusTi0uoefi6Al8QvRCKA+Fs= +underscore.string@^3.3.5, underscore.string@~2.4.0: + version "3.3.5" + resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-3.3.5.tgz#fc2ad255b8bd309e239cbc5816fd23a9b7ea4023" + integrity sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg== + dependencies: + sprintf-js "^1.0.3" + util-deprecate "^1.0.2" underscore@~1.7.0: version "1.7.0" @@ -9336,7 +9349,7 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== -util-deprecate@^1.0.1, util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=