mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-18 11:55:38 -04:00
+ fix buggy backtotop preference
This commit is contained in:
parent
dbe9fef654
commit
1b69cef65a
@ -364,7 +364,6 @@ public class KiwixMobileFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onPageChanged(int page, int maxPages) {
|
public void onPageChanged(int page, int maxPages) {
|
||||||
if (isButtonEnabled) {
|
if (isButtonEnabled) {
|
||||||
|
|
||||||
if (webView.getScrollY() > 200) {
|
if (webView.getScrollY() > 200) {
|
||||||
if (mBackToTopButton.getVisibility() == View.INVISIBLE) {
|
if (mBackToTopButton.getVisibility() == View.INVISIBLE) {
|
||||||
mBackToTopButton.setText(R.string.button_backtotop);
|
mBackToTopButton.setText(R.string.button_backtotop);
|
||||||
@ -619,7 +618,7 @@ public class KiwixMobileFragment extends Fragment {
|
|||||||
String pref_zoom = mySharedPreferences.getString(PREF_ZOOM, AUTOMATIC);
|
String pref_zoom = mySharedPreferences.getString(PREF_ZOOM, AUTOMATIC);
|
||||||
Boolean pref_zoom_enabled = mySharedPreferences.getBoolean(PREF_ZOOM_ENABLED, false);
|
Boolean pref_zoom_enabled = mySharedPreferences.getBoolean(PREF_ZOOM_ENABLED, false);
|
||||||
Boolean pref_nightmode = mySharedPreferences.getBoolean(PREF_NIGHTMODE, false);
|
Boolean pref_nightmode = mySharedPreferences.getBoolean(PREF_NIGHTMODE, false);
|
||||||
isButtonEnabled = mySharedPreferences.getBoolean("pref_top_button", isButtonEnabled);
|
isButtonEnabled = mySharedPreferences.getBoolean("pref_backtotop", isButtonEnabled);
|
||||||
|
|
||||||
if (pref_zoom.equals(AUTOMATIC)) {
|
if (pref_zoom.equals(AUTOMATIC)) {
|
||||||
setDefaultZoom();
|
setDefaultZoom();
|
||||||
@ -641,9 +640,7 @@ public class KiwixMobileFragment extends Fragment {
|
|||||||
webView.getSettings().setDisplayZoomControls(pref_zoom_enabled);
|
webView.getSettings().setDisplayZoomControls(pref_zoom_enabled);
|
||||||
|
|
||||||
if (!isButtonEnabled) {
|
if (!isButtonEnabled) {
|
||||||
if (mBackToTopButton.getVisibility() == View.VISIBLE) {
|
mBackToTopButton.setVisibility(View.INVISIBLE);
|
||||||
mBackToTopButton.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Night mode status
|
// Night mode status
|
||||||
|
Loading…
x
Reference in New Issue
Block a user