Skip to content

Repository files navigation

donateGitHub tag (latest by date)

SmartFilePicker

This is Telegram like File Picker for android .

Installation

  • Add it in your root build.gradle at the end of repositories:
	allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
  • Add the dependency
	dependencies {
implementation 'com.github.smartdevelopers-ir:SmartFilePicker:2.1.0'
}

Usage

  • open File Picker
Bundleextra=newBundle();
extra.putInt("my_number",10);
Intentintent = newSmartFilePicker.IntentBuilder()
.showCamera(true)
.canSelectMultipleInGallery(true)
.showGalleryTab(true)
.showPickFromSystemGalleyMenu(true)
.setExtra(extra)
.setFileFilter(newSFBFileFilter.Builder().isFile(true).isFolder(true).build())
.canSelectMultipleInFiles(true)
.build(this);
startActivityForResult(intent, 10);
  • Getting result
@OverrideprotectedvoidonActivityResult(intrequestCode, intresultCode, @NullableIntentdata) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode==10){
if (data!=null) {
Uri[] uris= SmartFilePicker.getResultUris(data);
if (uris!=null){
// do somthing with selected files uri
}
Bundleextra= SmartFilePicker.getExtra(data);
if (extra != null) {
intnumber = extra.getInt("my_number");
}
}
}
}
  • Chaging Theme

    To change theme you should override this style to extends your AppTheme

     <stylename="App.AppTheme"parent="Theme.Material3.Light.NoActionBar">
    ...
    </style>
    <stylename="SFB.Base"parent="App.AppTheme"/>

    And for customizing bottomNavigation or bottons color you should override this style :

     <stylename="SFB.Base.Theme.Browser"parent="SFB.Base.Theme">
    <itemname="SFBColorGallery">@color/sfb_color_gallery</item>
    <itemname="SFBColorFile">@color/sfb_color_file</item>
    <itemname="SFBColorAudio">@color/sfb_color_audio</item>
    <itemname="SFBColorPDF">@color/sfb_color_pdf</item>
    <itemname="SFBBottomNavActiveColor">@color/white</item>
    <itemname="SFBBottomNavInactiveColor">@color/sfb_color_item_inactive</item>
    <itemname="SFBBottomNavColorDisabled">@color/sfb_color_item_disabled</item>
    <itemname="SFBCheckboxFillColor">?attr/colorSecondary</item>
    <itemname="SFBCheckboxOnFillColor">?attr/colorOnSecondary</item>
    <itemname="SFBCheckboxStrokeColor">?attr/colorOnSecondary</item>
    </style>

Donation

You can support me by donating with cryptocurrency :)

I glad to support you

About

An android file picker like Telegram's file picker

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages