Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 2.05 KB

README.md

File metadata and controls

65 lines (50 loc) · 2.05 KB

Flat-Radio-Group

Flat-Radio-Group removes the need to nest RadioButtons inside a ViewGroup(RadioGroup). To be used in conjunction with ConstraintLayout.

Usage

Gradle file:

implementation 'com.udit.android:flatradiogroup:0.0.1'

xml layout file:

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="20dp">

   <RadioButton
        android:id="@+id/radioButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/select_me"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <RadioButton
        android:id="@+id/radioButton2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/select_me_please"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toBottomOf="@id/radioButton1" />

    <com.udit.android.flatradiogroup.FlatRadioGroup
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:constraint_referenced_ids="radioButton1,radioButton2" />

</android.support.constraint.ConstraintLayout>

License

Copyright 2018 Udit Verma

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.