Git Product home page Git Product logo

image-radio-button-android's Introduction

Image Radio Button

Android Version License API

๐Ÿ“ป Light library that is beautiful custom radio button with image functionality. You can easily add image to radio button. Integration is very easy.

Setup

Add it in your root build.gradle at the end of repositories:

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

Include below dependency in build.gradle of application and sync it:

implementation 'com.github.raheemadamboev:image-radio-button-android:1.0.7'

Implementation

Add GravityRadioGroup to your XML layout:

<xyz.teamgravity.imageradiobutton.GravityRadioGroup
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

Add GravityImageRadioButton inside the GravityRadioGroup and set required attributes below:

<xyz.teamgravity.imageradiobutton.GravityRadioGroup
  ...
 >

<xyz.teamgravity.imageradiobutton.GravityImageRadioButton
	android:id="@+id/android_b"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:padding="20dp"
        app:girbImage="@drawable/android"
        app:girbPressedTextColor="@color/white"
        app:girbText="Android"
        app:girbUnpressedTextColor="?attr/colorPrimary" />
            
</xyz.teamgravity.imageradiobutton.GravityRadioGroup>

Attributes

Attribute Type Usage
app:girbText string String to display
app:girbUnpressedTextColor color Color of text when radio button is unpressed/unchecked
app:girbPressedTextColor color Color of text when radio button is pressed/checked
app:girbImage drawable Image drawable to display
app:girbUnpressedImageTint color Tint color of image when radio button is unpressed/unchecked
app:girbPressedImageTint color Tint color of image when radio button is pressed/checked
app:girbPressedBackgroundDrawable drawable Background drawable when radio button is pressed/checked

If you don't want to set tint to ImageView of RadioButton, just don't set app:girbUnpressedImageTint and app:girbPressedImageTint attributes in XML!

Demo

Programming pictures are placed with the help of this library in this demo application. When radio button is clicked, its text gets shown via Toast.

Download demo

Projects using this library

GoTest 150 000+ downloads in Google Play Store

Buxgalteriya schyotlar rejasi 20 000+ downloads in Google Play Store

Irregular Verbs 20 000+ downloads in Google Play Store

License

Designed and developed by raheemadamboev (Raheem) 2022.

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.

image-radio-button-android's People

Contributors

raheemadamboev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

image-radio-button-android's Issues

image size

Hi
How to increase image size ?

Thanks

Cant uncheck RadioButton

Cant uncheck radiobutton, because clearCheck() function stetted private, is there any other alternative?

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.