tubi_tv_drawable_scrubber_selector.xml


Overview

The [tubi_tv_drawable_scrubber_selector.xml](/projects/288/68408) file is an Android drawable selector resource that defines visual states for the scrubber thumb of a media seek bar in the Tubi TV application. Specifically, this selector switches the thumb drawable between two different shapes depending on whether the scrubber is currently pressed or not. This enhances user interaction feedback by visually distinguishing the pressed state from the normal state when users drag or tap the seek bar thumb.


Detailed Explanation

Purpose

XML Structure and Elements

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/tubi_tv_seek_bar_thumb_pressed_shape" android:state_pressed="true"/>
    <item android:drawable="@drawable/tubi_tv_seek_bar_thumb_normal_shape" android:state_pressed="false"/>
</selector>

How It Works


Usage

This selector is typically referenced in the seek bar component of the UI, specifically as the `thumb` drawable for the media scrubber, for example:

<SeekBar
    android:id="@+id/media_seek_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:thumb="@drawable/tubi_tv_drawable_scrubber_selector" />

Parameters

Return Values


Important Implementation Details


Interaction with Other System Components


Visual Diagram

The following flowchart illustrates how the drawable selector determines which drawable to display based on the scrubber thumb's pressed state.

flowchart TD
    A[Scrubber Thumb State Change] --> B{Is Thumb Pressed?}
    B -- Yes --> C[tubi_tv_seek_bar_thumb_pressed_shape]
    B -- No --> D[tubi_tv_seek_bar_thumb_normal_shape]
    C --> E[Display Pressed Drawable]
    D --> E[Display Normal Drawable]

Summary


This simple yet effective XML selector exemplifies Android's powerful resource system for managing UI state-dependent visuals without requiring imperative code changes.