Skip to content

Commit

Permalink
fixes #1555
Browse files Browse the repository at this point in the history
Signed-off-by: VishnuSanal <[email protected]>
  • Loading branch information
VishnuSanal committed Jun 27, 2023
1 parent f23605a commit 232b318
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ public void updatePaths(int pos) {

@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);

if (sharedPrefs != null) {
sharedPrefs.edit().putInt(PREFERENCE_CURRENT_TAB, MainActivity.currentTab).apply();
Expand All @@ -249,6 +248,7 @@ public void onSaveInstanceState(@NonNull Bundle outState) {
fragmentManager.putFragment(outState, KEY_FRAGMENT_1, fragments.get(1));
outState.putInt(KEY_POSITION, viewPager.getCurrentItem());
}
super.onSaveInstanceState(outState);
}

public void setPagingEnabled(boolean isPaging) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ public FastScroller(@NonNull Context context, AttributeSet attributeSet, int i)
}

private float computeHandlePosition() {
if (recyclerView == null) return -1;
View firstVisibleView = recyclerView.getChildAt(0);
if (firstVisibleView == null) return -1;
handle.setVisibility(VISIBLE);
float recyclerViewOversize; // how much is recyclerView bigger than fastScroller
int recyclerViewAbsoluteScroll;
if (firstVisibleView == null || recyclerView == null) return -1;
recyclerViewOversize =
firstVisibleView.getHeight() / columns * recyclerView.getAdapter().getItemCount()
- getHeightMinusPadding();
Expand Down

0 comments on commit 232b318

Please sign in to comment.