Components to control your app status and navigation bars.

Overview

βž– react-native-bars

This library helped you? Consider sponsoring!

Components to control your app status and navigation bars.

Heavily inspired by the built-in StatusBar module and react-native-transparent-status-and-navigation-bar by @MoOx (Thanks to them πŸ’– ).

npm version npm MIT
Platform - Android Platform - iOS


android demo

Recommendations

This module will works best with:

Support

version RN version Android version iOS version
1.0.0+ 0.65.0+ 6.0+ 11.0+

Installation

$ npm install --save react-native-bars
# --- or ---
$ yarn add react-native-bars

πŸ†˜ Manual linking

Because this package targets React Native 0.65.0+, you will probably don't need to link it manually. Otherwise if it's not the case, follow this additional instructions:

πŸ‘€ See manual linking instructions

Android

  1. Add the following lines to android/settings.gradle:
include ':react-native-bars'
project(':react-native-bars').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bars/android')
  1. Add the implementation line to the dependencies in android/app/build.gradle:
dependencies {
  // ...
  implementation project(':react-native-bars')
}
  1. Add the import and link the package in MainApplication.java:
import com.zoontek.rnbars.RNBarsPackage; // <- add the RNBarsPackage import

public class MainApplication extends Application implements ReactApplication {

  // …

  @Override
  protected List<ReactPackage> getPackages() {
    @SuppressWarnings("UnnecessaryLocalVariable")
    List<ReactPackage> packages = new PackageList(this).getPackages();
    // …
    packages.add(new RNBarsPackage());
    return packages;
  }

  // …
}

Setup

Android

  1. As this library only support Android 6+, you probably have to edit your android/build.gradle file:
