Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

SwipeSelector

> 编程语言
Open source

A nicer-looking, more intuitive and highly customizable alternative for radio buttons and dropdowns for Android.

1.1K stars0 likes0 views
WebsiteGitHub

About

A nicer-looking, more intuitive and highly customizable alternative for radio buttons and dropdowns for Android.

SwipeSelector

Undergoing for some API changes for a 2.0 major version, see example usage in the sample module!

What and why?

Bored 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.

Unfortunately, there were no ready-made solutions to achieve this, so I spent a good day working on this very thing I call SwipeSelector.

minSDK Version

SwipeSelector supports API levels all the way down to 8 (Android Froyo).

Installation

Gradle:

groovy
compile 'com.roughike:swipe-selector:1.0.6'

Maven:

xml

  com.roughike
  swipe-selector
  1.0.6
  pom

How do I use it?

The usage is really simple.

First add SwipeSelector to your layout file:

xml

Then get a hold of it and give it a set of SwipeItem objects with values, titles and descriptions:

…

Whenever you need to know what is the currently showing SwipeItem:

java
SwipeItem selectedItem = swipeSelector.getSelectedItem();

// The value is the first argument provided when creating the SwipeItem.
int value = (Integer) selectedItem.value;

// for example
if (value == 0) {
  // The user selected slide number one.
}

For an example project using multiple SwipeSelectors, refer to the sample app.

Customization

xml

swipe_indicatorSize the size for the circle indicators.

swipe_indicatorMargin how far the indicators are from each other.

swipe_indicatorInActiveColor the color for normal unselected indicators.

swipe_indicatorActiveColor the color for selected indicator.

swipe_leftButtonResource and swipe_rightButtonResource custom 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.

swipe_customFontPath path for your custom font file, such as fonts/MySuperDuperFont.ttf. In that case your font path would look like src/main/assets/fonts/MySuperDuperFont.ttf, but you only need to provide fonts/MySuperDuperFont.ttf, as the asset folder will be auto-filled for you.

swipe_titleTextAppearance and swipe_descriptionTextAppearance custom TextAppearance for the title and description TextViews for modifying the font sizes and colors and what not.

swipe_descriptionGravity custom horizontal gravity (in other words alignment) for the description text. Can be either left, center or right. Default should be fine in most cases, but sometimes you might need to modify this.

Apps using SwipeSelector

  • ScoreIt - Score Keeper : An application to keep track of score.

Send me a pull request with modified README.md to get a shoutout!

Contributions

Feel free to create issues / pull requests.

License

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言