Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab69fd1aa4 |
22
CHANGELOG-v10.1.7.md
Normal file
22
CHANGELOG-v10.1.7.md
Normal 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`.
|
||||||
@@ -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"'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,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));
|
||||||
@@ -192,41 +203,6 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
// Clear existing listeners
|
// Clear existing listeners
|
||||||
contentList.clearOnScrollListeners();
|
contentList.clearOnScrollListeners();
|
||||||
|
|
||||||
// Prevent navigation out of events section via remote control
|
|
||||||
contentList.setOnKeyListener((v, keyCode, event) -> {
|
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
|
||||||
if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
|
|
||||||
int totalItemCount = eventLayoutManager.getItemCount();
|
|
||||||
if (totalItemCount > 0) {
|
|
||||||
int lastVisiblePosition = eventLayoutManager.findLastVisibleItemPosition();
|
|
||||||
// Prevent going down if we're at or near the last item
|
|
||||||
if (lastVisiblePosition >= totalItemCount - 1) {
|
|
||||||
// Consume the event to prevent navigation
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Also prevent scroll-based navigation
|
|
||||||
contentList.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
|
||||||
@Override
|
|
||||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
|
||||||
super.onScrolled(recyclerView, dx, dy);
|
|
||||||
if (dy > 0) { // Scrolling down
|
|
||||||
int totalItemCount = eventLayoutManager.getItemCount();
|
|
||||||
if (totalItemCount > 0) {
|
|
||||||
int lastCompletelyVisiblePosition = eventLayoutManager.findLastCompletelyVisibleItemPosition();
|
|
||||||
if (lastCompletelyVisiblePosition == totalItemCount - 1) {
|
|
||||||
recyclerView.stopScroll();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (cachedEvents.isEmpty()) {
|
if (cachedEvents.isEmpty()) {
|
||||||
loadEvents(false);
|
loadEvents(false);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -129,6 +129,7 @@
|
|||||||
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:scrollbarTrackVertical="@color/scrollbar_track"
|
android:scrollbarTrackVertical="@color/scrollbar_track"
|
||||||
|
|||||||
Reference in New Issue
Block a user