buildscript {
  ext {
    buildToolsVersion = "30.0.2"
    minSdkVersion = 23 // <- set at least 23
    compileSdkVersion = 31 // <- set at least 31
    targetSdkVersion = 31 // <- set at least 31

    // …
  1. To setup initial bar styles on Android < 8.1, edit your android/app/src/main/res/values/styles.xml file:
    πŸ‘‰ Dont forget to edit android:windowLightStatusBar to match your initial styles.
<resources>

  <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
    <!-- Allow drawing under the system bars background -->
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:fitsSystemWindows">false</item>

    <!-- Set status bar background transparent -->
    <item name="android:statusBarColor">@android:color/transparent</item>

    <!-- Navigation bar will stay translucent on Android < 8.1 -->
    <item name="android:windowTranslucentNavigation">true</item>
  </style>

</resources>
  1. Then for Android >= 8.1, create (or edit) your android/app/src/main/res/values-v27/styles.xml file:
    πŸ‘‰ Dont forget to edit android:{windowLightStatusBar,windowLightNavigationBar} to match your initial styles.
<resources xmlns:tools="http://schemas.android.com/tools">

  <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
    <!-- Allow drawing under the system bars background -->
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:fitsSystemWindows">false</item>

    <!-- Set system bars background transparent -->
    <item name="android:statusBarColor">@android:color/transparent</item>
    <item name="android:navigationBarColor">@android:color/transparent</item>

    <!-- Disable auto contrasted system bars background (on Android 10+) -->
    <item name="android:enforceStatusBarContrast" tools:targetApi="q">false</item>
    <item name="android:enforceNavigationBarContrast" tools:targetApi="q">false</item>
  </style>

</resources>
  1. Finally edit your android/app/src/main/java/com/yourprojectname/MainActivity.java file:
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate; // <- add this necessary import
import com.zoontek.rnbars.RNBars; // <- add this necessary import

public class MainActivity extends ReactActivity {

  // …

  @Override
  protected ReactActivityDelegate createReactActivityDelegate() {
    return new ReactActivityDelegate(this, getMainComponentName()) {

      @Override
      protected void loadApp(String appKey) {
        super.loadApp(appKey);
        RNBars.init(MainActivity.this, "dark-content"); // <- initialize with initial bars styles (could be light-content)
      }
    };
  }
}

iOS

You can setup your initial status bar style in Xcode > General > Deployment Info:

Xcode setup

Usage

import * as React from "react";
import { StatusBar, NavigationBar, SystemBars } from "react-native-bars";

const App = () => {
  return (
    <>
      <StatusBar animated={true} barStyle="light-content" />
      <NavigationBar barStyle="light-content" />

      {/* Or, to update both with one component: */}
      <SystemBars animated={true} barStyle="light-content" />
    </>
  );
};

API

<StatusBar />

A component to control your app status bar.

import { StatusBar } from "react-native-bars";

type StatusBarProps = {
  // Should transition between status bar property changes be animated? (has no effect on Android)
  animated?: boolean;
  // Sets the color of the status bar content
  barStyle: "light-content" | "dark-content";
};

const App = () => (
  <>
    <StatusBar animated={true} barStyle="dark-content" />
    {/* … */}
  </>
);

StatusBar.pushStackEntry

const entry: StatusBarProps = StatusBar.pushStackEntry(
  props /*: StatusBarProps*/,
);

StatusBar.popStackEntry

StatusBar.popStackEntry(entry/*: StatusBarProps*/): void;

StatusBar.replaceStackEntry

const entry: StatusBarProps = StatusBar.replaceStackEntry(
  entry /*: StatusBarProps*/,
  props /*: StatusBarProps*/,
);

<NavigationBar />

A component to control your app navigation bar. It has no effect on iOS and Android < 8.1.

import { NavigationBar } from "react-native-bars";

type NavigationBarProps = {
  // Sets the color of the navigation bar content
  barStyle: "light-content" | "dark-content";
};

const App = () => (
  <>
    <NavigationBar barStyle="dark-content" />
    {/* … */}
  </>
);

NavigationBar.pushStackEntry

const entry: NavigationBarProps = NavigationBar.pushStackEntry(
  props /*: NavigationBarProps*/,
);

NavigationBar.popStackEntry

NavigationBar.popStackEntry(entry/*: NavigationBarProps*/): void;

NavigationBar.replaceStackEntry

const entry: NavigationBarProps = NavigationBar.replaceStackEntry(
  entry /*: NavigationBarProps*/,
  props /*: NavigationBarProps*/,
);

<SystemBars />

A component to control both your app status and navigation bars.

import { SystemBars } from "react-native-bars";

type SystemBarsProps = {
  // Should transition between bars property changes be animated? (has no effect on Android)
  animated?: boolean;
  // Sets the color of the bars content
  barStyle: "light-content" | "dark-content";
};

const App = () => (
  <>
    <SystemBars animated={true} barStyle="dark-content" />
    {/* … */}
  </>
);
Comments
  • Keyboard problems

    Keyboard problems

    Bug summary

    windowSoftInputMode="adjustResize" not working after connecting react-native-bars Keyboard always opens on top of the screen

    The default state of the example from the repository:

    https://user-images.githubusercontent.com/39951413/191948054-ca4898fe-7a67-4183-9096-842064f363b5.mov

    After removing this line RNBars.init(this, "dark-content"); android/app/src/main/java/com/rnbootsplashexample/MainActivity.java:26

    https://user-images.githubusercontent.com/39951413/191948078-de28b720-6c7f-48cc-ab04-3f4346ae9912.mov

    In both cases I have android:windowSoftInputMode="adjustResize" in AndroidManifest. And I expect the first case to have the same behavior. But it's not.

    Library version

    1.2.2

    Environment info

    "react-native": "0.70.0",
    "react-native-bars": "^1.2.2",
    "react-native-bootsplash": "^4.3.2",
    

    Steps to reproduce

    This is an example with react-native-bootsplash template

    Reproducible sample code

    import * as React from "react";
    import {
      ScrollView,
      TextInput,
      View,
    } from "react-native";
    import * as BootSplash from "react-native-bootsplash";
    
    export const App = () => {
      React.useEffect(() => {
        BootSplash.hide();
      }, []);
    
      return (
        <ScrollView>
          <View style={{height: 500, borderWidth: 1, marginBottom: 10}} />
          <TextInput style={{borderWidth: 1, borderRadius: 10, padding: 10}} />
        </ScrollView>
      );
    };
    
    bug 
    opened by exzos28 10
  • On Android, when I open the app for the second time, the barStyle setting is invalid

    On Android, when I open the app for the second time, the barStyle setting is invalid

    Bug summary

    In order to cooperate with the library react-native-bootsplash, a dark style is set in MainActivity: RNBars.init(MainActivity.this, "dark-content");(this is no problem).

    Then set the default light-content in App.tsx. After exiting the app, restart the app and you will see that the status bar style has changed to dark-content.

    Library version

    1.0.4

    Environment info

    System:
        OS: macOS 11.5.2
        CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
        Memory: 62.12 MB / 8.00 GB
        Shell: 5.8 - /bin/zsh
      Binaries:
        Node: 15.4.0 - /usr/local/bin/node
        Yarn: 1.22.17 - /usr/local/bin/yarn
        npm: 7.0.15 - /usr/local/bin/npm
        Watchman: Not Found
      Managers:
        CocoaPods: 1.11.2 - /usr/local/bin/pod
      SDKs:
        iOS SDK:
          Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
        Android SDK: Not Found
      IDEs:
        Android Studio: 4.2 AI-202.7660.26.42.7486908
        Xcode: 12.5/12E262 - /usr/bin/xcodebuild
      Languages:
        Java: 11.0.8 - /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/javac
        Python: 2.7.16 - /usr/bin/python
      npmPackages:
        @react-native-community/cli: Not Found
        react: 17.0.2 => 17.0.2 
        react-native: 0.66.3 => 0.66.3 
      npmGlobalPackages:
        *react-native*: Not Found
    

    Steps to reproduce

    1.Modify App.tsx in the example: Change const [isLightStatus, setIsLightStatus] = React.useState(false); to const [isLightStatus, setIsLightStatus] = React.useState(true);.

    2.Exit the app, restart the app. (Click the virtual back button, the app is still on the recently used app screen)

    Reproducible sample code

    I used your sample project to debug, so you only need to modify the code according to the reproduction steps.
    
    bug 
    opened by 1280103995 8
  • bar color changed by setSoftInputMode

    bar color changed by setSoftInputMode

    Bug summary

    bar color changed by setSoftInputMode, maybe other native operations.

    I tried to use this package in a project which uses wix/react-native-ui-lib v5, the bar colors are changed when keyboard shown etc.

    https://user-images.githubusercontent.com/95836286/148735227-37861f90-bd00-4af1-9927-5ae9efc8020b.mp4

    in my reproduction setSoftInputMode is called after 4s.

    Library version

    1.1.1

    Environment info

    System:
        OS: macOS 11.6.2
        CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
        Memory: 68.87 MB / 16.00 GB
        Shell: 5.8 - /bin/zsh
      Binaries:
        Node: 16.13.1 - ~/.n/bin/node
        Yarn: 1.22.17 - /usr/local/bin/yarn
        npm: 8.1.2 - ~/.n/bin/npm
        Watchman: 2022.01.03.00 - /usr/local/bin/watchman
      Managers:
        CocoaPods: 1.11.2 - /usr/local/bin/pod
      SDKs:
        iOS SDK:
          Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
        Android SDK:
          API Levels: 24, 28, 29, 30, 31, 32
          Build Tools: 28.0.3, 29.0.2, 30.0.2, 32.0.0
          System Images: android-30 | Google APIs Intel x86 Atom_64
          Android NDK: Not Found
      IDEs:
        Android Studio: 2020.3 AI-203.7717.56.2031.7935034
        Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
      Languages:
        Java: 1.8.0_292 - /Users/user1/.jenv/shims/javac
      npmPackages:
        @react-native-community/cli: Not Found
        react: 17.0.2 => 17.0.2
        react-native: 0.66.4 => 0.66.4
        react-native-macos: Not Found
      npmGlobalPackages:
        *react-native*: Not Found
    

    Steps to reproduce

    1. call window.setSoftInputMode after bars config.

    Reproducible sample code

    sample code

    bug 
    opened by web3luhao 6
  • Add setBarStyle method

    Add setBarStyle method

    Why it is needed?

    Sometimes people don't want to update barStyle by rendering components. Therefore, providing static methods can meet these needs.

    Currently I switch screens back and forth in the TabBar of react-navigation, and the barStyle has not changed (rendered by components). Therefore, I want to change the barStyle in a way similar to navigation.addListener('focus').:grin:

    Possible implementation

    Add the setBarStyle method to the component.

    StatusBar.tsx

    export class StatusBar extends React.Component<StatusBarProps> {
      private static propsStack: StatusBarProps[] = [];
      private static immediate: NodeJS.Immediate | null = null;
      private static mergedProps: StatusBarProps | null = null;
    
      static setBarStyle(props: StatusBarProps) {
        const animated = props.animated || false;
        const oldProps = StatusBar.mergedProps;
        if ((props.barStyle === "light-content" || props.barStyle === "dark-content")
          && oldProps?.barStyle !== props.barStyle)
        {
          if (Platform.OS === "android") {
            NativeModule?.setStatusBarStyle(props.barStyle);
          } else {
            RNStatusBar.setBarStyle(props.barStyle, animated);
          }
          /** Is it necessary ?*/
          // StatusBar.mergedProps = {
          //   ...props,
          //   barStyle: "light-content",
          // };
        }
      }
     
      ..............
    }
    

    NavigationBar.tsx

    export class NavigationBar extends React.Component<NavigationBarProps> {
      private static propsStack: NavigationBarProps[] = [];
      private static immediate: NodeJS.Immediate | null = null;
      private static mergedProps: NavigationBarProps | null = null;
    
      static setBarStyle(props: NavigationBarProps) {
        const oldProps = NavigationBar.mergedProps;
        if (props.barStyle === "light-content" || props.barStyle === "dark-content") {
          if (isSupportedPlatform && oldProps?.barStyle !== props.barStyle) {
            NativeModule?.setNavigationBarStyle(props.barStyle);
          }
          /** Is it necessary ?*/
          // NavigationBar.mergedProps = {
          //   ...props,
          //   barStyle: "light-content",
          // };
        }
      }
    
      .................
    }
    

    Code sample

    App.js
    
    import React, {useEffect} from 'react';
    import {Text, View} from 'react-native';
    import {NavigationContainer} from '@react-navigation/native';
    import {createStackNavigator} from '@react-navigation/stack';
    import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
    import {NavigationBar, StatusBar} from './src/ts'; //Change the code yourself
    
    function HomeScreen({navigation}) {
      useEffect(() => {
        const unsubscribe = navigation.addListener('focus', () => {
          StatusBar.setBarStyle({barStyle: 'light-content'});
          NavigationBar.setBarStyle({barStyle: 'light-content'});
        });
        return () => {
          unsubscribe();
        };
      }, [navigation]);
    
      return (
        <View
          style={{
            flex: 1,
            justifyContent: 'center',
            alignItems: 'center',
            backgroundColor: 'pink',
          }}>
          <Text>light-content</Text>
        </View>
      );
    }
    
    function ProfileScreen({navigation}) {
      useEffect(() => {
        const unsubscribe = navigation.addListener('focus', () => {
          StatusBar.setBarStyle({barStyle: 'dark-content'});
          NavigationBar.setBarStyle({barStyle: 'dark-content'});
        });
        return () => {
          unsubscribe();
        };
      }, [navigation]);
    
      return (
        <View
          style={{
            flex: 1,
            justifyContent: 'center',
            alignItems: 'center',
            backgroundColor: 'white',
          }}>
          <Text>dark-content</Text>
        </View>
      );
    }
    
    const Tab = createBottomTabNavigator();
    const TabStack = () => {
      return (
        <Tab.Navigator
          screenOptions={{
            headerStyle: {
              backgroundColor: 'green',
            },
            tabBarStyle: {
              backgroundColor: 'pink',
            },
          }}>
          <Tab.Screen name="Home" component={HomeScreen} />
          <Tab.Screen name="Profile" component={ProfileScreen} />
        </Tab.Navigator>
      );
    };
    
    const Stack = createStackNavigator();
    const AppNavigator = () => {
      return (
        <Stack.Navigator
          screenOptions={{
            headerShown: false,
          }}>
          <Stack.Screen name={'Tab'} component={TabStack} />
        </Stack.Navigator>
      );
    };
    
    export default function App() {
      return (
        <NavigationContainer>
          <AppNavigator />
        </NavigationContainer>
      );
    }
    
    
    "dependencies": {
        "@react-native-masked-view/masked-view": "^0.2.6",
        "@react-navigation/bottom-tabs": "^6.0.9",
        "@react-navigation/native": "^6.0.6",
        "@react-navigation/stack": "^6.0.11",
        "prop-types": "^15.7.2",
        "react": "17.0.2",
        "react-native": "0.66.3",
        "react-native-gesture-handler": "^1.10.3",
        "react-native-safe-area-context": "^3.3.2",
        "react-native-screens": "^3.9.0"
      }
    
    opened by 1280103995 6
  • On Android, the height of the navigation bar does not change after switching the navigation type.

    On Android, the height of the navigation bar does not change after switching the navigation type.

    Bug summary

    In the phone settings, after switching the button navigation to the sliding gesture navigation, the height obtained through NavigationBar.currentHeight is still the previous value.

    Reading NavigationBar.tsx can see static currentHeight = NativeModule?.navigationBarHeight;, here a fixed value is returned.

    In the StatusBar.js source code:

    static currentHeight: ?number =
         Platform.OS ==='android'
           ? NativeStatusBarManagerAndroid.getConstants().HEIGHT
           : null;
    

    In the NativeStatusBarManagerAndroid.js source code:

    getConstants(): {|
        +HEIGHT: number,
        +DEFAULT_BACKGROUND_COLOR?: number,
      |} {
        if (constants == null) {
          constants = NativeModule.getConstants();
        }
        return constants;
      },
    

    I am not familiar with flow and typescript, and I cannot push a PR:disappointed:. Can we learn from this approach?

    Device: Samsung Galaxy A51 (Android 11)

    Library version

    1.0.4

    Environment info

    System:
        OS: macOS 11.5.2
        CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
        Memory: 110.27 MB / 8.00 GB
        Shell: 5.8 - /bin/zsh
      Binaries:
        Node: 15.4.0 - /usr/local/bin/node
        Yarn: 1.22.17 - /usr/local/bin/yarn
        npm: 7.0.15 - /usr/local/bin/npm
        Watchman: Not Found
      Managers:
        CocoaPods: 1.11.2 - /usr/local/bin/pod
      SDKs:
        iOS SDK:
          Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
        Android SDK: Not Found
      IDEs:
        Android Studio: 4.2 AI-202.7660.26.42.7486908
        Xcode: 12.5/12E262 - /usr/bin/xcodebuild
      Languages:
        Java: 11.0.8 - /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/javac
        Python: 2.7.16 - /usr/bin/python
      npmPackages:
        @react-native-community/cli: Not Found
        react: Not Found
        react-native: Not Found
      npmGlobalPackages:
        *react-native*: Not Found
    

    Steps to reproduce

    1. In the phone settings, change the button navigation to gesture navigation.
    2. In App.tsx, call NavigationBar.currentHeight.

    Reproducible sample code

    I just run the example project in the repository.
    
    bug 
    opened by 1280103995 4
  • Initial load of Status Bar does not respect react-native useColorScheme hook

    Initial load of Status Bar does not respect react-native useColorScheme hook

    Bug summary

    So after going through the setup docs and getting things working, everything works just fine. The only thing I noticed is the initial load does not respect what color is set for the user's device. For example my current code:

    const isDarkMode = useColorScheme() === 'dark';
    
    <SystemBars
      animated={true}
      barStyle={isDarkMode ? 'light-content' : 'dark-content'}
    />
    

    https://user-images.githubusercontent.com/6226652/191576643-436aad71-ee4f-46d8-8a6a-f1912ae5fde3.mov

    Is there a fix to allow the <SystemBars /> initial styles to be relevant to the useColorScheme hook?

    Library version

    1.2.2

    Environment info

    System:
        OS: macOS 13.0
        CPU: (10) arm64 Apple M1 Max
        Memory: 1.44 GB / 32.00 GB
        Shell: 5.8.1 - /bin/zsh
      Binaries:
        Node: 18.9.0 - /opt/homebrew/bin/node
        Yarn: 1.22.18 - ~/.yarn/bin/yarn
        npm: 8.19.1 - /opt/homebrew/bin/npm
        Watchman: Not Found
      Managers:
        CocoaPods: 1.11.3 - /Users/vikrampal/.rbenv/shims/pod
      SDKs:
        iOS SDK:
          Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
        Android SDK: Not Found
      IDEs:
        Android Studio: 2021.2 AI-212.5712.43.2112.8815526
        Xcode: 14.0/14A309 - /usr/bin/xcodebuild
      Languages:
        Java: 18.0.2 - /usr/bin/javac
      npmPackages:
        @react-native-community/cli: Not Found
        react: 18.1.0 => 18.1.0 
        react-native: 0.70.1 => 0.70.1 
        react-native-macos: Not Found
      npmGlobalPackages:
        *react-native*: Not Found
    

    Steps to reproduce

    Steps show in the sample code.

    Reproducible sample code

    MainActivity.java

      @Override
      protected void onCreate(Bundle savedInstanceState) {
        RNBootSplash.init(this);
        super.onCreate(null);
        RNBars.init(this, "light-content");
      }
    

    values/styles.xml

    <resources>
    
        <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
            <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
    
            <!-- Allow drawing under the system bars background -->
            <item name="android:windowDrawsSystemBarBackgrounds">true</item>
            <item name="android:fitsSystemWindows">false</item>
    
            <!-- Set status bar background transparent -->
            <item name="android:statusBarColor">@android:color/transparent</item>
    
            <!-- Navigation bar will stay translucent on Android < 8.1 -->
            <item name="android:windowTranslucentNavigation">true</item>
        </style>
    
        <!-- BootTheme should inherit from Theme.SplashScreen -->
        <style name="BootTheme" parent="Theme.SplashScreen">
            <item name="windowSplashScreenBackground">@color/bootsplash_background</item>
            <item name="windowSplashScreenAnimatedIcon">@mipmap/bootsplash_logo</item>
            <item name="postSplashScreenTheme">@style/AppTheme</item>
    
            <!-- Status bar initial style: true = dark-content, false = light-content -->
            <item name="android:windowLightStatusBar">true</item>
    
            <!-- Navigation bar will stay translucent on Android < 8.1 -->
            <item name="android:windowTranslucentNavigation">true</item>
        </style>
    
    </resources>
    

    values-v27/styles.xml

    <resources xmlns:tools="http://schemas.android.com/tools">
    
        <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
            <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
    
            <!-- Allow drawing under the system bars background -->
            <item name="android:windowDrawsSystemBarBackgrounds">true</item>
            <item name="android:fitsSystemWindows">false</item>
    
            <!-- Set system bars background transparent -->
            <item name="android:statusBarColor">@android:color/transparent</item>
            <item name="android:navigationBarColor">@android:color/transparent</item>
    
            <!-- Disable auto contrasted system bars background -->
            <item name="android:enforceStatusBarContrast" tools:targetApi="q">false</item>
            <item name="android:enforceNavigationBarContrast" tools:targetApi="q">false</item>
        </style>
    
        <!-- BootTheme should inherit from Theme.SplashScreen -->
        <style name="BootTheme" parent="Theme.SplashScreen">
            <item name="windowSplashScreenBackground">@color/bootsplash_background</item>
            <item name="windowSplashScreenAnimatedIcon">@mipmap/bootsplash_logo</item>
            <item name="postSplashScreenTheme">@style/AppTheme</item>
    
            <!-- Bars initial styles: true = dark-content, false = light-content -->
            <item name="android:windowLightStatusBar">true</item>
            <item name="android:windowLightNavigationBar">true</item>
        </style>
    
    </resources>
    
    opened by MyPalVikram 3
  • Ability to change color/transparency

    Ability to change color/transparency

    Why it is needed?

    Because not all screens with fully transparent bars look good. Implementing custom View with background color can lead to unexpected behavior in landscape mode, or on other devices.

    Possible implementation

    No response

    Code sample

    No response

    opened by exzos28 2
  • StatusBar not changing on Android API 33

    StatusBar not changing on Android API 33

    Bug summary

    This problem only seems to happen on Android API 33 (it is still in beta, so maybe it is normal for now, let us know).

    Screenshot 2022-06-30 at 15 31 29

    Followed the instruction from v1.1.2 because I am with react-native 0.67.4 (not sure if I can keep updating rn-bars keeping 0.67.4): https://github.com/zoontek/react-native-bars/blob/1.1.2/README.md

    Library version

    1.1.2

    Environment info

    System:
        OS: macOS 12.4
        CPU: (4) x64 Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
        Memory: 40.69 MB / 24.00 GB
        Shell: 5.8.1 - /bin/zsh
      Binaries:
        Node: 18.4.0 - /var/folders/b3/_d2wl_ls4xndmw5tgd8hn3c40000gn/T/yarn--1656599716692-0.5440728475652528/node
        Yarn: 1.22.19 - /var/folders/b3/_d2wl_ls4xndmw5tgd8hn3c40000gn/T/yarn--1656599716692-0.5440728475652528/yarn
        npm: 8.12.1 - /usr/local/bin/npm
        Watchman: 2022.06.27.00 - /usr/local/bin/watchman
      Managers:
        CocoaPods: 1.11.3 - /usr/local/bin/pod
      SDKs:
        iOS SDK:
          Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
        Android SDK:
          API Levels: 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33
          Build Tools: 23.0.1, 25.0.1, 28.0.3, 29.0.2, 30.0.1, 30.0.2, 31.0.0, 32.0.0, 33.0.0
          System Images: android-22 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom, android-24 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-31 | ARM 64 v8a, android-31 | Intel x86 Atom_64, android-31 | Google APIs ARM 64 v8a, android-31 | Google APIs Intel x86 Atom_64, android-31 | Google Play ARM 64 v8a, android-31 | Google Play Intel x86 Atom_64, android-32 | Google APIs Intel x86 Atom_64, android-33 | Google APIs Intel x86 Atom_64
          Android NDK: Not Found
      IDEs:
        Android Studio: 2021.1 AI-211.7628.21.2111.8193401
        Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
      Languages:
        Java: 11.0.15 - /usr/bin/javac
      npmPackages:
        @react-native-community/cli: Not Found
        react: 17.0.2 => 17.0.2
        react-native: 0.67.4 => 0.67.4
        react-native-macos: Not Found
      npmGlobalPackages:
        *react-native*: Not Found
    

    Steps to reproduce

    1. Install react-native-bars (v1.1.2)
    2. Install react-native-bootsplash (v4.2.2)
    3. Follow documentation here: https://github.com/zoontek/react-native-bars/blob/1.1.2/README.md
    4. Run Android API 33 emulator

    Reproducible sample code

    Let me know if it is necessary or if this is expected (since 33 is still in beta)
    
    bug 
    opened by nelsonprsousa 2
  • Fix: local variable accessed from inner class

    Fix: local variable accessed from inner class

    node_modules/react-native-bars/android/src/main/java/com/zoontek/rnbars/RNBarsModule.java:68: error: local variable insetsController is accessed from within inner class; needs to be declared final
              insetsController.setAppearanceLightStatusBars("dark-content".equals(styles));
              ^
    node_modules/react-native-bars/android/src/main/java/com/zoontek/rnbars/RNBarsModule.java:69: error: local variable insetsController is accessed from within inner class; needs to be declared final
              insetsController.setAppearanceLightNavigationBars("dark-content".equals(styles));
              ^
    node_modules/react-native-bars/android/src/main/java/com/zoontek/rnbars/RNBarsModule.java:81: error: local variable insetsController is accessed from within inner class; needs to be declared final
              insetsController.setAppearanceLightStatusBars("dark-content".equals(styles));
    

    Summary

    Test Plan

    What's required for testing (prerequisites)?

    What are the steps to reproduce (after prerequisites)?

    Compatibility

    | OS | Implemented | | ------- | :---------: | | iOS | ❌ | | Android | βœ… |

    Checklist

    • [ ] I have tested this on a device and a simulator
    • [ ] I added the documentation in README.md
    • [ ] I added a sample use of the API in the example project (example/App.tsx)
    opened by chrismcleod 2
  • Change the color of the NavigationBar

    Change the color of the NavigationBar

    Why it is needed?

    Add "color" or "backgroundColor" property in <NavigationBar /> to change the color in running time

    Possible implementation

    Similar to what we have in the native <StatusBar />.

    Code sample

    No response

    Just let me know if this is possible, I can help implement it if so.

    opened by yepMad 1
  • Keyboard problems

    Keyboard problems

    Bug summary

    windowSoftInputMode="adjustResize" not working after connecting react-native-bars Keyboard always opens on top of the screen

    Library version

    1.2.2

    Environment info

    "react-native": "0.70.0",
    

    Steps to reproduce

    Reproducible sample code

    -
    
    opened by exzos28 1
  • After adding RN Bars, items under the Android keyboard move up. Removing this package fixes the issue.

    After adding RN Bars, items under the Android keyboard move up. Removing this package fixes the issue.

    Bug summary

    A bizarre bug occurs when installing RN bars. On my login screen, I have components that are spaced apart. On Android, this will move up the bottom component when the keyboard is presented. iOS is fine. I've tracked the issue to this package by starting a fresh React Native project and setting up just one screen with these packages.

    I've followed the sets on both platforms to set this up. But at this time I've had to remove it to prevent Android from malfunctioning.

    Here is a video on the behavior.

    https://imgur.com/a/P0xmuKN

    Library version

    1.3.0

    Environment info

    System:
        OS: macOS 13.1
        CPU: (10) arm64 Apple M1 Max
        Memory: 1.45 GB / 32.00 GB
        Shell: 5.8.1 - /bin/zsh
      Binaries:
        Node: 16.18.1 - /opt/homebrew/opt/node@16/bin/node
        Yarn: 1.22.18 - ~/.yarn/bin/yarn
        npm: 8.19.2 - /opt/homebrew/opt/node@16/bin/npm
        Watchman: Not Found
      Managers:
        CocoaPods: 1.11.3 - /Users/vikrampal/.rbenv/shims/pod
      SDKs:
        iOS SDK:
          Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
        Android SDK: Not Found
      IDEs:
        Android Studio: 2021.2 AI-212.5712.43.2112.8815526
        Xcode: 14.2/14C18 - /usr/bin/xcodebuild
      Languages:
        Java: 18.0.2 - /usr/bin/javac
      npmPackages:
        @react-native-community/cli: Not Found
        react: 18.2.0 => 18.2.0 
        react-native: 0.70.6 => 0.70.6 
        react-native-macos: Not Found
      npmGlobalPackages:
        *react-native*: Not Found
    

    Steps to reproduce

    1. …
    2. …

    Reproducible sample code

    Video provided. A screen in a stack with two items spaced apart.
    
    bug 
    opened by MyPalVikram 0
Releases(1.3.0)
  • 1.3.0(Oct 3, 2022)

  • 1.2.3(Sep 27, 2022)

    • Update project and example dependencies
    • Add a step in the Android documentation to mention adjustPan (fixes #15)

    To fix keyboard issues, update your AndroidManifest.xml file to set android:windowSoftInputMode to adjustPan:

    <activity
        android:name=".MainActivity"
        // …
        android:launchMode="singleTask"
    -   android:windowSoftInputMode="adjustResize"
    +   android:windowSoftInputMode="adjustPan"
    
    Source code(tar.gz)
    Source code(zip)
  • 1.2.2(Aug 14, 2022)

  • 1.2.1(Aug 12, 2022)

    • Update project and example dependencies
    • Update the Android setup documentation. It's now recommended to use onCreate instead of loadApp to init react-native-bars as soon as possible:
    import com.facebook.react.ReactActivity;
    import com.facebook.react.ReactActivityDelegate;
    import com.facebook.react.ReactRootView;
    
    + import android.os.Bundle;
    import com.zoontek.rnbars.RNBars;
    
    public class MainActivity extends ReactActivity {
    
      // …
    
    + @Override
    + protected void onCreate(Bundle savedInstanceState) {
    +   super.onCreate(savedInstanceState); // or super.onCreate(null) with react-native-screens
    +   RNBars.init(this "dark-content"); // could be light-content
    + }
    
      public static class MainActivityDelegate extends ReactActivityDelegate {
    
        // …
    
    -   @Override
    -   protected void loadApp(String appKey) {
    -     super.loadApp(appKey);
    -     RNBars.init(getPlainActivity(), "dark-content"); // could be light-content
    -   }
      }
    }
    
    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Jun 23, 2022)

  • 1.1.5(Jun 19, 2022)

  • 1.1.4(May 16, 2022)

  • 1.1.3(Mar 31, 2022)

  • 1.1.2(Feb 4, 2022)

  • 1.1.1(Dec 13, 2021)

  • 1.1.0(Dec 11, 2021)

  • 1.0.4(Nov 15, 2021)

    • Add basic support for Android 5.x (fallback to translucent system bars)

    Full Changelog: https://github.com/zoontek/react-native-bars/compare/1.0.3...1.0.4

    Source code(tar.gz)
    Source code(zip)
  • 1.0.3(Nov 15, 2021)

  • 1.0.2(Nov 14, 2021)

    • Switch to AndroidX core module
    • Remove android:windowLightStatusBar and android:windowLightNavigationBar from styles.xml

    ⚠️ Small breaking change: RNBars.init now needs the initial bars styles

    Full Changelog: https://github.com/zoontek/react-native-bars/compare/1.0.1...1.0.2

    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Nov 14, 2021)

    • Add android:windowDrawsSystemBarBackgrounds and android:fitsSystemWindows in styles.xml
    • Fix status bar not updating on Android < 8.1
    • Fix NavigationBar.currentHeight type

    Full Changelog: https://github.com/zoontek/react-native-bars/compare/1.0.0...1.0.1

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Nov 13, 2021)

