styles.xml

Overview

The `styles.xml` file is an Android resource file that defines custom UI styles used throughout the application. It centralizes visual theme attributes and widget styling, enabling consistent look and feel across different screens and components. This file contains style definitions for the player theme, seek bar appearance, toggle buttons, and video buttons, specifically tailored for the Tubi video player interface.

By encapsulating style attributes in this file, the application ensures maintainability and ease of customization without modifying individual UI layouts. The styles extend existing Android framework themes and widgets, overriding or adding specific properties such as colors, dimensions, and drawable resources.


Detailed Explanation of Styles

1. TubiPlayerTheme

Attributes:

Attribute

Value

Description

`android:windowNoTitle`

`true`

Disables the window title bar.

`android:windowBackground`

`@android:color/black`

Sets the background color of the window to black.

`android:keepScreenOn`

`true`

Keeps the screen from dimming or locking while the player is active.

`android:windowFullscreen`

`true`

Enables fullscreen mode, hiding status and navigation bars.

`android:windowContentOverlay`

`@null`

Removes any default content overlay (e.g., shadows).

Usage Example:

<!-- Apply theme in AndroidManifest.xml -->
<activity android:name=".PlayerActivity"
          android:theme="@style/TubiPlayerTheme" />

2. TubiSeekBar

Attributes:

Attribute

Value

Description

`android:progressDrawable`

`@drawable/tubi_tv_seek_bar`

Custom drawable resource for the progress bar track.

`android:thumb`

`@drawable/tubi_tv_drawable_scrubber_selector`

Custom drawable for the draggable thumb/scrubber.

`android:minHeight`

`2dp`

Sets minimum height of the seek bar.

`android:maxHeight`

`2dp`

Sets maximum height of the seek bar.

Usage Example:

<SeekBar
    style="@style/TubiSeekBar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

3. TubiEmptyToggleButton

Attributes:

Attribute

Value

Description

`android:layout_width`

`@dimen/view_tubi_controller_options_button_width`

Width dimension from app resources for consistent sizing.

`android:layout_height`

`@dimen/view_tubi_controller_options_height`

Height dimension from app resources.

`android:text`

`""`

Empty text when toggle is unchecked.

`android:textOff`

`""`

Empty text when toggle is off.

`android:textOn`

`""`

Empty text when toggle is on.

Usage Example:

<ToggleButton
    style="@style/TubiEmptyToggleButton"
    android:id="@+id/option_toggle_button" />

4. TubiVideoButton

Attributes:

Attribute

Value

Description

`android:layout_width`

`@dimen/view_tubi_controller_video_button_width`

Width dimension for video buttons.

`android:layout_height`

`@dimen/view_tubi_controller_video_button_height`

Height dimension for video buttons.

`android:layout_marginLeft`

`@dimen/view_tubi_controller_video_button_margin_left`

Left margin for button placement.

`android:layout_marginRight`

`@dimen/view_tubi_controller_video_button_margin_right`

Right margin for button placement.

`android:layout_marginTop`

`@dimen/view_tubi_controller_video_button_margin_top`

Top margin for button placement.

`android:background`

`?android:attr/selectableItemBackground`

Uses selectable background for touch feedback.

`android:scaleType`

`fitXY`

Scales content to fit both X and Y dimensions.

`android:visibility`

`gone`

Hidden by default; can be shown programmatically as needed.

Usage Example:

<ImageButton
    style="@style/TubiVideoButton"
    android:id="@+id/video_play_button" />

Important Implementation Details


Interaction with Other System Components


Visual Diagram: Style Structure Overview

flowchart TD
    A[styles.xml] --> B[TubiPlayerTheme]
    A --> C[TubiSeekBar]
    A --> D[TubiEmptyToggleButton]
    A --> E[TubiVideoButton]

    B --> B1[Theme.AppCompat.NoActionBar]
    B1 -. Inherits .-> B

    C --> C1[Widget.SeekBar]
    C1 -. Inherits .-> C

    D --> D1[ToggleButton (default)]
    D1 -. Inherits .-> D

    E --> E1[Button/ImageView (default)]
    E1 -. Inherits .-> E

    B -->|Applies to| F[PlayerActivity / Player UI]
    C -->|Used in| G[SeekBar UI Element]
    D -->|Used in| H[ToggleButton UI Element]
    E -->|Used in| I[Video Button UI Element]

Summary

The `styles.xml` file provides essential style definitions that shape the visual and interactive aspects of the Tubi player UI. By leveraging Android theming and widget customization, it ensures a polished, consistent user experience while enabling flexibility and maintainability. It directly impacts player activity UI, controls appearance, and user interaction elements, tightly integrating with dimension and drawable resources to produce the final app interface.