Skip to content

Commit

Permalink
browse: restore selected item fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliskov committed Jan 30, 2025
1 parent 973ef93 commit de74ca7
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ public void onSectionFocused(int sectionId) {
saveSelectedItems(); // save previous state
mCurrentSection = findSectionById(sectionId);
mCurrentVideo = null; // fast scroll through the sections (fix empty selected item)
restoreSelectedItems();
updateCurrentSection();
}

Expand Down Expand Up @@ -658,6 +657,14 @@ private void updateVideoRows(BrowseSection section, Observable<List<MediaGroup>>
firstGroup.setAction(VideoGroup.ACTION_REPLACE);
getView().updateSection(firstGroup);

if (groups == null) {
// No group. Maybe just clear.
getView().showProgressBar(false);
return;
}

restoreSelectedItems(); // Don't place anywhere else

Disposable updateAction = groups
.subscribe(
mediaGroups -> {
Expand Down Expand Up @@ -710,7 +717,7 @@ private void updateVideoGrid(BrowseSection section, Observable<MediaGroup> group
return;
}

//restoreSelectedItems();
restoreSelectedItems(); // Don't place anywhere else

Disposable updateAction = group
.subscribe(
Expand Down

0 comments on commit de74ca7

Please sign in to comment.