{"id":15109621,"url":"https://github.com/igalata/bubble-picker","last_synced_at":"2025-09-27T10:32:01.358Z","repository":{"id":41284324,"uuid":"84395488","full_name":"igalata/Bubble-Picker","owner":"igalata","description":"An easy-to-use animation which can be used for content picking for Android","archived":true,"fork":false,"pushed_at":"2021-05-01T00:53:17.000Z","size":14370,"stargazers_count":1395,"open_issues_count":59,"forks_count":249,"subscribers_count":32,"default_branch":"develop","last_synced_at":"2024-09-25T23:05:53.482Z","etag":null,"topics":["android","animation","bubble","java","kotlin","opengl","picker","selection"],"latest_commit_sha":null,"homepage":"https://medium.com/@igalata13/how-to-create-a-bubble-selection-animation-on-android-627044da4854#.js8nebsx6","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igalata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-09T03:48:04.000Z","updated_at":"2024-09-01T11:02:21.000Z","dependencies_parsed_at":"2022-08-23T13:10:10.992Z","dependency_job_id":null,"html_url":"https://github.com/igalata/Bubble-Picker","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igalata%2FBubble-Picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igalata%2FBubble-Picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igalata%2FBubble-Picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igalata%2FBubble-Picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igalata","download_url":"https://codeload.github.com/igalata/Bubble-Picker/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871972,"owners_count":16554475,"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","animation","bubble","java","kotlin","opengl","picker","selection"],"created_at":"2024-09-25T23:06:03.983Z","updated_at":"2025-09-27T10:31:54.883Z","avatar_url":"https://github.com/igalata.png","language":"Kotlin","readme":"# Bubble-Picker\n\n[![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)]()\n[![](https://jitpack.io/v/igalata/Bubble-Picker.svg)](https://jitpack.io/#igalata/Bubble-Picker)\n\n\u003ca href='https://play.google.com/store/apps/details?id=com.igalata.bubblepickerdemo\u0026pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'\u003e\u003cimg alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height=\"70\" width=\"180\"/\u003e\u003c/a\u003e\n\nCheck this [project on dribbble](https://dribbble.com/shots/3349372-Bubble-Picker-Open-Source-Component)\n\nRead how we did it [on Medium](https://medium.com/@igalata13/how-to-create-a-bubble-selection-animation-on-android-627044da4854#.ajonc010b)\n\n\u003cimg src=\"shot.gif\"/\u003e\n\n## Requirements\n- Android SDK 16+\n\n## Usage\n\nAdd to your root build.gradle:\n```Groovy\nallprojects {\n\trepositories {\n\t...\n\tmaven { url \"https://jitpack.io\" }\n\t}\n}\n```\n\nAdd the dependency:\n```Groovy\ndependencies {\n\tcompile 'com.github.igalata:Bubble-Picker:v0.2.4'\n}\n```\n\n## How to use this library\n\nAdd `BubblePicker` to your xml layout\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cFrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\u003e\n\n    \u003ccom.igalata.bubblepicker.rendering.BubblePicker\n        android:id=\"@+id/picker\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:backgroundColor=\"@android:color/white\" /\u003e\n\n\u003c/FrameLayout\u003e\n```\n\nOverride onResume() and onPause() methods to call the same methods from the `BubblePicker`\n\nKotlin\n```kotlin\noverride fun onResume() {\n      super.onResume()\n      picker.onResume()\n}\n\noverride fun onPause() {\n      super.onPause()\n      picker.onPause()\n}\n```\n\nJava\n```java\n@Override\nprotected void onResume() {\n      super.onResume();\n      picker.onResume();\n}\n\n@Override\nprotected void onPause() {\n      super.onPause();\n      picker.onPause();\n}\n```\n\nPass the `PickerItem` list to the `BubblePicker`\n\nKotlin\n```kotlin\nval titles = resources.getStringArray(R.array.countries)\nval colors = resources.obtainTypedArray(R.array.colors)\nval images = resources.obtainTypedArray(R.array.images)\n\npicker.adapter = object : BubblePickerAdapter {\n\n            override val totalCount = titles.size\n\n            override fun getItem(position: Int): PickerItem {\n                return PickerItem().apply {\n                    title = titles[position]\n                    gradient = BubbleGradient(colors.getColor((position * 2) % 8, 0),\n                            colors.getColor((position * 2) % 8 + 1, 0), BubbleGradient.VERTICAL)\n                    typeface = mediumTypeface\n                    textColor = ContextCompat.getColor(this@DemoActivity, android.R.color.white)\n                    backgroundImage = ContextCompat.getDrawable(this@DemoActivity, images.getResourceId(position, 0))\n                }\n            }\n}\n```\n\nJava\n```java\nfinal String[] titles = getResources().getStringArray(R.array.countries);\nfinal TypedArray colors = getResources().obtainTypedArray(R.array.colors);\nfinal TypedArray images = getResources().obtainTypedArray(R.array.images);\n\npicker.setAdapter(new BubblePickerAdapter() {\n            @Override\n            public int getTotalCount() {\n                return titles.length;\n            }\n\n            @NotNull\n            @Override\n            public PickerItem getItem(int position) {\n                PickerItem item = new PickerItem();\n                item.setTitle(titles[position]);\n                item.setGradient(new BubbleGradient(colors.getColor((position * 2) % 8, 0),\n                        colors.getColor((position * 2) % 8 + 1, 0), BubbleGradient.VERTICAL));\n                item.setTypeface(mediumTypeface);\n                item.setTextColor(ContextCompat.getColor(DemoActivity.this, android.R.color.white));\n                item.setBackgroundImage(ContextCompat.getDrawable(DemoActivity.this, images.getResourceId(position, 0)));\n                return item;\n            }\n});\n```\n\nSpecify the `BubblePickerListener` to get notified about events\n\nKotlin\n```kotlin\npicker.listener = object : BubblePickerListener {\n            override fun onBubbleSelected(item: PickerItem) {\n\n            }\n\n            override fun onBubbleDeselected(item: PickerItem) {\n\n            }\n}\n```\n\nJava\n```java\npicker.setListener(new BubblePickerListener() {\n            @Override\n            public void onBubbleSelected(@NotNull PickerItem item) {\n                \n            }\n\n            @Override\n            public void onBubbleDeselected(@NotNull PickerItem item) {\n\n            }\n});\n```\n\nTo get all selected items use `picker.selectedItems` variable in Kotlin or `picker.getSelectedItems()` method in Java.\n\nFor more usage examples please review the sample app\n\n## Changelog\n\n### Version: 0.2.4\n\n* Added a possibility to setup the `BubblePicker` using `BubblePickerAdapter`\n\n### Version: 0.2.3\n\n* Fixed black textures issue on some devices\n\n### Version: 0.2.1\n\n* `BubblePicker.centerImmediately` veriable added, so it's possible to place the bubbles \n in the center of the view immediately\n\n### Version: 0.2\n\n* `icon` parameter added to place an image on a bubble along with the title \n* `iconOnTop` parameter added to control position of the icon on a bubble\n* `textSize` parameter added\n* `BubblePicker.bubbleSize` variable now can be changed from 1 to 100\n\n## Known iOS versions of the animation\n\n* https://github.com/Ronnel/BubblePicker\n* https://github.com/efremidze/Magnetic\n\n## License\n\nMIT License\n\nCopyright (c) 2017 Irina Galata\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figalata%2Fbubble-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figalata%2Fbubble-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figalata%2Fbubble-picker/lists"}