SkillAgentSearch skills...

FishBun

:blowfish:FishBun is Image Picker for android.

Install / Use

/learn @sangcomz/FishBun
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

FishBun

Android Arsenal Build Status codecov Maven Central

<p style="float:left;"> <a href="https://play.google.com/store/apps/details?id=com.sangcomz.fishbundemo"> <img HEIGHT="40" WIDTH="135" alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge.png" /> </a> </p>

FishBun is a highly customizable image picker for Android.

<img src="/pic/fishbuns.png">

What's New in FishBun? :tada:

Customizable Styles

FishBun supports various visual styles and allows fine-tuning for details. Just to show some examples:

Default

Code
FishBun.with(WithActivityActivity.this)
        .setImageAdapter(new GlideAdapter())
        .startAlbumWithOnActivityResult(requestCode) or startAlbumWithActivityResultCallback(activityResultLauncher); 
Screenshots

<img src="/pic/default1.png" width="30%"> <img src="/pic/default2.png" width="30%"> <img src="/pic/default3.png" width="30%">

Dark

Code
FishBun.with(WithActivityActivity.this)
        .setImageAdapter(new GlideAdapter())
        .setMaxCount(5)
        .setMinCount(3)
        .setPickerSpanCount(5)
        .setActionBarColor(Color.parseColor("#795548"), Color.parseColor("#5D4037"), false)
        .setActionBarTitleColor(Color.parseColor("#ffffff"))
        .setAlbumSpanCount(2, 3)
        .setButtonInAlbumActivity(false)
        .hasCameraInPickerPage(true)
        .setReachLimitAutomaticClose(true)
        .setHomeAsUpIndicatorDrawable(ContextCompat.getDrawable(this, R.drawable.ic_custom_back_white))
        .setDoneButtonDrawable(ContextCompat.getDrawable(this, R.drawable.ic_custom_ok))
        .setAllDoneButtonDrawable(ContextCompat.getDrawable(this, R.drawable.ic_custom_ok))
        .setIsUseAllDoneButton(true)
        .setAllViewTitle("All")
        .setMenuAllDoneText("All Done")
        .setActionBarTitle("FishBun Dark")
        .textOnNothingSelected("Please select three or more!")
        .exceptMimeType(listOf(MimeType.GIF))
        .setSpecifyFolderList(arrayListOf("Screenshots", "Camera"))
        .enableEdgeToEdge(true)
        .startAlbumWithOnActivityResult(requestCode);
Screenshots

<img src="/pic/dark1.png" width="30%"> <img src="/pic/dark2.png" width="30%"> <img src="/pic/dark3.png" width="30%">

Light

Code
FishBun.with(WithActivityActivity.this)
        .setImageAdapter(new GlideAdapter())
        .setMaxCount(50)
        .setPickerSpanCount(4)
        .setActionBarColor(Color.parseColor("#ffffff"), Color.parseColor("#ffffff"), true)
        .setActionBarTitleColor(Color.parseColor("#000000"))
        .setAlbumSpanCount(1, 2)
        .setButtonInAlbumActivity(true)
        .hasCameraInPickerPage(false)
        .setReachLimitAutomaticClose(false)
        .setHomeAsUpIndicatorDrawable(ContextCompat.getDrawable(this, R.drawable.ic_arrow_back_black_24dp))
        .setDoneButtonDrawable(ContextCompat.getDrawable(this, R.drawable.ic_check_black_24dp))
        .setAllViewTitle("All of your photos")
        .setActionBarTitle("FishBun Light")
        .textOnImagesSelectionLimitReached("You can't select any more.")
        .textOnNothingSelected("I need a photo!")
        .exceptMimeType(listOf(MimeType.GIF))
        .startAlbumWithOnActivityResult(requestCode);
Screenshots

<img src="/pic/light1.png" width="30%"> <img src="/pic/light2.png" width="30%"> <img src="/pic/light3.png" width="30%">

How to Setup

Fishbun 0.10.0 and above only supports projects that have been migrated to androidx. For more information, read Google's migration guide.

Setting up FishBun requires to add this Gradle configuration:

dependencies {
    implementation 'io.github.sangcomz:fishbun:x.x.x'
     
    implementation 'io.coil-kt:coil:0.11.0'
    or
    implementation 'com.github.bumptech.glide:glide:4.11.0'

} 

