tubi_tv_seek_bar_thumb_normal_shape.xml
Overview
The `tubi_tv_seek_bar_thumb_normal_shape.xml` file defines a custom drawable shape used for the "thumb" element of a seek bar in the Tubi TV Android application. Specifically, it creates a white circular (oval) shape that serves as the normal (default) visual appearance of the seek bar thumb, which users drag to change playback position or other continuous values.
This XML drawable resource ensures consistent styling of the seek bar thumb, adhering to the app's design language by using predefined color resources and fixed dimensions.
Detailed Explanation
This file is an Android **Shape Drawable** resource definition, specifying how the thumb of the seek bar should be drawn.
Root Element: <shape>
Namespace:
xmlns:android="http://schemas.android.com/apk/res/android"Attribute:
android:shape="oval"
Specifies that the drawable is an oval (circle in this case due to equal width and height).
Child Elements and Attributes
Element | Attributes | Description |
|---|---|---|
`` | `android:color="@color/tubi_tv_player_white"` | Sets the fill color of the shape, referencing a white color resource defined elsewhere in the app. |
`` | `android:color="@color/tubi_tv_player_white"` | Defines the border color and thickness around the shape, also white with a 1dp width stroke. |
`` | `android:height="25dp"` | Sets fixed dimensions of the oval to 25 density-independent pixels in both height and width, making it a perfect circle. |
Usage Example
This drawable is typically applied as the `thumb` drawable for a SeekBar widget in Android layouts or programmatically.
In XML Layout
<SeekBar
android:id="@+id/media_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:thumb="@drawable/tubi_tv_seek_bar_thumb_normal_shape" />
Programmatically in Java/Kotlin
val seekBar: SeekBar = findViewById(R.id.media_seekbar)
val thumbDrawable = ContextCompat.getDrawable(context, R.drawable.tubi_tv_seek_bar_thumb_normal_shape)
seekBar.thumb = thumbDrawable
Implementation Details
Shape Type: Oval shape is used because the seek bar thumb is typically a circle for aesthetic and usability reasons.
Color Reference: Both the fill color and the stroke color refer to the same color resource
@color/tubi_tv_player_white. This maintains a uniform white appearance with a subtle border.Dimensions: The fixed size of 25dp ensures the thumb is large enough for user interaction on various screen densities, balancing usability and visual design.
Interaction with Other Components
This drawable is part of the UI layer in the modular architecture of the app.
It is used by SeekBar components, which themselves are part of the media playback controls in the user interface.
The colors referenced (
@color/tubi_tv_player_white) are part of the app's centralized color resources, promoting consistency.The drawable indirectly interacts with event handling components through the SeekBar widget, enabling users to seek media playback positions.
It contributes to the user experience by providing a clear, visually consistent, and touch-friendly control element.
Visual Diagram
flowchart TD
A[SeekBar Widget] --> B[tubi_tv_seek_bar_thumb_normal_shape.xml]
B --> C[Shape Drawable (Oval)]
C --> D[Solid Fill: @color/tubi_tv_player_white]
C --> E[Stroke: 1dp, @color/tubi_tv_player_white]
C --> F[Size: 25dp x 25dp]
**Diagram Explanation:**
The SeekBar widget uses this XML drawable as its thumb.
The drawable defines an oval shape with a white solid fill and stroke.
The size is fixed to 25dp by 25dp, resulting in a circular thumb.
Summary
`tubi_tv_seek_bar_thumb_normal_shape.xml` is a simple yet essential UI resource defining the appearance of the seek bar thumb in the Tubi TV app. The file ensures the thumb is a white, circular, and consistent control element across the app by using a shape drawable with fixed size and color references. It integrates seamlessly with the Android UI framework, enhancing the overall user experience during media playback control.