{"id":13611415,"url":"https://github.com/sangcomz/FishBun","last_synced_at":"2025-04-13T04:34:38.756Z","repository":{"id":37587516,"uuid":"45672765","full_name":"sangcomz/FishBun","owner":"sangcomz","description":":blowfish:FishBun is Image Picker for android.","archived":false,"fork":false,"pushed_at":"2023-09-22T05:59:05.000Z","size":52319,"stargazers_count":671,"open_issues_count":52,"forks_count":144,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-11-01T21:05:40.610Z","etag":null,"topics":["android","image-picker","multi-image-picker","photopicker"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sangcomz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-11-06T09:34:25.000Z","updated_at":"2024-09-30T15:15:20.000Z","dependencies_parsed_at":"2023-02-01T03:00:30.885Z","dependency_job_id":"30b2833a-9f0f-4657-b8ad-16b8d4b98c2d","html_url":"https://github.com/sangcomz/FishBun","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangcomz%2FFishBun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangcomz%2FFishBun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangcomz%2FFishBun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangcomz%2FFishBun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sangcomz","download_url":"https://codeload.github.com/sangcomz/FishBun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223568214,"owners_count":17166620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","image-picker","multi-image-picker","photopicker"],"created_at":"2024-08-01T19:01:55.058Z","updated_at":"2025-04-13T04:34:38.750Z","avatar_url":"https://github.com/sangcomz.png","language":"Kotlin","funding_links":[],"categories":["Kotlin","图片"],"sub_categories":[],"readme":"# FishBun\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FishBun-green.svg?style=true)](https://android-arsenal.com/details/1/2785)\n[![Build Status](https://travis-ci.org/sangcomz/FishBun.svg?branch=master)](https://travis-ci.org/sangcomz/FishBun)\n[![codecov](https://codecov.io/gh/sangcomz/FishBun/branch/master/graph/badge.svg)](https://codecov.io/gh/sangcomz/FishBun)\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.sangcomz/fishbun)](https://search.maven.org/artifact/io.github.sangcomz/fishbun)\n\u003cp style=\"float:left;\"\u003e\n \u003ca href=\"https://play.google.com/store/apps/details?id=com.sangcomz.fishbundemo\"\u003e\n \u003cimg 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\" /\u003e\n \u003c/a\u003e\n\u003c/p\u003e\n\n_FishBun_ is a highly customizable image picker for Android.\n\n\u003cimg src=\"/pic/fishbuns.png\"\u003e\n\n\n## What's New in _FishBun_? :tada:\n\n- fix crash issue [#234](https://github.com/sangcomz/FishBun/issues/234) [#253](https://github.com/sangcomz/FishBun/issues/253)\n\n\n## Customizable Styles\n\n_FishBun_ supports various visual styles and allows fine-tuning for details. Just to show some examples:\n\n#### Default\n\n##### Code\n\n```java\nFishBun.with(WithActivityActivity.this)\n        .setImageAdapter(new GlideAdapter())\n        .startAlbumWithOnActivityResult(requestCode) or startAlbumWithActivityResultCallback(activityResultLauncher); \n```\n\n##### Screenshots\n\n\u003cimg src=\"/pic/default1.png\" width=\"30%\"\u003e \u003cimg src=\"/pic/default2.png\" width=\"30%\"\u003e \u003cimg src=\"/pic/default3.png\" width=\"30%\"\u003e\n\n#### Dark\n\n##### Code\n\n```java\nFishBun.with(WithActivityActivity.this)\n        .setImageAdapter(new GlideAdapter())\n        .setMaxCount(5)\n        .setMinCount(3)\n        .setPickerSpanCount(5)\n        .setActionBarColor(Color.parseColor(\"#795548\"), Color.parseColor(\"#5D4037\"), false)\n        .setActionBarTitleColor(Color.parseColor(\"#ffffff\"))\n        .setArrayPaths(path)\n        .setAlbumSpanCount(2, 3)\n        .setButtonInAlbumActivity(false)\n        .setCamera(true)\n        .exceptGif(true)\n        .setReachLimitAutomaticClose(true)\n        .setHomeAsUpIndicatorDrawable(ContextCompat.getDrawable(this, R.drawable.ic_custom_back_white))\n        .setDoneButtonDrawable(ContextCompat.getDrawable(this, R.drawable.ic_custom_ok))\n        .setAllDoneButtonDrawable(ContextCompat.getDrawable(this, R.drawable.ic_custom_ok))\n        .setIsUseAllDoneButton(ContextCompat.getDrawable(this, R.drawable.ic_custom_ok))\n        .setAllViewTitle(\"All\")\n        .setMenuAllDoneText(\"All Done\")\n        .setActionBarTitle(\"FishBun Dark\")\n        .textOnNothingSelected(\"Please select three or more!\")\n        .exceptMimeType(listOf(MimeType.GIF))\n        .setSpecifyFolderList(arrayListOf(\"Screenshots\", \"Camera\"))\n        .startAlbumWithOnActivityResult(requestCode);\n```\n\n##### Screenshots\n\n\u003cimg src=\"/pic/dark1.png\" width=\"30%\"\u003e \u003cimg src=\"/pic/dark2.png\" width=\"30%\"\u003e \u003cimg src=\"/pic/dark3.png\" width=\"30%\"\u003e\n\n#### Light\n\n##### Code\n\n```java\nFishBun.with(WithActivityActivity.this)\n        .setImageAdapter(new GlideAdapter())\n        .setPickerCount(50)\n        .setPickerSpanCount(4)\n        .setActionBarColor(Color.parseColor(\"#ffffff\"), Color.parseColor(\"#ffffff\"), true)\n        .setActionBarTitleColor(Color.parseColor(\"#000000\"))\n        .setArrayPaths(path)\n        .setAlbumSpanCount(1, 2)\n        .setButtonInAlbumActivity(true)\n        .setCamera(false)\n        .exceptGif(true)\n        .setReachLimitAutomaticClose(false)\n        .setHomeAsUpIndicatorDrawable(ContextCompat.getDrawable(this, R.drawable.ic_arrow_back_black_24dp))\n        .setOkButtonDrawable(ContextCompat.getDrawable(this, R.drawable.ic_check_black_24dp))\n        .setAllViewTitle(\"All of your photos\")\n        .setActionBarTitle(\"FishBun Light\")\n        .textOnImagesSelectionLimitReached(\"You can't select any more.\")\n        .textOnNothingSelected(\"I need a photo!\")\n        .startAlbumWithOnActivityResult(requestCode);\n```\n\n##### Screenshots\n\n\u003cimg src=\"/pic/light1.png\" width=\"30%\"\u003e \u003cimg src=\"/pic/light2.png\" width=\"30%\"\u003e \u003cimg src=\"/pic/light3.png\" width=\"30%\"\u003e\n\n\n## How to Setup\nFishbun 0.10.0 and above only supports projects that have been migrated to [androidx](https://developer.android.com/jetpack/androidx/). For more information, read Google's [migration guide](https://developer.android.com/jetpack/androidx/migrate).\n\nSetting up _FishBun_ requires to add this Gradle configuration:\n\n    dependencies {\n        implementation 'io.github.sangcomz:fishbun:x.x.x'\n         \n        implementation 'io.coil-kt:coil:0.11.0'\n        or\n        implementation 'com.github.bumptech.glide:glide:4.11.0'\n\n    } \n    \nand to allow the following permissions in your `Manifest`:\n\n    \u003cuses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" /\u003e\n    \u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e\n\nIf your app targets Android 11 with compileSdk/targetSdk \u003e= 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](https://developer.android.com/about/versions/11/privacy/package-visibility):\n\n    \u003cqueries\u003e\n        \u003cintent\u003e\n            \u003caction android:name=\"android.media.action.IMAGE_CAPTURE\" /\u003e\n        \u003c/intent\u003e\n    \u003c/queries\u003e\n\nIf your app targets Android 13 with compileSdk/targetSdk \u003e= 33 then you will need to add this to the manifest. [Android documentation here](https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions):\n\n    \u003cuses-permission android:name=\"android.permission.READ_MEDIA_IMAGES\" /\u003e\n\n    \u003cuses-permission\n        android:name=\"android.permission.READ_EXTERNAL_STORAGE\"\n        android:maxSdkVersion=\"32\" /\u003e\n\n## How to Use\n\nUse _FishBun_ in an activity:\n\n    FishBun.with(YourActivity).setImageAdapter(new GlideAdapter()).startAlbumWithOnActivityResult(requestCode);\n\nor in a fragment:\n\n    FishBun.with(YourFragment).setImageAdapter(new CoilAdapter()).startAlbumWithOnActivityResult(reqeustCode);\n\nand implement `OnActivityResult`:\n\n    protected void onActivityResult(int requestCode, int resultCode,\n                                    Intent imageData) {\n        super.onActivityResult(requestCode, resultCode, imageData);\n        switch (requestCode) {\n            case FishBun.FISHBUN_REQUEST_CODE:\n                if (resultCode == RESULT_OK) {\n                    // path = imageData.getStringArrayListExtra(Define.INTENT_PATH);\n                    // you can get an image path(ArrayList\u003cString\u003e) on \u003c0.6.2\n\n                    path = imageData.getParcelableArrayListExtra(INTENT_PATH);\n                    // you can get an image path(ArrayList\u003cUri\u003e) on 0.6.2 and later\n                    break;\n                }\n        }\n    }\n\nVarious customizable features can be controlled by chained methods as in:\n\n    FishBun.with(YourActivity or YourFragment)\n            .setImageAdapter(new GlideAdapter())\n            .setIsUseDetailView(false)\n            .setPickerCount(5) //Deprecated\n            .setMaxCount(5)\n            .setMinCount(1)\n            .setPickerSpanCount(6)\n            .setActionBarColor(Color.parseColor(\"#795548\"), Color.parseColor(\"#5D4037\"), false)\n            .setActionBarTitleColor(Color.parseColor(\"#ffffff\"))\n            .setArrayPaths(path)\n            .setAlbumSpanCount(2, 4)\n            .setButtonInAlbumActivity(false)\n            .setCamera(true)\n            .setReachLimitAutomaticClose(true)\n            .setHomeAsUpIndicatorDrawable(ContextCompat.getDrawable(this, R.drawable.ic_custom_back_white))\n            .setOkButtonDrawable(ContextCompat.getDrawable(this, R.drawable.ic_custom_ok))\n            .setAllViewTitle(\"All\")\n            .setActionBarTitle(\"Image Library\")\n            .textOnImagesSelectionLimitReached(\"Limit Reached!\")\n            .textOnNothingSelected(\"Nothing Selected\")\n            .setSelectCircleStrokeColor(Color.BLACK)\n            .isStartInAllView(false)\n            .exceptMimeType(listOf(MimeType.GIF))\n            .setSpecifyFolderList(arrayListOf(\"Screenshots\", \"Camera\"))\n            .startAlbumWithOnActivityResult(requestCode);\n\n### attribute\n\n|            Method Name            | Description                                                           |       Default Value      |\n|:---------------------------------:|-----------------------------------------------------------------------|:------------------------:|\n|         setSelectedImages         | Set the already selected image                                        | null |\n|             setMaxCount           | Maximum number of images selected                                     | 10 |\n|             setMinCount           | Minimum number of images selected                                     | 1 |\n|            setRequestCode         | Set RequestCode                                                       | 27 |\n|    setReachLimitAutomaticClose    | Picker automatically ends when the number of images is selected       | false |\n|       exceptMimeType              | Set file type to exclude(gif, png, jpeg, bmp, webp)                   | NONE |\n|   setAlbumThumbnailSize           | Thumbnail size of album screen                                        | 70dp |\n|      setPickerSpanCount           | Set the picker's span count                                           | 4 |\n|      setActionBarColor            | Set background color of action bar, statusBar color, set light theme  | #3F51B5, #303F9F, false  |\n|   setActionBarTitleColor          | Set the title color of the action bar                                 | #ffffff |\n|   textOnNothingSelected           | Message when nothing is selected                                      | \"There is no selected image.\" |\n| textOnImagesSelectionLimitReached | Message when the image is already all selected                        | \"Selection full. Deselect an image to choose another.\" |\n|     setButtonInAlbumActivity      | Set Selected button visibility in album screen                        | false |\n|       setAlbumSpanCount           | Set the album's span count                                            | 1, 2 |\n|   setAlbumSpanCountOnlyLandscape  | Set the album's span count when landscape                             | 2 |\n|    setAlbumSpanCountOnlPortrait   | Set the album's span count when portrait                              | 1 |\n|       setAllViewTitle             | Set the name of all views                                             | \"All view\" |\n|       setActionBarTitle           | Set the title of the action bar                                       | \"Album\" |\n|    setHomeAsUpIndicatorDrawable   | Customizing back button of the action bar                             | null |\n|       setDoneButtonDrawable       | Customizing done button of the action bar                             | null |\n|       setAllDoneButtonDrawable    | Customizing all done button of the action bar                         | null |\n|       setIsUseAllDoneButton       | Set whether to use the all select button                              | false |\n|       setMenuDoneText             | Set text for Done button                                              | null |\n|       setMenuAllDoneText          | Set text for All Done button                                          | null |\n|       setMenuTextColor            | Set text color for menu                                               | Integer.MAX_VALUE |\n|       setIsUseDetailView          | Set whether to use detail screen                                      | false |\n|       setIsShowCount              | Set whether to show counting numbers                                  | false |\n|    setSelectCircleStrokeColor     | Set select circle color                                               | #c1ffffff |\n|       isStartInAllView            | Set to start with all view                                            | false |\n|       setSpecifyFolderList        | Set folder to show                                                    | NONE |\n|       hasCameraInPickerPage       | Set whether to use the camera button on picker screen                 | false |\n\n\n## Android M Permission\n\nRunning on Android M, _FishBun_ checks if it has proper permission for you before reading an external storage.\n\n\u003cimg src=\"/pic/permission.png\" width=\"20%\"\u003e\n\n\n# Apps using FishBun\n## If you are using this library in your app, let me know.\n\n| Project Name | Result Screen   |\n|:---------:|---|\n| Pandaz(unavailable now)  \u003cp style=\"float:left;\"\u003e |  \u003cimg src=\"/pic/pandaz_result.gif\"\u003e |\n| Multi photo resize compress crop in batch PicTools  \u003cp style=\"float:left;\"\u003e \u003ca href=\"https://play.google.com/store/apps/details?id=omkar.tenkale.pictoolsandroid\u0026hl=en_US\"\u003e \u003cimg 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\" /\u003e\u003c/a\u003e\u003c/p\u003e |  \u003cimg src=\"/pic/multi_photo_result.gif\"\u003e |\n\n\n# Contribution\n\nAny suggestions or contributions would be welcomed.\n[CONTRIBUTING](https://github.com/sangcomz/FishBun/blob/master/CONTRIBUTING.md)\n\n# Feedback\n\nBug reports and feature requests can be submitted [here](https://github.com/sangcomz/FishBun/issues) \n(please read the [instructions](https://github.com/sangcomz/FishBun/blob/master/CONTRIBUTING.md) on how to report a bug and request feature).\n\n# License\n\n    Copyright 2019 Seokwon Jeong\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsangcomz%2FFishBun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsangcomz%2FFishBun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsangcomz%2FFishBun/lists"}