2 Commits

Author SHA1 Message Date
StreamPlayer Bot
ab69fd1aa4 feat: Add persistent scrollbar to events list
- Enable fadeScrollbars=false in RecyclerView
- Improve visibility of scrollbar

fix: Prevent navigation focus escape at end of list

- Implement custom LinearLayoutManager to intercept focus search
- Block FOCUS_DOWN action at the last item
- Remove legacy OnKeyListener and OnScrollListener
2026-02-09 22:05:54 -03:00
Apple
907c97464b fix: v10.1.6 - control remoto DPAD_DOWN y barra scroll visible
Problemas corregidos:

1. Control Remoto - Navegación fuera de eventos
   - Problema: Botón abajo del control remoto iba a canales en último evento
   - Solución: Agregado setOnKeyListener interceptando KEYCODE_DPAD_DOWN
   - Combina scroll listener táctil + manejo de teclas de control remoto
   - Import agregado: android.view.KeyEvent

2. Barra de Scroll Más Visible
   - Thumb: Blanco sólido #FFFFFFFF (antes 80% opacidad)
   - Ancho: 12dp (antes 8dp)
   - Radio: 6dp (antes 4dp)
   - Track oscuro agregado: #1A1A1A
   - scrollbarAlwaysDrawVerticalTrack="true"

Archivos modificados:
- MainActivity.java (OnKeyListener + import KeyEvent)
- scrollbar_vertical.xml (blanco sólido, 12dp)
- activity_main.xml (scrollbarSize, track, alwaysDraw)
- colors.xml (scrollbar_track)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 21:53:23 -03:00
7 changed files with 91 additions and 25 deletions

42
CHANGELOG-v10.1.6.md Normal file
View File

