Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #1555 #3923

Open
wants to merge 5 commits into
base: release/4.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,22 +234,23 @@ 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();
}

if (fragments.size() != 0) {
if (fragmentManager == null) {
return;
}
if (fragmentManager != null
&& !fragments.isEmpty()
&& fragments.get(0).isAdded()
&& fragments.get(1).isAdded()) {

fragmentManager.executePendingTransactions();
fragmentManager.putFragment(outState, KEY_FRAGMENT_0, fragments.get(0));
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
Loading