A picker library for popular images of Unsplash
- Add JitPack to your project level build.gradle
- Add the following dependency to app level build.gradle
dependencies {
implementation 'com.github.samirk433:UnsplashPicker:1.0.0'
}
Following 1 & only 1 permission is needed for this library. I cannot explain exactly why this permission is needed because THIS IS BEYOND SCIENCE
<uses-permission android:name="android.permission.INTERNET" />
- Go to Unsplash Developers
- Register as a developer and create an app
- Copy the secret key to string resources file
strings.xml
as follow<string name="unsplash_api_key">API KEY HERE</string>
- Open
Manifest.xml
file and add following meta-data inside<meta-data android:name="unsplash_api_key" android:value="@string/unsplash_api_key" />
Display UnsplashPicker dialog and register a callback on image selection
UnsplashPicker.show(context, new OnPhotoSelection() {
@Override
public void onPhotoSelect(String url) {
//use this URI to download image
}
});
Contributions are welcome. This is my 1st Open Source library and I want to encourage others to start contributing. Therefore I have left some [features/bugs][1] that you may be interested to work on.