Skip to content

simonepauro/react-native-settings-manager

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-settings-manager

Getting started

$ npm install react-native-settings-manager --save

Usage

import { SettingsManager } from 'react-native-settings-manager';

export const AppSettings = SettingsManager({
  volume: {
    title: 'Ring volume',
    type: 'slider',
    default: 80, // from 0 to 100
    icon: require('./img/ic_notifications.png')
  },
  ringtone: {
    title: 'Ringtone',
    type: 'picker',
    list: ['Default', 'Chime', 'Ring', 'Zion'],
  },
  vibrate: {
    title: 'Vibration',
    subtitle: 'Also vibrate for calls',
    type: 'switch',
    default: true
  },
});

Render component

class SettingsScreen extends Component<{}> {
  render() {
    return (
      <View style={styles.container}>
	  
        <AppSettings.View/>
		
      </View>
    );
  }
}

Retrieve setting

AppSettings.getValue('volume', (value) => {
  console.log('Volume: ' + value);
  // do stuff
});

About

app settings with component

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 58.5%
  • Objective-C 18.3%
  • Java 13.3%
  • Python 7.2%
  • Ruby 2.7%