tubi_radio_quality_selector.xml


Overview

The file **tubi_radio_quality_selector.xml** defines a drawable selector resource used in an Android application. Its primary purpose is to specify different drawable images for a radio button UI component based on the checked state. This selector enables the app to visually distinguish between the checked and unchecked states of a radio button by switching the displayed icon accordingly.

This XML selector is part of the user interface layer within the overall modular app architecture. It plays a role in enhancing user experience by providing clear visual feedback on selection states in the UI.


Detailed Explanation

XML Structure and Elements

Items Defined

State

Drawable Resource

Description

state_checked="true"

`@drawable/tubi_tv_radio_checked`

Drawable used when the radio button is checked (selected).

state_checked="false"

`@drawable/tubi_tv_radio_normal`

Drawable used when the radio button is unchecked (not selected).

Usage Example

This selector is typically applied as the button drawable of a `RadioButton` or a similar compound button widget in an Android layout XML file:

<RadioButton
    android:id="@+id/radio_quality"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:button="@drawable/tubi_radio_quality_selector"
    android:text="High Quality" />

In this example, when the radio button is selected, the drawable `tubi_tv_radio_checked` will be shown; when unselected, `tubi_tv_radio_normal` will be displayed.


Implementation Details


Interaction with Other Components


Visual Diagram

This file defines a simple state-based drawable selector. The following Mermaid flowchart illustrates the conditional logic determining which drawable is shown based on the radio button state:

flowchart TD
    A[Radio Button State] -->|Checked = true| B[tubi_tv_radio_checked Drawable]
    A -->|Checked = false| C[tubi_tv_radio_normal Drawable]

**Diagram Explanation:**


Summary

This file is a fundamental UI resource that contributes to consistent and intuitive user interaction within the app’s interface, aligning with the project’s modular and scalable architecture principles.