{"id":13643295,"url":"https://github.com/GoodieBag/CarouselPicker","last_synced_at":"2025-04-21T01:32:17.244Z","repository":{"id":91198817,"uuid":"89361408","full_name":"GoodieBag/CarouselPicker","owner":"GoodieBag","description":"A Carousel picker library for android which supports both text and icons . :sparkles:","archived":false,"fork":false,"pushed_at":"2023-11-28T10:59:22.000Z","size":2282,"stargazers_count":708,"open_issues_count":24,"forks_count":101,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-11-09T15:42:26.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoodieBag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-25T13:03:47.000Z","updated_at":"2024-07-10T00:42:03.000Z","dependencies_parsed_at":"2024-08-02T01:16:52.958Z","dependency_job_id":"d2a056d9-149e-487f-8629-9abc15d1a6e3","html_url":"https://github.com/GoodieBag/CarouselPicker","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodieBag%2FCarouselPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodieBag%2FCarouselPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodieBag%2FCarouselPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodieBag%2FCarouselPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoodieBag","download_url":"https://codeload.github.com/GoodieBag/CarouselPicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982605,"owners_count":21355731,"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":[],"created_at":"2024-08-02T01:01:45.405Z","updated_at":"2025-04-21T01:32:16.043Z","avatar_url":"https://github.com/GoodieBag.png","language":"Java","funding_links":[],"categories":["轮播图"],"sub_categories":[],"readme":"# Carousel Picker\n\n![alt downloads](https://img.shields.io/jitpack/dm/github/GoodieBag/CarouselPicker.svg)\n\n A Carousel picker library for android which supports both text and icons . :pouting_cat:\n \n \u003cimg src=\"https://raw.githubusercontent.com/GoodieBag/CarouselPicker/master/gif/gif_image_480.gif\" height=\"500\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/GoodieBag/CarouselPicker/master/gif/gif_text_480.gif\" height=\"500\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/GoodieBag/CarouselPicker/master/gif/gif_mix_480.gif\" height=\"500\"\u003e\n \n## Gradle Dependency\n\nAdd this in your root build.gradle file at the end of repositories:\n```java\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\nAdd the dependency : \n```java\ndependencies {\n\t        implementation 'com.github.GoodieBag:CarouselPicker:v1.2'\n\t\t// v1.2 is the latest release with vertical orientation and font styling options. \n\t\t// For the previous stable release use v1.1\n\t}\n```\nSync the gradle and that's it! :+1:\n\n## Features : \n* Supports icons and text or a mixture of both as items of the picker.\n* Gives a nice carousel view of the items.\n* Page change listener exists to monitor the current selected item.\n\n## Usage\n\n### XML : \n\n```xml\n\u003cin.goodiebag.carouselpicker.CarouselPicker\n        android:id=\"@+id/carousel\"\n        android:layout_marginTop=\"20dp\"\n        android:layout_marginBottom=\"20dp\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"#CCC\"\n        app:items_visible=\"three\" /\u003e\n```\n\n```items_visible```  represents the number of pages visible on the screen. Three, five and seven are the available options.\n\n\n### Java :\nCarousel picker supports both images and text or a mixture of both !\n```java\nCarouselPicker carouselPicker = (CarouselPicker) findViewById(R.id.carousel);\n\n// Case 1 : To populate the picker with images\nList\u003cCarouselPicker.PickerItem\u003e imageItems = new ArrayList\u003c\u003e();\nimageItems.add(new CarouselPicker.DrawableItem(R.drawable.i1));\nimageItems.add(new CarouselPicker.DrawableItem(R.drawable.i2));\nimageItems.add(new CarouselPicker.DrawableItem(R.drawable.i3));\n//Create an adapter\nCarouselPicker.CarouselViewAdapter imageAdapter = new CarouselPicker.CarouselViewAdapter(this, imageItems, 0);\n//Set the adapter\ncarouselPicker.setAdapter(imageAdapter);\n\n//Case 2 : To populate the picker with text\nList\u003cCarouselPicker.PickerItem\u003e textItems = new ArrayList\u003c\u003e();\n//20 here represents the textSize in dp, change it to the value you want.\ntextItems.add(new CarouselPicker.TextItem(\"hi\", 20));\ntextItems.add(new CarouselPicker.TextItem(\"hi\", 20));\ntextItems.add(new CarouselPicker.TextItem(\"hi\", 20));\nCarouselPicker.CarouselViewAdapter textAdapter = new CarouselPicker.CarouselViewAdapter(this, textItems, 0);\ncarouselPicker.setAdapter(textAdapter);\n\n//Case 3 : To populate the picker with both images and text\nList\u003cCarouselPicker.PickerItem\u003e mixItems = new ArrayList\u003c\u003e();\nmixItems.add(new CarouselPicker.DrawableItem(R.drawable.i1));\nmixItems.add(new CarouselPicker.TextItem(\"hi\", 20));\nmixItems.add(new CarouselPicker.DrawableItem(R.drawable.i2));\nmixItems.add(new CarouselPicker.TextItem(\"hi\", 20));\nCarouselPicker.CarouselViewAdapter mixAdapter = new CarouselPicker.CarouselViewAdapter(this, mixItems, 0);\ncarouselPicker.setAdapter(mixAdapter);\n```\n\n### Decorations :\n- Text color for text items can be set using ```adapter.setTextColor(colorInt)```\n\n## Listeners :\n```java\ncarouselPicker.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n            @Override\n            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n            }\n\n            @Override\n            public void onPageSelected(int position) {\n                //position of the selected item\n            }\n\n            @Override\n            public void onPageScrollStateChanged(int state) {\n\n            }\n        });\n```\n\n## LICENSE : \n```\nMIT License\n\nCopyright (c) 2017 GoodieBag\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```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGoodieBag%2FCarouselPicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGoodieBag%2FCarouselPicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGoodieBag%2FCarouselPicker/lists"}