To include Media Chooser Dialog in your project, your project should have minSdkVersion 21 and above. You can download a aar from GitHub's packages page. Or use Gradle: Add it in your your projects root build.gradle file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency
dependencies {
implementation 'com.github.mrshadow98:MediaChooserDialog:1.0.3'
}
Media Chooser Dialog is photos and videos selector compatible with android 11! This chooser uses media stores so it solves the problem of requestLegactStorage in android 10.
- Material Design
- Easy to integrate
- ✨Uses Bottom Dialog
- Simple code that will load all pictures in users device
- Simple code that will load all videos in users device
- Returns path and Uri of the file
- checks and asks storage permission for you
- supports latest android 11
- followes google's latest storage policy
- Use below code to select video file
MediaChooserDialog mediaChooserDialog = new MediaChooserDialog(MainActivity.this, new MediaChooserDialog.MediaSelectionListener() {
@Override
public void onMediaSelected(Uri uri, String path) {
//uri is file uri
//path is file path
}
});
mediaChooserDialog.showVideoDialog();
- Use below code to select picture files
MediaChooserDialog mediaChooserDialog = new MediaChooserDialog(MainActivity.this, new MediaChooserDialog.MediaSelectionListener() {
@Override
public void onMediaSelected(Uri uri, String path) {
//uri is file uri
//path is file path
}
});
mediaChooserDialog.showPictureDialog();
- How to use bottom sheet dialog?
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.your_layout, null);
btn_delete = view.findViewById(R.id.deleteBtn); //Your example buttons and views
BottomDialog bottom_dialog = new BottomDialog.Builder(context)
.setTitle("Class Details")
.autoDismiss(true)
.setCustomView(view)
.show();
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
DialogSheet: https://github.com/marcoscgdev/DialogSheet MediaFacer: https://github.com/CodeBoy722/MediaFacer Glide: https://github.com/bumptech/glide Dexter: https://github.com/Karumi/Dexter
MIT
Free Software, Hell Yeah!