Owner
Mathieu Acthernoene
Curious developer.
Mathieu Acthernoene
Simple and lightweight application which is checking status of your web services and send a notification if it is down.

rose-uptimer Simple and lightweight application which is checking status of your web services and send a notification if it is down. Example configura

RoseSapphire 3 Sep 25, 2022
Imports waypoints from DCS F10 map into the plane navigation system, like a Data Transfer Cartidge.

DCSTheWay Imports waypoints from DCS F10 map into the plane navigation system, like a Data Transfer Cartridge. Special thanks to kukiric for helping o

Aaron Daniel 85 Dec 27, 2022
With react-native-update-in-app library you can easily implement in-app updates in your React Native app using CDN or any other file server

React Native In-App update With react-native-update-in-app library you can easily implement in-app updates in your React Native app using CDN or any o

Nepein Andrey 7 Dec 21, 2022
This app corrects your sitting posture and provides feedback in real time in conjunction with the app. A sensor of 31 cells detects your posture to get better life-wellness

Notichair μ‹€μ‹œκ°„ μžμ„ΈλΆ„μ„ 및 ꡐ정 μŠ€λ§ˆνŠΈμ²΄μ–΄ ?? 상λͺ…λŒ€ν•™κ΅ PRIME κ²½μ§„λŒ€νšŒ μˆ˜μƒ ?? μš”κ΅¬μ‚¬ν•­ 31-cell sensor (mdxs-16-5610) λͺ©μ°¨ 1. μ†Œκ°œ ν”„λ‘œμ νŠΈ λ‚΄μš© μ†Œκ°œ 2. 개발 ν™˜κ²½ 사전 μ„€μ • 및 ν™˜κ²½ ꡬ좕 3. κΈ°λŠ₯ Sensors Ap