@@ -0,0 +1,42 @@
# StreamPlayer v10.1.6 - Corrección de Control Remoto y Scrollbar
## Correcciones Implementadas
### 1. Control Remoto - Prevención de Navegación
- **Problema**: Al presionar el botón abajo del control remoto en el último evento, se iba a la sección de canales
- **Solución**: Agregado `setOnKeyListener` para interceptar teclas de navegación
- Ahora intercepta `KEYCODE_DPAD_DOWN` cuando está en el último elemento
- Combina scroll listener táctil + manejo de teclas del control remoto
### 2. Barra de Scroll Más Visible
- **Problema**: La barra de seguimiento no era visible
- **Solución**:
- Color del thumb: Blanco sólido (#FFFFFFFF) - antes 80%
- Ancho aumentado a 12dp (antes 8dp)
- Radio de esquinas: 6dp (antes 4dp)
- Track oscuro agregado (#1A1A1A)
- `scrollbarAlwaysDrawVerticalTrack="true"` para siempre visible
## Archivos Modificados
### MainActivity.java
- Import agregado: `android.view.KeyEvent`
- `setOnKeyListener` agregado en `showEvents()` para interceptar DPAD_DOWN
- Combina con scroll listener existente para cobertura completa
### scrollbar_vertical.xml
- Color cambiado a blanco sólido (#FFFFFFFF)
- Ancho: 12dp
- Radio: 6dp
### activity_main.xml
- `scrollbarSize="12dp"` (antes 8dp)
- `scrollbarTrackVertical="@color/scrollbar_track"` agregado
- `scrollbarAlwaysDrawVerticalTrack="true"` agregado
### colors.xml
- Nuevo color: `scrollbar_track` (#1A1A1A)
## Compatibilidad
- Android TV con control remoto
- Versión mínima: API 21+

22
CHANGELOG-v10.1.7.md Normal file
View File

@@ -0,0 +1,22 @@
# StreamPlayer v10.1.7 - Corrección de Navegación y Scrollbar Permanente
## Correcciones Implementadas
### 1. Barra de Desplazamiento Permanente
- **Feature**: Se agregó `android:fadeScrollbars="false"` al `RecyclerView` de eventos.
- **Beneficio**: La barra de desplazamiento ahora es visible permanentemente, permitiendo al usuario saber su posición (inicio, medio, final) en todo momento sin tener que interactuar primero.
### 2. Navegación al Final de la Lista (Bug Fix)
- **Problema**: Al presionar "abajo" en el último evento, el foco saltaba involuntariamente a la sección de canales.
- **Solución**: Se implementó un `LinearLayoutManager` personalizado que intercepta la búsqueda de foco (`onInterceptFocusSearch`).
- **Detalle**: Cuando se detecta `FOCUS_DOWN` en el último elemento de la lista, la acción se bloquea, manteniendo al usuario en la lista de eventos.
- **Limpieza**: Se eliminaron los `OnKeyListener` y `OnScrollListener` anteriores que eran menos efectivos.
## Archivos Modificados
### MainActivity.java
- Implementación de `LinearLayoutManager` anónimo con `onInterceptFocusSearch`.
- Eliminación de listeners redundantes.
### activity_main.xml
- `android:fadeScrollbars="false"` añadido a `content_list`.

View File

@@ -8,8 +8,8 @@ android {
applicationId "com.streamplayer" applicationId "com.streamplayer"
minSdk 21 minSdk 21
targetSdk 35 targetSdk 35
versionCode 100102 versionCode 100107
versionName "10.1.2" versionName "10.1.7"
buildConfigField "String", "DEVICE_REGISTRY_URL", '"http://194.163.191.200:4000"' buildConfigField "String", "DEVICE_REGISTRY_URL", '"http://194.163.191.200:4000"'
} }

View File

@@ -7,6 +7,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.ProgressBar; import android.widget.ProgressBar;
@@ -72,7 +73,18 @@ public class MainActivity extends AppCompatActivity {
eventAdapter = new EventAdapter(event -> openPlayer(event.getTitle(), event.getPageUrl())); eventAdapter = new EventAdapter(event -> openPlayer(event.getTitle(), event.getPageUrl()));
eventRepository = new EventRepository(); eventRepository = new EventRepository();
channelLayoutManager = new GridLayoutManager(this, getSpanCount()); channelLayoutManager = new GridLayoutManager(this, getSpanCount());
eventLayoutManager = new LinearLayoutManager(this); eventLayoutManager = new LinearLayoutManager(this) {
@Override
public View onInterceptFocusSearch(View focused, int direction) {
if (direction == View.FOCUS_DOWN) {
int pos = getPosition(focused);
if (pos == getItemCount() - 1) {
return focused;
}
}
return super.onInterceptFocusSearch(focused, direction);
}
};
sections = buildSections(); sections = buildSections();
sectionList.setLayoutManager(new LinearLayoutManager(this)); sectionList.setLayoutManager(new LinearLayoutManager(this));
@@ -188,25 +200,9 @@ public class MainActivity extends AppCompatActivity {
refreshButton.setVisibility(View.VISIBLE); refreshButton.setVisibility(View.VISIBLE);
contentList.setLayoutManager(eventLayoutManager); contentList.setLayoutManager(eventLayoutManager);
contentList.setAdapter(eventAdapter); contentList.setAdapter(eventAdapter);
// Add scroll listener to prevent scrolling from Events to Channels section // Clear existing listeners
contentList.clearOnScrollListeners(); contentList.clearOnScrollListeners();
contentList.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
// Only prevent downward scroll when at the last COMPLETELY VISIBLE item
if (dy > 0) { // Scrolling down
int totalItemCount = eventLayoutManager.getItemCount();
if (totalItemCount > 0) {
int lastCompletelyVisiblePosition = eventLayoutManager.findLastCompletelyVisibleItemPosition();
// Only stop scroll if we're at the last completely visible item
if (lastCompletelyVisiblePosition == totalItemCount - 1) {
recyclerView.stopScroll();
}
}
}
}
});
if (cachedEvents.isEmpty()) { if (cachedEvents.isEmpty()) {
loadEvents(false); loadEvents(false);
} else { } else {

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="#CCFFFFFF" /> <solid android:color="#FFFFFFFF" />
<corners android:radius="4dp" /> <corners android:radius="6dp" />
<size android:width="8dp" /> <size android:width="12dp" />
</shape> </shape>

View File

@@ -129,9 +129,12 @@
android:layout_weight="1" android:layout_weight="1"
android:overScrollMode="never" android:overScrollMode="never"
android:scrollbars="vertical" android:scrollbars="vertical"
android:fadeScrollbars="false"
android:scrollbarStyle="insideInset" android:scrollbarStyle="insideInset"
android:scrollbarThumbVertical="@drawable/scrollbar_vertical" android:scrollbarThumbVertical="@drawable/scrollbar_vertical"
android:scrollbarSize="8dp" android:scrollbarTrackVertical="@color/scrollbar_track"
android:scrollbarSize="12dp"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbarFadeDuration="0" android:scrollbarFadeDuration="0"
android:nextFocusLeft="@id/section_list" android:nextFocusLeft="@id/section_list"
tools:listitem="@layout/item_channel" /> tools:listitem="@layout/item_channel" />

View File

@@ -10,4 +10,7 @@
<color name="refresh_button_focused">#FFC107</color> <color name="refresh_button_focused">#FFC107</color>
<color name="refresh_button_focused_border">#FFD54F</color> <color name="refresh_button_focused_border">#FFD54F</color>
<color name="refresh_button_pressed">#FF9800</color> <color name="refresh_button_pressed">#FF9800</color>
<!-- Scrollbar -->
<color name="scrollbar_track">#1A1A1A</color>
</resources> </resources>