{"id":13396203,"url":"https://github.com/roughike/SwipeSelector","last_synced_at":"2025-03-13T22:31:46.817Z","repository":{"id":66215488,"uuid":"52305942","full_name":"roughike/SwipeSelector","owner":"roughike","description":"A nicer-looking, more intuitive and highly customizable alternative for radio buttons and dropdowns for Android.","archived":false,"fork":false,"pushed_at":"2019-06-10T23:27:47.000Z","size":9710,"stargazers_count":1089,"open_issues_count":21,"forks_count":152,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-03-09T10:28:35.204Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roughike.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2016-02-22T21:08:29.000Z","updated_at":"2025-02-07T01:44:35.000Z","dependencies_parsed_at":"2023-02-25T02:15:21.085Z","dependency_job_id":null,"html_url":"https://github.com/roughike/SwipeSelector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roughike%2FSwipeSelector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roughike%2FSwipeSelector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roughike%2FSwipeSelector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roughike%2FSwipeSelector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roughike","download_url":"https://codeload.github.com/roughike/SwipeSelector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243493902,"owners_count":20299738,"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-07-30T18:00:42.325Z","updated_at":"2025-03-13T22:31:46.811Z","avatar_url":"https://github.com/roughike.png","language":"Java","funding_links":[],"categories":["Index `(light-weight pages)`","Index","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"# SwipeSelector\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b4210ba766df46ea972eb2ddcc607c93)](https://www.codacy.com/app/iiro-krankka/SwipeSelector?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=roughike/SwipeSelector\u0026amp;utm_campaign=Badge_Grade)\n\n## Undergoing for some API changes for a 2.0 major version, see example usage in the sample module!\n\n\u003cimg src=\"https://raw.githubusercontent.com/roughike/SwipeSelector/master/demo_two.gif\" width=\"278\" height=\"492\" /\u003e\n\n\u003ca href=\"https://play.google.com/store/apps/details?value=com.iroughapps.swipeselectordemo\u0026utm_source=global_co\u0026utm_medium=prtnr\u0026utm_content=Mar2515\u0026utm_campaign=PartBadge\u0026pcampaignid=MKT-AC-global-none-all-co-pr-py-PartBadges-Oct1515-1\"\u003e\u003cimg alt=\"Get it on Google Play\" src=\"https://play.google.com/intl/en_us/badges/images/apps/en-play-badge-border.png\" width=\"216\" height=\"70\"/\u003e\u003c/a\u003e\n\n## What and why?\n\nBored of dull looking radio buttons and dropdowns? Me too. I started looking for a more sophisticated way of offering user a choice, and came up with [this beautiful dribble](https://dribbble.com/shots/2343630-Create-Shipment).\n\nUnfortunately, there were no ready-made solutions to achieve this, so I spent a good day working on this very thing I call SwipeSelector.\n\n## minSDK Version\n\nSwipeSelector supports API levels all the way down to 8 (Android Froyo).\n\n## Installation\n\n**Gradle:**\n\n```groovy\ncompile 'com.roughike:swipe-selector:1.0.6'\n```\n\n**Maven:**\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.roughike\u003c/groupId\u003e\n  \u003cartifactId\u003eswipe-selector\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.6\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\n## How do I use it?\n\nThe usage is really simple.\n\n**First add SwipeSelector to your layout file:**\n\n```xml\n\u003ccom.roughike.swipeselector.SwipeSelector\n    android:value=\"@+value/swipeSelector\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\" /\u003e\n```\n\n**Then get a hold of it and give it a set of SwipeItem objects with values, titles and descriptions:**\n\n```java\nSwipeSelector swipeSelector = (SwipeSelector) findViewById(R.value.swipeSelector);\nswipeSelector.setItems(\n  // The first argument is the value for that item, and should in most cases be unique for the\n  // current SwipeSelector, just as you would assign values to radio buttons.\n  // You can use the value later on to check what the selected item was.\n  // The value can be any Object, here we're using ints.\n  new SwipeItem(0, \"Slide one\", \"Description for slide one.\"),\n  new SwipeItem(1, \"Slide two\", \"Description for slide two.\"),\n  new SwipeItem(2, \"Slide three\", \"Description for slide three.\")\n);\n```\n\n**Whenever you need to know what is the currently showing SwipeItem:**\n```java\nSwipeItem selectedItem = swipeSelector.getSelectedItem();\n\n// The value is the first argument provided when creating the SwipeItem.\nint value = (Integer) selectedItem.value;\n\n// for example\nif (value == 0) {\n  // The user selected slide number one.\n}\n```\n\nFor an example project using multiple SwipeSelectors, [refer to the sample app](https://github.com/roughike/SwipeSelector/tree/master/sample/src/main).\n\n## Customization\n\n```xml\n\u003ccom.roughike.swipeselector.SwipeSelector\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:value=\"@+value/conditionSelector\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    app:swipe_indicatorSize=\"10dp\"\n    app:swipe_indicatorMargin=\"12dp\"\n    app:swipe_indicatorInActiveColor=\"#DDDDDD\"\n    app:swipe_indicatorActiveColor=\"#FF00FF\"\n    app:swipe_leftButtonResource=\"@drawable/leftButtonResource\"\n    app:swipe_rightButtonResource=\"@drawable/rightButtonResource\"\n    app:swipe_customFontPath=\"fonts/MySuperDuperFont.ttf\"\n    app:swipe_titleTextAppearance=\"@style/MyTitleTextApperance\"\n    app:swipe_descriptionTextAppearance=\"@style/MyDescriptionTextApperance\"\n    app:swipe_descriptionGravity=\"center\" /\u003e\n```\n\n\u003cdl\u003e\n  \u003cdt\u003eswipe_indicatorSize\u003c/dt\u003e\n  \u003cdd\u003ethe size for the circle indicators.\u003c/dd\u003e\n\n  \u003cdt\u003eswipe_indicatorMargin\u003c/dt\u003e\n  \u003cdd\u003ehow far the indicators are from each other.\u003c/dd\u003e\n\n  \u003cdt\u003eswipe_indicatorInActiveColor\u003c/dt\u003e\n  \u003cdd\u003ethe color for normal unselected indicators.\u003c/dd\u003e\n\n  \u003cdt\u003eswipe_indicatorActiveColor\u003c/dt\u003e\n  \u003cdd\u003ethe color for selected indicator.\u003c/dd\u003e\n\n  \u003cdt\u003eswipe_leftButtonResource and swipe_rightButtonResource\u003c/dt\u003e\n  \u003cdd\u003ecustom Drawable resources for the left and right buttons. The margins for the content are calculated automatically, so even a bigger custom image won't overlap the content.\u003c/dd\u003e\n\n  \u003cdt\u003eswipe_customFontPath\u003c/dt\u003e\n  \u003cdd\u003epath for your custom font file, such as \u003ccode\u003efonts/MySuperDuperFont.ttf\u003c/code\u003e. In that case your font path would look like \u003ccode\u003esrc/main/assets/fonts/MySuperDuperFont.ttf\u003c/code\u003e, but you only need to provide \u003ccode\u003efonts/MySuperDuperFont.ttf\u003c/code\u003e, as the asset folder will be auto-filled for you.\u003c/dd\u003e\n\n  \u003cdt\u003eswipe_titleTextAppearance and swipe_descriptionTextAppearance\u003c/dt\u003e\n  \u003cdd\u003ecustom TextAppearance for the title and description TextViews for modifying the font sizes and colors and what not.\u003c/dd\u003e\n  \n  \u003cdt\u003eswipe_descriptionGravity\u003c/dt\u003e\n  \u003cdd\u003ecustom horizontal gravity (in other words alignment) for the description text. Can be either \u003ccode\u003eleft\u003c/code\u003e, \u003ccode\u003ecenter\u003c/code\u003e or \u003ccode\u003eright\u003c/code\u003e. Default should be fine in most cases, but sometimes you might need to modify this.\u003c/dd\u003e\n\u003c/dl\u003e\n\n## Apps using SwipeSelector\n\n  * [ScoreIt - Score Keeper](https://play.google.com/store/apps/details?value=com.sbgapps.scoreit) : An application to keep track of score.\n\nSend me a pull request with modified README.md to get a shoutout!\n\n## Contributions\n\nFeel free to create issues / pull requests.\n\n## License\n\n```\nSwipeSelector library for Android\nCopyright (c) 2016 Iiro Krankka (http://github.com/roughike).\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froughike%2FSwipeSelector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froughike%2FSwipeSelector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froughike%2FSwipeSelector/lists"}