Minuk_LEE 3 Jan 15, 2022
PortalController - A rudimentary TeamViewer-like remote control app for Android, using ws.

PortalController A TeamViewer-like app for Android-to-Android remote control, using node.js and websockets (ws). Some insight The reason I call it rud

Mike Anderson 10 Dec 15, 2022
Admob for React Native with powerful hooks and components

React Native Admob ⚠️ Please note, this package is under active development, which means it may be not stable to apply on production. Please use this

null 128 Jan 6, 2023
Modular and customizable Material Design UI components for Android

Material Components for Android Material Components for Android (MDC-Android) help developers execute Material Design. Developed by a core team of eng

Material Components 14.4k Jan 3, 2023
A spring cloud infrastructure provides various of commonly used cloud components and auto-configurations for high project consistency

A spring cloud infrastructure provides various of commonly used cloud components and auto-configurations for high project consistency.

Project-Hephaestus 2 Feb 8, 2022
corrects your sitting posture and provides feedback in real time in conjunction with the app. A sensor of 31 cells detects your posture to get better life-wellness

Notichair μ‹€μ‹œκ°„ μžμ„ΈλΆ„μ„ 및 ꡐ정 μŠ€λ§ˆνŠΈμ²΄μ–΄ ?? 상λͺ…λŒ€ν•™κ΅ PRIME κ²½μ§„λŒ€νšŒ μˆ˜μƒ ?? μš”κ΅¬μ‚¬ν•­ 31-cell sensor (mdxs-16-5610) λͺ©μ°¨ 1. μ†Œκ°œ ν”„λ‘œμ νŠΈ λ‚΄μš© μ†Œκ°œ 2. 개발 ν™˜κ²½ 사전 μ„€μ • 및 ν™˜κ²½ ꡬ좕 3. κΈ°λŠ₯ Sensors Ap

