tubi_tv_drawable_pause_selector.xml


Overview

`tubi_tv_drawable_pause_selector.xml` is an Android **drawable selector** XML resource file used within the Tubi TV application to define the visual states of a media control button, specifically the "pause" button in the video playback interface. This selector enables the button to change its appearance dynamically based on the user's interaction, such as when the button is pressed or released.

By specifying different drawable resources for various states, this XML file helps provide intuitive and responsive UI feedback, enhancing the user experience during media playback controls.


Detailed Explanation

Purpose

This file acts as a state list drawable — a specialized XML resource that selects which drawable to display based on the current state of the UI element (e.g., pressed, focused, default). It is particularly used for the pause/play toggle button, allowing it to switch between "pause" and "play" icons depending on whether the button is being pressed.

Structure and Elements

The root element is ``, which contains multiple `` elements. Each `` specifies:

Items defined in this file:

Item Index

`android:state_pressed`

Drawable Resource

Description

1

false

`@drawable/tubi_tv_pause_large`

Shows the large pause icon when not pressed.

2

true

`@drawable/tubi_tv_play_selector`

Shows the play selector icon when pressed.

3 (default)

(none)

`@drawable/tubi_tv_pause_large`

Default drawable if no states match (pause).


Usage

This selector XML is typically referenced as the `android:background` or `android:src` attribute of an `ImageButton` or similar UI component in a layout XML file or programmatically in the app’s code.

Example usage in a layout XML:

<ImageButton
    android:id="@+id/pause_play_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/tubi_tv_drawable_pause_selector"
    android:contentDescription="@string/pause_play_button_desc" />

When the user presses the button, the drawable switches to the play icon, providing visual feedback that pressing the button will toggle playback state.


Implementation Details and Behavior


Interaction with Other System Components


Summary


Visual Diagram

flowchart TD
    A[Pause/Play Button UI Component]
    A -->|Background Drawable| B(tubi_tv_drawable_pause_selector.xml)
    B -->|state_pressed=false| C[tubi_tv_pause_large]
    B -->|state_pressed=true| D[tubi_tv_play_selector]
    C -->|Static Drawable| E[Pause Icon Image]
    D -->|Possibly Selector or Image| F[Play Icon Drawable]

**Diagram Explanation:**


Additional Notes


End of Documentation for tubi_tv_drawable_pause_selector.xml