view_tubi_radio_button.xml


Overview

The `view_tubi_radio_button.xml` file is an Android layout resource defining a custom radio button component for the Tubi TV application UI. Its primary purpose is to present a horizontally arranged radio button alongside a descriptive text label, styled to match the Tubi brand guidelines. This layout is intended to be used wherever a selectable radio button option with labeled text is required, such as in quality selectors or preference settings within the app.


Detailed Explanation

Root Element: <layout>


Primary Container: LinearLayout

**Usage:**

This container ensures the radio button and text label appear side by side with proper spacing and background.


Child 1: <RadioButton>

**Usage:**

The radio button is the interactive element allowing users to select this option. The customized drawable enhances visual consistency with the app's branding.


Child 2: <com.tubitv.ui.VaudTextView>

**Additional Notes:**


Important Implementation Details


Interaction with Other Parts of the System


Usage Example

Assuming an Activity inflates this layout as part of a quality selection screen:

val radioButtonText: VaudTextView = findViewById(R.id.tubi_radio_button_text)
val radioButton: RadioButton = findViewById(R.id.tubi_radio_button)

// Set the text dynamically
radioButtonText.text = "720P"

// Listen for selection
radioButton.setOnCheckedChangeListener { _, isChecked ->
    if (isChecked) {
        // Apply quality setting logic
    }
}

Visual Diagram

flowchart LR
    A[LinearLayout: tubi_radio_button_root]
    A --> B[RadioButton: tubi_radio_button]
    A --> C[VaudTextView: tubi_radio_button_text]

    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#bbf,stroke:#333
    style C fill:#bbf,stroke:#333

**Diagram Explanation:**


Summary

`view_tubi_radio_button.xml` defines a reusable, horizontally arranged radio button component tailored to Tubi TV’s branding and UI standards. It combines a custom drawable radio button and a specialized text view inside a padded linear layout, facilitating clear, consistent user options such as video quality selections. Its simple yet effective structure integrates tightly with the app’s UI framework and resource system, supporting dynamic content and interaction handling via Android’s view binding and event listeners.