GalleryKit is simplest / beautiful and smartest gallery picker
- Support Images & Videos
- Support Multiple selecttions
- Fully Configurable
Add jitpack
to build.gradle (Project level)
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add dependency
to build.gradle (app level)
dependencies {
...
implementation 'com.github.chirag-ji:GalleryKit:${Tagged Release Version}'
...
}
...
<com.github.chiragji.gallerykit.GalleryKitView
android:id="@+id/galleryKitView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:maxImageSelections="3"
app:viewStyle="separate" />
...
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
...
GalleryKitView galleryKitView = findViewById(R.id.galleryKitView);
galleryKitView.attach(this);
galleryKitView.registerGalleryKitListener(new GalleryKitListener() {
@Override
public void onGalleryKitBackAction() {
Log.d(TAG, "onBackKeyPressed: back key pressed on gallery kit");
}
@Override
public void onGalleryKitSelectionConfirmed(@NonNull List<String> selectedDataUris) {
Log.d(TAG, "onSelectionConfirmed: selectedDataUris.size = " + selectedDataUris.size());
selectedDataUris.forEach(selectedUri ->
Log.d(TAG, "onSelectionConfirmed: selectedUri = " + selectedUri));
}
});
...
}
protected void onCreate(Bundle savedInstanceState) {
...
GalleryKitView galleryKitView = findViewById(R.id.galleryKitView);
galleryKitView.attachToFragmentActivity(this);
galleryKitView.setSelectedData(dataList);
...
}
...
app:combinedMaxSelections="<count>"
app:viewStyle="combined"
...
...
app:maxImageSelections="<count>"
app:maxVideoSelections="<count>"
app:viewStyle="separate"
...
...
app:maxImageSelections="<count>"
app:viewStyle="imageOnly"
...
...
app:maxVideoSelections="<count>"
app:viewStyle="videoOnly"
...
...
app:showSelectedResources="false"
...
...
app:backButtonImageSrc="@drawable/ic_clear"
...
...
app:hideBackButton="true"
...
...
app:doneButtonColor="@color/colorAccent"
...
More features will come soon
If you think this library is useful, please press star button at upside.
I don't care about any licensing, keen to accept all contributions and making it the most trusted, beautiful and smartest library :)