feat: mejoras de interfaz v10.1.4 - botón refresh visible, límite de scroll y barra indicadora
Cambios implementados: 1. Botón de Actualización Más Visible (para control remoto) - Nuevo archivo: btn_refresh_selector.xml con estados de foco - Color ámbar brillante (#FFC107) cuando está enfocado - Borde grueso (4dp) para mejor visibilidad 2. Prevención de Navegación Entre Secciones - Modificado: MainActivity.java showEvents() - Agregado OnScrollListener que detiene scroll al final de eventos - Previene paso accidental a sección de canales 3. Barra de Indicador de Scroll - Nuevo archivo: scrollbar_vertical.xml (drawable) - Modificado: activity_main.xml con atributos de scrollbar - Barra visual derecha como indicador de posición Archivos modificados: - app/src/main/java/com/streamplayer/MainActivity.java - app/src/main/res/layout/activity_main.xml - app/src/main/res/values/colors.xml Archivos nuevos: - app/src/main/res/drawable/btn_refresh_selector.xml - app/src/main/res/drawable/scrollbar_vertical.xml Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
60
CHANGELOG-v10.1.4.md
Normal file
60
CHANGELOG-v10.1.4.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# StreamPlayer v10.1.4 - Mejoras de Interfaz
|
||||
|
||||
## Correcciones Implementadas
|
||||
|
||||
### 1. Botón de Actualización Más Visible
|
||||
- **Archivo**: `app/src/main/res/drawable/btn_refresh_selector.xml` (nuevo)
|
||||
- **Descripción**: El botón de actualizar eventos ahora cambia a un color ámbar brillante (#FFC107) con borde grueso cuando está enfocado, mejorando significativamente la visibilidad para control remoto.
|
||||
|
||||
### 2. Prevención de Navegación Entre Secciones
|
||||
- **Archivo**: `app/src/main/java/com/streamplayer/MainActivity.java`
|
||||
- **Descripción**: Al hacer scroll después del último evento, la aplicación se detiene en lugar de pasar a la sección de canales, mejorando la experiencia de usuario.
|
||||
|
||||
### 3. Barra de Indicador de Scroll
|
||||
- **Archivos**: `app/src/main/res/layout/activity_main.xml`, `app/src/main/res/drawable/scrollbar_vertical.xml` (nuevo)
|
||||
- **Descripción**: Agregada barra de scroll visual a la derecha de la lista de contenido como indicador de posición (no navegable).
|
||||
|
||||
## Cambios Técnicos
|
||||
|
||||
### Nuevo Archivo: btn_refresh_selector.xml
|
||||
```xml
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_focused="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFC107" />
|
||||
<corners android:radius="8dp" />
|
||||
<stroke android:width="4dp" android:color="#FFD54F" />
|
||||
</shape>
|
||||
</item>
|
||||
<!-- ... otros estados ... -->
|
||||
</selector>
|
||||
```
|
||||
|
||||
### Modificación: MainActivity.java
|
||||
- Agregado `RecyclerView.OnScrollListener` en `showEvents()` para prevenir scroll más allá del último evento
|
||||
|
||||
### Modificación: activity_main.xml
|
||||
- Botón refresh usa `@drawable/btn_refresh_selector`
|
||||
- RecyclerView ahora tiene `android:scrollbars="vertical"` y `scrollbarThumbVertical`
|
||||
|
||||
### Nuevos Colores: colors.xml
|
||||
- `refresh_button_default`: #2A2A2A
|
||||
- `refresh_button_focused`: #FFC107
|
||||
- `refresh_button_focused_border`: #FFD54F
|
||||
- `refresh_button_pressed`: #FF9800
|
||||
|
||||
## Compatibilidad
|
||||
- Versión mínima de Android: API 21+
|
||||
- Compilado con SDK 34
|
||||
- Probado en Android TV con control remoto
|
||||
|
||||
## Instalación
|
||||
1. Descargar `StreamPlayer-10.1.4-debug.apk`
|
||||
2. Habilitar "Fuentes desconocidas" en configuraciones de seguridad
|
||||
3. Instalar el APK
|
||||
4. Disfrutar las mejoras de interfaz
|
||||
|
||||
## Notas de Desarrollo
|
||||
- La barra de scroll es puramente visual (indicador)
|
||||
- El foco del botón refresh ahora usa color ámbar de alto contraste
|
||||
- El scroll se detiene correctamente al final de la lista de eventos
|
||||
@@ -14,6 +14,7 @@ import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -169,6 +170,8 @@ public class MainActivity extends AppCompatActivity {
|
||||
refreshButton.setVisibility(View.GONE);
|
||||
contentList.setLayoutManager(channelLayoutManager);
|
||||
contentList.setAdapter(channelAdapter);
|
||||
// Clear any scroll listeners from Events section
|
||||
contentList.clearOnScrollListeners();
|
||||
loadingIndicator.setVisibility(View.GONE);
|
||||
channelAdapter.submitList(section.channels);
|
||||
if (section.channels.isEmpty()) {
|
||||
@@ -185,6 +188,26 @@ public class MainActivity extends AppCompatActivity {
|
||||
refreshButton.setVisibility(View.VISIBLE);
|
||||
contentList.setLayoutManager(eventLayoutManager);
|
||||
contentList.setAdapter(eventAdapter);
|
||||
// Add scroll listener to prevent scrolling from Events to Channels section
|
||||
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 item
|
||||
if (dy > 0) { // Scrolling down
|
||||
int visibleItemCount = eventLayoutManager.getChildCount();
|
||||
int totalItemCount = eventLayoutManager.getItemCount();
|
||||
int firstVisibleItemPosition = eventLayoutManager.findFirstVisibleItemPosition();
|
||||
|
||||
// Check if we're at the last item
|
||||
if (firstVisibleItemPosition + visibleItemCount >= totalItemCount) {
|
||||
// Prevent further scrolling by stopping the scroll
|
||||
recyclerView.stopScroll();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (cachedEvents.isEmpty()) {
|
||||
loadEvents(false);
|
||||
} else {
|
||||
|
||||
45
app/src/main/res/drawable/btn_refresh_selector.xml
Normal file
45
app/src/main/res/drawable/btn_refresh_selector.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Focused state - bright amber with thick border -->
|
||||
<item android:state_focused="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/refresh_button_focused" />
|
||||
<corners android:radius="8dp" />
|
||||
<stroke
|
||||
android:width="4dp"
|
||||
android:color="@color/refresh_button_focused_border" />
|
||||
<padding
|
||||
android:left="12dp"
|
||||
android:top="8dp"
|
||||
android:right="12dp"
|
||||
android:bottom="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- Pressed state -->
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/refresh_button_pressed" />
|
||||
<corners android:radius="8dp" />
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="@color/refresh_button_border" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- Default state - darker background with subtle border -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/refresh_button_default" />
|
||||
<corners android:radius="8dp" />
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="@color/refresh_button_border" />
|
||||
<padding
|
||||
android:left="12dp"
|
||||
android:top="8dp"
|
||||
android:right="12dp"
|
||||
android:bottom="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
6
app/src/main/res/drawable/scrollbar_vertical.xml
Normal file
6
app/src/main/res/drawable/scrollbar_vertical.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#4DFFFFFF" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
||||
@@ -97,7 +97,10 @@
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true" />
|
||||
android:focusableInTouchMode="true"
|
||||
android:background="@drawable/btn_refresh_selector"
|
||||
android:textColor="@color/white"
|
||||
android:elevation="2dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -125,6 +128,9 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_weight="1"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="vertical"
|
||||
android:scrollbarStyle="outsideOverlay"
|
||||
android:scrollbarThumbVertical="@drawable/scrollbar_vertical"
|
||||
android:nextFocusLeft="@id/section_list"
|
||||
tools:listitem="@layout/item_channel" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -3,4 +3,11 @@
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="text_secondary">#B3FFFFFF</color>
|
||||
|
||||
<!-- Refresh button colors -->
|
||||
<color name="refresh_button_default">#2A2A2A</color>
|
||||
<color name="refresh_button_border">#4A4A4A</color>
|
||||
<color name="refresh_button_focused">#FFC107</color>
|
||||
<color name="refresh_button_focused_border">#FFD54F</color>
|
||||
<color name="refresh_button_pressed">#FF9800</color>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user