Android TV v9.0 Final - Enhanced Section-Based Layout

Android TV Enhancements:
- SectionAdapter.java: New section-based content organization
- Enhanced MainActivity with improved section management
- Optimized ChannelAdapter for better TV navigation
- Modernized activity_main.xml with section layout
- Professional color scheme for Android TV
- Updated strings for better TV experience

New UI Components:
- bg_section_indicator.xml: Visual section indicators
- item_section.xml: Section-based layout structure
- color/**: State-aware colors for TV focus states
- Enhanced focus management for D-pad navigation

Technical Improvements:
- Better memory management with section-based loading
- Improved RecyclerView performance
- Enhanced visual feedback for TV remote control
- Professional color palette optimized for TV screens
- Consistent design language throughout app

All v8.0 features maintained:
- Audio background fix (onStop() lifecycle)
- Real-time events with Argentina timezone
- Alphabetical channel sorting
- DNS bypass for global access
- Tab navigation (Channels/Events)
- Complete Android TV optimization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-15 03:25:52 +00:00
parent 5ade6350eb
commit d2d66a7906
9 changed files with 397 additions and 136 deletions

View File

@@ -7,111 +7,106 @@
android:background="@color/black"
tools:context=".MainActivity">
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:text="StreamPlayer"
android:textColor="@color/white"
android:textSize="22sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
<LinearLayout
android:id="@+id/nav_panel"
android:layout_width="180dp"
android:layout_height="0dp"
android:orientation="vertical"
android:paddingStart="16dp"
android:paddingTop="32dp"
android:paddingEnd="16dp"
android:paddingBottom="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/app_brand"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textAllCaps="true"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/app_tagline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/home_tagline"
android:textColor="@color/text_secondary"
android:textSize="12sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/section_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="24dp"
android:layout_weight="1"
android:overScrollMode="never"
tools:listitem="@layout/item_section" />
</LinearLayout>
<View
android:id="@+id/divider"
android:layout_width="1dp"
android:layout_height="0dp"
android:background="#33FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/nav_panel"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/tabs_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/title">
<Button
android:id="@+id/tab_channels"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="@drawable/bg_tab_selector"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Canales"
android:textAllCaps="false" />
<Button
android:id="@+id/tab_events"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/bg_tab_selector"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="Eventos"
android:textAllCaps="false" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/channel_grid"
android:id="@+id/content_panel"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="12dp"
android:clipToPadding="false"
android:paddingBottom="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tabs_container"
tools:listitem="@layout/item_channel" />
<LinearLayout
android:id="@+id/events_container"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="12dp"
android:orientation="vertical"
android:visibility="gone"
android:paddingStart="24dp"
android:paddingTop="32dp"
android:paddingEnd="24dp"
android:paddingBottom="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tabs_container">
app:layout_constraintStart_toEndOf="@id/divider"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/content_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
tools:text="Canales" />
<ProgressBar
android:id="@+id/events_progress"
android:id="@+id/loading_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="16dp"
android:visibility="gone" />
<TextView
android:id="@+id/events_error"
android:layout_width="wrap_content"
android:id="@+id/message_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="16dp"
android:textColor="@color/white"
android:textSize="16sp"
android:layout_marginTop="12dp"
android:textColor="@color/text_secondary"
android:textSize="14sp"
android:visibility="gone"
tools:text="No se pudieron cargar los eventos" />
tools:text="Mensaje" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/events_list"
android:id="@+id/content_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:layout_weight="1"
android:clipToPadding="false"
android:paddingBottom="12dp"
tools:listitem="@layout/item_event" />
android:overScrollMode="never"
android:nextFocusLeft="@id/section_list"
tools:listitem="@layout/item_channel" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>