react-native-android-system-colors
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

react-native-android-system-colors

Library for managing the native colors of an Android app.

npm version npm downloads npm license


Instalation

To install react-native-android-system-colors - you can use npm or yarn package manager.
npm install react-native-android-system-colors --save

or

yarn add react-native-android-system-colors

Documentation

The react-native-android-system-colors library includes the AndroidSystemColors object interface that has the next methods: setStatusBarColor, setNavigationBarColor, setTaskDescriptionColor. Below you can find the documentation for all methods.

Important! All colors should be provided in the hex format.

The setNavigationBarColor method

Method that change the navigation bar color.
The setNavigationBarColor method accept next arguments:
Name Type Default value Required
color (hex) string Yes
duration (ms) number 0 No

The setStatusBarColor method

Method that change the status bar color.
The setStatusBarColor method accept next arguments:
Name Type Default value Required
color (hex) string Yes
duration (ms) number 0 No

The setTaskDescriptionColor method

Method that change the recent color.
The setTaskDescriptionColor method accept next arguments:
Name Type Default value Required
color (hex) string Yes

Examples

  import React, { useEffect } from 'react';
  import { AndroidSystemColors } from 'react-native-android-system-colors';


  const App = () => {

    useEffect(() => {
      const animationDuration = 300;
      const hexColorString = '#2196F3';

      AndroidSystemColors.setStatusBarColor(hexColorString, animationDuration);
      AndroidSystemColors.setNavigationBarColor(hexColorString, animationDuration);
      AndroidSystemColors.setTaskDescriptionColor(hexColorString);
    }, []);

    return null;
  }

Readme

Keywords

none

Package Sidebar

Install

npm i react-native-android-system-colors

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

14.4 kB

Total Files

11

Last publish

Collaborators

  • vladrozhnev