tubi_tv_drawable_quality_on_selector.xml


Overview

`tubi_tv_drawable_quality_on_selector.xml` is an Android **drawable selector resource file** that defines how the app's UI should display a specific drawable resource (`tubi_tv_quality_on`) based on the pressed state of a UI element (such as a button). Drawable selectors are commonly used in Android to change the appearance of UI components dynamically in response to user interactions, like tapping or pressing.

This particular selector switches between two drawable images:

If the UI element associated with this selector is pressed, it shows the pressed drawable; otherwise, it shows the default drawable.


Detailed Explanation

XML Structure

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/tubi_tv_quality_on" android:state_pressed="false"></item>
    <item android:drawable="@drawable/tubi_tv_quality_on_pressed" android:state_pressed="true"></item>
    <!-- default -->
    <item android:drawable="@drawable/tubi_tv_quality_on" />
</selector>

Elements and Attributes


How It Works


Usage Example

Suppose you have a button that controls video quality settings. To apply this selector as the button background:

<Button
    android:id="@+id/quality_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/tubi_tv_drawable_quality_on_selector"
    android:text="Quality" />

In this example:


Important Implementation Details


Interaction with Other Parts of the System


Visual Diagram

flowchart TD
    A[UI Element (e.g., Button)] --> B{User Interaction}
    B -- Pressed (true) --> C[tubi_tv_quality_on_pressed Drawable]
    B -- Not Pressed (false) --> D[tubi_tv_quality_on Drawable]
    C -.-> E[Displayed as background]
    D -.-> E[Displayed as background]

**Explanation:**


Summary

This file is a small yet crucial piece of the UI layer, enabling smooth and visually consistent user interactions in the Tubi TV application.