react-native-android-version

1.0.0 • Public • Published

React Native Android Styles

This package allow to apply styles to specific android version.

Installation

npm i --save react-native-android-version

or

yarn add react-native-android-version

Example Usage

import AndroidVersion from "react-native-android-version";
import {StyleSheet} from "react-native";


const styles = StyleSheet.create({
    image: {
        ...AndroidVersion.select({
        
        //Apply styles to android api 28 and hight
        
            '>=26': {
                width: 'auto',
                height: 'auto',
            },
            
        //Apply styles to android api 28
            
            
            '28': {
                width: 'auto',
                height: 'auto',
            },
            
        //Apply styles to android api 25
        
            25: {
                width: 'auto',
                height: 'auto',
            },
            
        //Styles for other android api levels
        
            default: {
                width: '100%',
                height: '100%',
            }
        })
    }
});

Contribute

Of course, contributions welcomed! 🙌

License

MIT.

/react-native-android-version/

    Package Sidebar

    Install

    npm i react-native-android-version

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    2.33 kB

    Total Files

    3

    Last publish

    Collaborators

    • fgh151