SkillAgentSearch skills...

RadioRealButton

A custom radio button for Android API 12+

Install / Use

/learn @ceryle/RadioRealButton
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Android Arsenal

Archived

I stopped developing this library for a long time ago. I thought about revising it recently but I think there is no need for it anymore due to Jetpack Compose. As an alternative to this, I recommend you to use this library made with Jetpack Compose by Zack Klippenstein: https://gist.github.com/zach-klippenstein/7ae8874db304f957d6bb91263e292117

Thank you all for your support.

RadioRealButton

poster

Radio Real Button is a substitute of the Radio Button. Its purpose is to give more elegant view for Android users.

Preview

1 <br /> 2 <br /> 3a 3b <br /> 4 <br /> 5 <br /> 6

Installation

Gradle

Add it to your build.gradle with:

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

and:

dependencies {
    compile 'com.github.ceryle:RadioRealButton:v2.1.1'
}

What has changed with version 2?

  • Border is now part of the round container layout.
  • android:padding and rest padding attributes were working not as expected. Now, they are fixed.
  • textTypeface attribute now works like button's typeface. You can give your typeface using textTypefacePath attribute.
  • Default scaling value is now 1 as it has to be.
What added?
  • New animations added. There was only a sliding view, but now 4 more added. You can use them with app:selectorAnimationType attribute.
  • enableDeselection attribute is added. With this attribute, you can deselect buttons if you re-click on them.
  • Each button has their own selector (sliding selector has still one) and you can give divider between them.
  • textGravity attribute is added which is actually android:gravity. You can give 3 values which are left, center, right.
What removed?
  • 'image' word is replaced with "drawable" word from all attributes which have them. Reason is everyone is used to 'drawable' word and how I have used ImageView in RadioRealButton is no different than regular drawable which is used in buttons expect animations.
  • rrbg_shadow, rrbg_shadowElevation and its margin attributes are removed. You can use android:elevation attribute.
  • rrbg_enabled is removed. You can use android:enabled attribute.

Customization

Some Attributes

Radio Real Button

| Option Name | Format | Description | | ----------------- | ----------- | --------------------------------------------------------- | | drawable | integer | set drawable to button | | drawablePadding | dimension | set padding between text and drawable | | drawableTint | color | set drawable tint by giving a color code or reference | | drawableWidth | dimension | change drawable's width | | drawableHeight | dimension | change drawable's height | | drawableGravity | integer | set drawable position relative to text | | text | string | set button's text | | textColor | color | change button's text color | | textSize | dimension | change button's text size | | textTypeface | integer | default typefaces offered by android itself | | textTypefacePath | string | give your typeface by giving its path | | textFillSpace | boolean | when enabled, it pushes drawable to edges of the button | | textStyle | integer | default styles offered by android itself | | textGravity | integer | give text gravity(not layout_gravity) | | ripple | boolean | set it true for default ripple | | rippleColor | color | give any color to achieve colorful ripples | | backgroundColor | color | give background color by giving a color code or reference | | checked | boolean | its usage is the same as radio button |

Radio Real Button Group

| Option Name | Format | Description | | ------------------------- | ----------- | ----------------------------- | | radius | integer | set radius to make radio real button group rounder | | borderSize | dimension | adds border to group with the given size | | borderColor | dimension | changes border color | | backgroundColor | color | give background color by giving a color code or reference | | enableDeselection | color | enable deselection to un-check a button | | dividerSize | dimension | set divider size for the line between buttons | | dividerPadding | dimension | gives padding to divider's top and bottom | | dividerColor | color | give color code or reference | | dividerRadius | dimension | give dimension to make divider's corners rounder | | selectorDividerSize | dimension | set selector divider size for the line between buttons | | selectorDividerPadding | dimension | gives padding to selector divider's top and bottom | | selectorDividerColor | color | give color code or reference | | selectorDividerRadius | dimension | give dimension to make selector divider's corners rounder | | bottomLineColor | color | set bottom line color | | bottomLineSize | dimension | set bottom line height | | bottomLineBringToFront | boolean | if it is true, it brings bottomLine on top of selector | | bottomLineRadius | dimension | give dimension to make bottomLine's corners rounder | | selectorTop | boolean | align selector to top | | selectorBottom | boolean | align selector to bottom | | selectorColor | color | set color of selector | | selectorSize | dimension | set height of selector | | selectorRadius | dimension | give dimension to make selector's corners rounder | | selectorBringToFront | boolean | if it is true, it brings selector on top of everything | | selectorAboveOfBottomLine | boolean | if it is true, it brings selector above of bottom line | | selectorFullSize | boolean | selector fills space up to button's height | | checkedPosition | integer | check a button by a position number | | checkedButton | reference | check a button by button's unique id | | animate | boolean | set animation on bottom moving view | | animateSelector | integer | gives interpolator to selector | | animateSelector_delay | integer | gives delay to selector's animation when it enters | | animateSelector_duration | integer | animation duration of selector in ms | | animateDrawables_scale | float | adjust drawable's size when it is checked | | animateDrawables_enter | integer | enter animation on drawable when button is checked | | animateDrawables_enterDuration | integer | enter animation duration of drawable in ms | | animateDrawables_exit | integer | exit animation on drawable when other button is checked | | animateDrawables_exitDuration | integer | exit animation duration of drawable in ms | | animateTexts_scale | float | adjust text's size when it is checked | | animateTexts_enter | integer | enter animation on text when button is checked | | animateTexts_enterDuration | integer | enter animation duration of text in ms | | animateTexts_exit | integer | exit animation on text when other button is checked | | animateTexts_exitDuration | integer | exit animation duration of text in ms | | animateDrawables_tintColorFrom | color | initial color for drawable's tint color transition animation | | animateDrawables_tintColorTo | color | final color for drawable's tint color transition animation | | animateDrawables_tintColor_duration | integer | total animation duration of drawable's tint transition in ms | | animateTexts_textColorFrom | color | initial color for text's text color transition animation | | animateTexts_textColorTo | color | final color for text's text color transition animation | | animateTexts_textColor_duration | integer | total animation duration of text's text color in ms |

Examples

In Xml Layout
<co.ceryle.radiorealbutton.RadioRealButtonGroup
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:rrbg_animateDrawables_enter="overshoot"
    app:rrbg_animateTexts_enter="overshoot"
    app:rrbg_dividerColor="@color/black"
    app:rrbg_dividerSize="1dp"
    app:rrbg_radiu
View on GitHub
GitHub Stars258
CategoryDevelopment
Updated5mo ago
Forks71

Languages

Java

Security Score

97/100

Audited on Oct 27, 2025

No findings