Skip to content

Commit

Permalink
regression fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliskov committed Nov 8, 2020
1 parent ef3684c commit 11d244b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Fragment createFragment(Object rowObj) {
}

updateCurrentFragmentFromCache();
restoreItemIndex();
setCurrentFragmentItemIndex(mSelectedItemIndex);

return fragment;
}
Expand Down Expand Up @@ -141,6 +141,7 @@ public int getCurrentFragmentItemIndex() {
public void setCurrentFragmentItemIndex(int index) {
if (mCurrentFragment instanceof VideoCategoryFragment) {
((VideoCategoryFragment) mCurrentFragment).setItemIndex(index);
mSelectedItemIndex = -1;
} else {
mSelectedItemIndex = index;
}
Expand Down Expand Up @@ -171,9 +172,4 @@ private void clearFragment(Fragment fragment) {
Log.e(TAG, "clearFragment: Page group fragment has incompatible type: " + fragment.getClass().getSimpleName());
}
}

private void restoreItemIndex() {
setCurrentFragmentItemIndex(mSelectedItemIndex);
mSelectedItemIndex = -1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public void setItemIndex(int index) {

if (mRowsAdapter != null && index < mRowsAdapter.size()) {
setSelectedPosition(index);
mSelectedItemIndex = -1;
} else {
mSelectedItemIndex = index;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public void setItemIndex(int index) {

if (mGridAdapter != null && index < mGridAdapter.size()) {
setSelectedPosition(index);
mSelectedItemIndex = -1;
} else {
mSelectedItemIndex = index;
}
Expand Down

0 comments on commit 11d244b

Please sign in to comment.