Skip to content
Android implementation of iPhone's segmented control
Find file
Pull request Compare This branch is 10 commits behind vinc3m1:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
res
screens
src/com/makeramen/segmented
.classpath
.hgignore
.project
AndroidManifest.xml
NOTICE.txt
README.md
default.properties

README.md

Segmented Radio Buttons for Android

This is my implementation of iOS's segmented controls for Android by extending RadioGroup and RadioButton. Example project included.

Screenshots

Segmented Toggle Button

Usage

  • For text-only buttons, you just need SegmentedRadioGroup.java which extends RadioGroup, so all your standard RadioButton implementations and callbacks should work.

  • For image buttons, implement SegmentedRadioImageButton instead of RadioButton.

  • Drawables are included, but can easily be replaced.

  • See example project for usage

Known Issues

  • SegmentedRadioImageButton currently uses a custom implemented scaleType similar to CENTER_INSIDE and doesn't respect padding values. If anyone wants to extend the onDraw method to do so, that would be much appreciated.

  • RadioGroup has a bug that calls onCheckedChangedListener multiple times when you use clearCheck() or check() programmatically. See this for more info.

Something went wrong with that request. Please try again.