All Projects → ceryle → Radiorealbutton

ceryle / Radiorealbutton

Licence: apache-2.0
A custom radio button for Android API 12+

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Radiorealbutton

Examples Win32
Shows how to use Win32 controls by programming code (c++17).
Stars: ✭ 22 (-91.2%)
Mutual labels:  button, radio-buttons
react-native-radio-buttons-group
Simple, best and easy to use radio buttons for react native apps.
Stars: ✭ 145 (-42%)
Mutual labels:  button, radio-buttons
Segmentedbutton
Segmented Control with animation for Android API 12+
Stars: ✭ 352 (+40.8%)
Mutual labels:  button, radio-buttons
AMChoice
Radio Button and check box for iOS
Stars: ✭ 45 (-82%)
Mutual labels:  button, radio-buttons
Tristatetogglebutton
Customizable tri-state toggle button (with three states, three state toggle) for Android
Stars: ✭ 198 (-20.8%)
Mutual labels:  button, radio-buttons
Androidbuttonprogress
Provides download button progress view for android
Stars: ✭ 166 (-33.6%)
Mutual labels:  button
Heyui
🎉UI Toolkit for Web, Vue2.0 http://www.heyui.top
Stars: ✭ 2,373 (+849.2%)
Mutual labels:  button
React Native Flexi Radio Button
Simple and flexible Radio button for React Native App
Stars: ✭ 151 (-39.6%)
Mutual labels:  radio-buttons
Radio Group
845 byte WAI-ARIA 1.1 compliant radio group React component
Stars: ✭ 133 (-46.8%)
Mutual labels:  radio-buttons
Pygame Menu
Menu for pygame. Simple, lightweight and easy to use
Stars: ✭ 244 (-2.4%)
Mutual labels:  button
React Menu
React component for building accessible menu, dropdown, submenu, context menu and more.
Stars: ✭ 237 (-5.2%)
Mutual labels:  radio-buttons
Llbootstrapbutton
Bootstrap 3.0扁平化风格按钮,自带图标,一句代码直接调用!!!
Stars: ✭ 189 (-24.4%)
Mutual labels:  button
Bttn.css
Awesome buttons for awesome projects!
Stars: ✭ 2,004 (+701.6%)
Mutual labels:  button
Loading Buttons Ios
A collection of loading buttons and their stylings written in Swift.
Stars: ✭ 204 (-18.4%)
Mutual labels:  button
React Ripples
🏊 Material ripple effect. Ripples everything
Stars: ✭ 160 (-36%)
Mutual labels:  button
Pretty Checkbox Vue
Quickly integrate pretty checkbox components with Vue.js
Stars: ✭ 240 (-4%)
Mutual labels:  radio-buttons
Sharpview
安卓带有尖角气泡的控件(TextView,ImageView,EditText,Layout),支持渐变色,圆角等自定义属性
Stars: ✭ 137 (-45.2%)
Mutual labels:  button
Easybutton
Arduino library for debouncing momentary contact switches, detect press, release, long press and sequences with event definitions and callbacks.
Stars: ✭ 187 (-25.2%)
Mutual labels:  button
Cameravideobutton
Instagram like animated button for taking photo or recording video.
Stars: ✭ 223 (-10.8%)
Mutual labels:  button
Lgbutton
A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.
Stars: ✭ 2,216 (+786.4%)
Mutual labels:  button

Android Arsenal

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
2
3a 3b
4
5
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_radius="10dp"
    app:rrbg_selectorColor="@color/red_700"
    app:rrbg_selectorSize="6dp">

    <co.ceryle.radiorealbutton.RadioRealButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:rrb_drawable="@mipmap/ic_launcher"
        app:rrb_drawableHeight="36dp"
        app:rrb_drawablePadding="8dp"
        app:rrb_drawableWidth="36dp"
        app:rrb_ripple="true"
        app:rrb_rippleColor="@color/black"
        app:rrb_text="Button 1"
        app:rrb_textColor="@color/black"/>

    <co.ceryle.radiorealbutton.RadioRealButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:rrb_drawable="@mipmap/ic_launcher"
        app:rrb_drawableGravity="right"
        app:rrb_drawableHeight="36dp"
        app:rrb_drawablePadding="8dp"
        app:rrb_drawableWidth="36dp"
        app:rrb_ripple="true"
        app:rrb_rippleColor="@color/black"
        app:rrb_text="Button 2"
        app:rrb_textColor="@color/black"/>
</co.ceryle.radiorealbutton.RadioRealButtonGroup>
Listener Example
final RadioRealButton button1 = (RadioRealButton) findViewById(R.id.button1);
final RadioRealButton button2 = (RadioRealButton) findViewById(R.id.button2);

RadioRealButtonGroup group = (RadioRealButtonGroup) findViewById(R.id.group);

// onClickButton listener detects any click performed on buttons by touch
group.setOnClickedButtonListener(new RadioRealButtonGroup.OnClickedButtonListener() {
    @Override
    public void onClickedButton(RadioRealButton button, int position) {
        Toast.makeText(MainActivity.this, "Clicked! Position: " + position, Toast.LENGTH_SHORT).show();
    }
});

// onPositionChanged listener detects if there is any change in position
group.setOnPositionChangedListener(new RadioRealButtonGroup.OnPositionChangedListener() {
    @Override
    public void onPositionChanged(RadioRealButton button, int position) {
        Toast.makeText(MainActivity.this, "Position Changed! Position: " + position, Toast.LENGTH_SHORT).show();
    }
});

// onLongClickedButton detects long clicks which are made on any button in group.
// return true if you only want to detect long click, nothing else
// return false if you want to detect long click and change position when you release
group.setOnLongClickedButtonListener(new RadioRealButtonGroup.OnLongClickedButtonListener() {
    @Override
    public boolean onLongClickedButton(RadioRealButton button, int position) {
        Toast.makeText(MainActivity.this, "Long Clicked! Position: " + position, Toast.LENGTH_SHORT).show();
        return false;
    }
});

License

This project is licensed under the Apache License Version 2.0 - see the LICENSE.md file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].