rnwallpaper
v1.2.1
Published
A simple module to set Android Wallpaper with a single function.
Downloads
3
Maintainers
Readme
RNWallpaper
Getting started
$ npm install rnwallpaper --save
Mostly automatic installation
$ react-native link rnwallpaper
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import sonu.malik.wallpaper.RNWallpaperPackage;
to the imports at the top of the file - Add
new RNWallpaperPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':rnwallpaper' project(':rnwallpaper').projectDir = new File(rootProject.projectDir, '../node_modules/rnwallpaper/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':rnwallpaper')
Usage
import Wallpaper from 'rnwallpaper';
Wallpaper.setWallpaper('http://yourwebsite.com/anyImage.png', (res) => Alert.alert("Response: ", JSON.stringify(res)))
Wallpaper.openImage('content://media/external/images/media/Y')