tubi_tv_seek_bar_thumb_pressed_shape.xml


Overview

`tubi_tv_seek_bar_thumb_pressed_shape.xml` is an Android drawable resource file defining a custom shape used as the visual representation of the "thumb" (the draggable handle) on a seek bar when it is in the pressed state. This file configures the appearance of the thumb as a fixed-size oval with a solid fill color, a stroke outline, and specific dimensions.

This drawable enhances the user experience by providing a visually distinct and consistent indicator of the seek bar's thumb when pressed, aligning with the app's branding through custom colors and styling.


Detailed Explanation

XML Structure and Attributes

This file uses the `` drawable element from the Android framework, which allows creating simple shapes programmatically without needing image assets.

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">

Child Elements

  1. <solid>

    <solid android:color="@color/tubi_tv_golden_gate" />
    
    • Defines the fill color of the shape.

    • The color is referenced from the app's color resources (@color/tubi_tv_golden_gate), which presumably corresponds to a custom golden hue matching the app's theme.

  2. <stroke>

    <stroke
        android:color="@color/tubi_tv_player_white"
        android:width="3dp" />
    
    • Defines the outline (border) of the shape.

    • android:color references a white color resource (@color/tubi_tv_player_white).

    • android:width sets the stroke thickness to 3 density-independent pixels (dp), ensuring consistent size across different device densities.

  3. <size>

    <size
        android:height="25dp"
        android:width="25dp" />
    
    • Fixes the size of the drawable to 25dp by 25dp. This ensures the oval is rendered as a perfect circle with a consistent diameter.


Usage Example

This drawable is typically referenced in the seek bar widget as the thumb when the user presses it. For example, in a custom seek bar style or programmatically:

<SeekBar
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:thumb="@drawable/tubi_tv_seek_bar_thumb_pressed_shape" />

Or in a selector drawable for the thumb to switch between pressed and default states:

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

Implementation Details and Design Considerations


Interaction With Other Components


Visual Diagram

flowchart TD
    A[SeekBar UI Component] --> B[Thumb Drawable]
    B --> C[tubi_tv_seek_bar_thumb_pressed_shape.xml]
    C --> D[Shape: Oval]
    C --> E[Fill Color: @color/tubi_tv_golden_gate]
    C --> F[Stroke: 3dp, Color @color/tubi_tv_player_white]
    C --> G[Size: 25dp x 25dp]
    B --> H[State: Pressed]

**Diagram Explanation:**


Summary

`tubi_tv_seek_bar_thumb_pressed_shape.xml` is a simple yet essential drawable resource defining the pressed state appearance of the seek bar thumb as a golden circular button with a white stroke. It leverages Android's shape drawable system for a scalable and theme-consistent UI element, enhancing the app’s user interaction experience.