Posts

Showing posts from February, 2025

RadioButtons-AGN HUB

  RadioButton in Kotlin (Android) Key Components RadioButton : The individual buttons representing the options. RadioGroup : Groups multiple RadioButton elements to enforce single selection. Basic Implementation XML Layout <LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     android:padding="16dp">     <RadioGroup         android:id="@+id/radioGroup"         android:layout_width="match_parent"         android:layout_height="wrap_content">         <RadioButton             android:id="@+id/rad...

Checkbox- AGN HUB

  CheckBox in Kotlin (Android) The CheckBox is a two-state button that can be either checked or unchecked. It is commonly used for selecting multiple options from a set. Key Properties isChecked : Boolean value indicating whether the CheckBox is checked or unchecked. setOnCheckedChangeListener : Listener to handle the change in the checked state. text : Text displayed next to the CheckBox . Basic Implementation XML Layout <LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     android:padding="16dp">     <CheckBox         android:id="@+id/checkBox"         android:layout_width="wrap_content"        ...