Minuk_LEE 3 Jan 15, 2022
DM Movie is an app with several movies catalogued through a database, you enter your email and your rating of the movie

DM Movie is an app with several movies catalogued through a database, you enter your email and your rating of the movie

Davi M. G. de Almeida 5 Jan 28, 2022
Lightweight React Native UI Components inspired on Vant

vant-react-native Install yarn add vant-react-native Or npm install vant-react-native Usage import React, { Component } from 'react'; import { View, T

ζ΄›η«Ή 51 Sep 29, 2022
Echo client-server components to evaluate Project Loom virtual threads.

Overview Project Loom is the OpenJDK initiative to introduce user-mode threads in Java. The purpose of this repository is to compare Project Loom virt

Elliot Barlas 15 Nov 1, 2022
Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based system

FRC 2022 Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based s

null 4 Oct 4, 2022
Swerve control, simulation, and trajectory generation / following. Everything you need for swerve.

BearSwerve BearSwerve is intended to be an all in one swerve solution including: teleop driving, simulation, trajectory following and more. It combine

null 7 Dec 28, 2022
Pandora - allowing to control different agents (Windows & Linux machine) from server(s) and master

Pandora Pandora is now an open-source project allowing to control different agents (Windows & Linux machine) from server(s) and master. Features Auto-

nz 75 Dec 22, 2022
An open source Minecraft plugin that allows operators to control who has access to the nether.

Nether Access Controller Description Nether Access Controller is a Minecraft plugin that allows operators to control access to the nether. It is essen

Daniel Stephenson 2 Feb 12, 2022
The utility is designed to implement version control of APEX application pages.

Oracle APEX version control tool The utility is designed to implement version control of APEX application pages. How it works The developer exports th

Oleksii Vykhristiyk 6 Aug 25, 2022
Gitlet - A version control system for managing file versions, mirroring the features of Git

Gitlet - A version control system for managing file versions, mirroring the features of Git. Emphasized the serialization and manipulation of files to compress, access, and manage file content efficiently. Stressed the employment of appropriate data structures and file persistance.

null 1 Jan 4, 2022
Sistema de control de computadoras con base de datos

Sistema sobre control de computadoras con base de datos en PostgreSQL donde se puede registrar una computadora, en procesos podemos buscar una computadora segΓΊn su numero de serie y registrar el estado actual de una computadora.

AarΓ³n Rojas 1 Jan 23, 2022