Git Product home page Git Product logo

nestedradiobutton's Introduction

Maven Central release GitHub license

NestedRadioButton

NestedRadioButton lets you have any number of ViewGroup intermediates between your RadioButton and RadioGroup. This allows to embed your RadioButton in more complex selectable views (examples in sample).

NestedRadioButton overview

Install

NestedRadioButton is available on Maven Central. To use in your project, simply add the following dependency to your app:

dependencies {
    ...
    implementation 'com.github.jbvincey:nestedradiobutton:1.1'
    ...
}

Warning

NestedRadioButton used to be available on JCenter under the package name com.jbvincey:nestedradiobutton. Due to JCenter shutdown, the NestedRadioButton library has been migrated to Maven Central with a different package name com.github.jbvincey:nestedradiobutton. If you were pulling the NestedRadioButton library from JCenter, make sure to add Maven Central repository in your configuration and to update the package name of NestedRadioButton library.

Usage

<com.jbvincey.nestedradiobutton.NestedLinearRadioGroup
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:checkedButton="@+id/radioButton1">

    <LinearLayout
        android:id="@+id/l1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.jbvincey.nestedradiobutton.NestedRadioButton
            android:id="@+id/radioButton1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:clickableParent="@+id/l1" />
...

In your layout, use one of the 4 nested ViewGroup implementation among :

  • NestedLinearRadioGroup
  • NestedConstraintRadioGroup
  • NestedRelativeRadioGroup
  • NestedFrameRadioGroup

Then you can use NestedRadioButton at any hierarchy level under your nested ViewGroup.

The app:checkedButton attribute in the nested ViewGroup allows to define the radio button checked by default in your layout. The app:clickableParent attribute in NestedRadioButton lets you define a parent ViewGroup that will check the RadioButton on click to this ViewGroup.

Contributors

Jean-Baptiste VINCEY, [email protected]

License

Copyright 2018 Jean-Baptiste VINCEY.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

nestedradiobutton's People

Contributors

dzrjbvincey avatar jbvincey avatar

Stargazers

 avatar Prince Tatenda Zvomuya avatar Grigoriy avatar Yufeng Wu avatar Đỗ Huy Hoàng avatar Rafael Viana avatar Wade avatar logan avatar Jean Eric M. avatar Sandali Senarathne avatar Mahmoud Habboub avatar  avatar Crab avatar Marios Thoma avatar suchengen avatar  avatar JunDooong avatar  avatar dcn01 avatar PengPeng avatar Dboy avatar Sagar avatar  avatar SpongeBob avatar صيانة-01101460460 avatar  avatar Karthick Ramanathan avatar Okami avatar avenue avatar Mr.Sanchez avatar  avatar Pranav Lathigara avatar Kyle avatar 行一 avatar alpay avatar Mohamed Hany avatar AbdelQuddos (personal) avatar Caner Yılmaz avatar Farhad avatar Daniel San Ferreira da Rocha avatar Dhruv Chandrani avatar Kaushik N. Sanji avatar Steve Grosbois avatar 极速 avatar César Díez Sánchez avatar Chan Mrate Ko Ko avatar Johnny Miller avatar yoyiyi(soleil雪寂) avatar Igor Matos avatar Michal Bialas avatar Alexander Londoño Espejo avatar Hulk Su avatar  avatar Erick Sanchez avatar Matteo Lobello avatar Yoo Zhou avatar Mad Mirrajabi avatar Omar H. Soliman avatar Yossi Elkrief avatar mmma avatar Khalil Charfi avatar Arthur avatar Allen avatar Florent CHAMPIGNY avatar

Watchers

dcn01 avatar  avatar

nestedradiobutton's Issues

error: duplicate value for resource 'attr/tint' with config ''

In my project. I should delete
format="string"
in

<declare-styleable name="NestedRadioGroup">
        <attr name="checkedButton" format="reference"/>
        <attr name="orientation"/>
    </declare-styleable>

don't know why.
Maybe because the format of 'oratation' has already been defined before in sdk.
Wish this info can help you fix it.

Clear all checked

Does it hany any method like clearCheck() in RedioGroup.
I need to clear all checked radioButtons.
I have manually tried setChecked(false) following code below :

((NestedRadioButton) ((LinearLayout)binding.examGroup.getChildAt(0)).findViewById(R.id.rb1)).setChecked(false)

Getting object of NestedRadioButton properly but setChecked(false) is not working.
It would be better if clearCheck() will be added. Thanks

Multiple radio button checked

I programatically check first radio button for default and i check others in phone but first radio button not changing their state.
Untitled

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.