and to allow the following permissions in your Manifest:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

If your app targets Android 11 with compileSdk/targetSdk >= 30 then you will need to add this to the manifest (outside of the application block) in order to capture pictures with the device camera. Android documentation here:

<queries>
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE" />
    </intent>
</queries>

If your app targets Android 13 with compileSdk/targetSdk >= 33 then you will need to add this to the manifest. Android documentation here:

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

<uses-permission
    android:name="android.permission.READ_EXTERNAL_STORAGE"
    android:maxSdkVersion="32" />

How to Use

Use FishBun in an activity:

FishBun.with(YourActivity).setImageAdapter(new GlideAdapter()).startAlbumWithOnActivityResult(requestCode);

or in a fragment:

FishBun.with(YourFragment).setImageAdapter(new CoilAdapter()).startAlbumWithOnActivityResult(reqeustCode);

and implement OnActivityResult:

protected void onActivityResult(int requestCode, int resultCode,
                                Intent imageData) {
    super.onActivityResult(requestCode, resultCode, imageData);
    switch (requestCode) {
        case FishBun.FISHBUN_REQUEST_CODE:
            if (resultCode == RESULT_OK) {
                // path = imageData.getStringArrayListExtra(Define.INTENT_PATH);
                // you can get an image path(ArrayList<String>) on <0.6.2

                path = imageData.getParcelableArrayListExtra(INTENT_PATH);
                // you can get an image path(ArrayList<Uri>) on 0.6.2 and later
                break;
            }
    }
}

Various customizable features can be controlled by chained methods as in:

FishBun.with(YourActivity or YourFragment)
        .setImageAdapter(new GlideAdapter())
        .setIsUseDetailView(true)
        .setMaxCount(5)
        .setMinCount(1)
        .setPickerSpanCount(6)
        .setActionBarColor(Color.parseColor("#795548"), Color.parseColor("#5D4037"), false)
        .setActionBarTitleColor(Color.parseColor("#ffffff"))
        .setAlbumSpanCount(2, 4)
        .setButtonInAlbumActivity(false)
        .hasCameraInPickerPage(true)
        .setReachLimitAutomaticClose(true)
        .setHomeAsUpIndicatorDrawable(ContextCompat.getDrawable(this, R.drawable.ic_custom_back_white))
        .setDoneButtonDrawable(ContextCompat.getDrawable(this, R.drawable.ic_custom_ok))
        .setAllViewTitle("All")
        .setActionBarTitle("Image Library")
        .textOnImagesSelectionLimitReached("Limit Reached!")
        .textOnNothingSelected("Nothing Selected")
        .setSelectCircleStrokeColor(Color.BLACK)
        .isStartInAllView(false)
        .exceptMimeType(listOf(MimeType.GIF))
        .setSpecifyFolderList(arrayListOf("Screenshots", "Camera"))
        .enableEdgeToEdge(true)
        .startAlbumWithOnActivityResult(requestCode);

attribute

|       Method Name       | Description                               |   Default Value   | |:---------------------------------:|-----------------------------------------------------------------------|:------------------------:| | setSelectedImages | Set the already selected image | null | | setMaxCount | Maximum number of images selected | 10 | | setMinCount | Minimum number of images selected | 1 | | setRequestCode | Set RequestCode | 27 | | setReachLimitAutomaticClose | Picker automatically ends when the number of images is selected | false | | exceptMimeType | Set file type to exclude(gif, png, jpeg, bmp, webp) | NONE | | setAlbumThumbnailSize | Thumbnail size of album screen | 70dp | | setPickerSpanCount | Set the picker's span count | 4 | | setActionBarColor | Set background color of action bar, statusBar color, set light theme | #3F51B5, #303F9F, false | | setActionBarTitleColor | Set the title color of the action bar | #ffffff | | textOnNothingSelected | Message when nothing is selected | "There is no selected image." | | textOnImagesSelectionLimitReached | Message when the image is already all selected | "Selection full. Deselect an image to choose another." | | setButtonInAlbumActivity | Set Selected button visibility in album screen | false | | setAlbumSpanCount | Set the album's span count

View on GitHub
GitHub Stars674
CategoryDevelopment
Updated14h ago
Forks144

Languages

Kotlin

Security Score

100/100

Audited on Mar 30, 2026

No findings