+ fix a few things related to the fullscreen/backtotop buttons

This commit is contained in:
kelson42 2013-12-16 21:24:26 +01:00
parent 555ce47938
commit 3e751bcda9
3 changed files with 83 additions and 83 deletions

View File

@ -1,85 +1,85 @@
af, si,
tl,
ar, ar,
as,
ba,
be,
bg,
bm,
bn,
br,
ca,
cs,
cv,
cy,
da,
de,
el,
eo,
es,
et,
fa,
fi,
fo,
fr,
gl,
gu,
he,
hi,
hr,
hu,
ia,
id,
ie,
it,
ja,
jv,
ka,
km,
kn,
ko,
ky,
lb, lb,
li, da,
lt, km,
lv,
mk,
ml, ml,
mn,
ms,
mt,
my,
nb,
ne,
nl,
nn,
oc,
or,
pl,
ps,
pt,
qu,
rm,
ro,
ru, ru,
sa, sa,
sh, af,
si,
sk,
sl,
sq,
su,
sv,
sw,
ta,
te,
th,
tl,
tr,
uk,
ur,
uz, uz,
ms,
mt,
fo,
nn,
ps,
hu,
fa,
el,
lt,
ba,
th,
id,
su,
it,
eo,
ur,
oc,
be,
nl,
bm,
cs,
he,
or,
fi,
sv,
uk,
mk,
yo,
bg,
hr,
vi, vi,
yi, yi,
yo, sl,
ta,
de,
gu,
pl,
cv,
jv,
et,
ro,
qu,
pt,
ca,
ja,
ia,
tr,
sq,
te,
bn,
ko,
ie,
lv,
hi,
my,
sk,
ky,
sh,
mn,
nb,
cy,
es,
li,
ne,
as,
ka,
rm,
br,
gl,
fr,
zh, zh,
sw,
kn,
en en

View File

@ -21,10 +21,10 @@
android:defaultValue="false" android:defaultValue="false"
android:summary="@string/pref_nightmode_summary"/> android:summary="@string/pref_nightmode_summary"/>
<CheckBoxPreference <CheckBoxPreference
android:key="pref_back_to_top" android:key="pref_backtotop"
android:title="@string/pref_backtotop" android:title="@string/pref_backtotop"
android:summary="@string/pref_backtotop_summary" android:summary="@string/pref_backtotop_summary"
android:defaultValue="true"/> android:defaultValue="value"/>
</PreferenceCategory> </PreferenceCategory>

View File

@ -82,7 +82,7 @@ public class KiwixMobileFragment extends Fragment {
private static final String PREF_KIWIX_MOBILE = "kiwix-mobile"; private static final String PREF_KIWIX_MOBILE = "kiwix-mobile";
private static final String PREF_BACK_TO_TOP = "pref_back_to_top"; private static final String PREF_BACK_TO_TOP = "pref_backtotop";
private static final String AUTOMATIC = "automatic"; private static final String AUTOMATIC = "automatic";
@ -116,7 +116,7 @@ public class KiwixMobileFragment extends Fragment {
protected int requestWebReloadOnFinished; protected int requestWebReloadOnFinished;
private boolean isButtonEnabled; private boolean isFullscreenButtonEnabled;
private SharedPreferences mySharedPreferences; private SharedPreferences mySharedPreferences;
@ -139,7 +139,7 @@ public class KiwixMobileFragment extends Fragment {
requestWebReloadOnFinished = 0; requestWebReloadOnFinished = 0;
requestInitAllMenuItems = false; requestInitAllMenuItems = false;
nightMode = false; nightMode = false;
isButtonEnabled = true; isFullscreenButtonEnabled = true;
isFullscreenOpened = false; isFullscreenOpened = false;
} }
@ -366,7 +366,7 @@ public class KiwixMobileFragment extends Fragment {
@Override @Override
public void onPageChanged(int page, int maxPages) { public void onPageChanged(int page, int maxPages) {
if (isButtonEnabled) { if (isFullscreenButtonEnabled) {
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);
@ -634,7 +634,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_BACK_TO_TOP, isButtonEnabled); isFullscreenButtonEnabled = mySharedPreferences.getBoolean(PREF_BACK_TO_TOP, isFullscreenButtonEnabled);
if (pref_zoom.equals(AUTOMATIC)) { if (pref_zoom.equals(AUTOMATIC)) {
setDefaultZoom(); setDefaultZoom();
@ -655,7 +655,7 @@ public class KiwixMobileFragment extends Fragment {
webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setDisplayZoomControls(pref_zoom_enabled); webView.getSettings().setDisplayZoomControls(pref_zoom_enabled);
if (!isButtonEnabled) { if (!isFullscreenButtonEnabled) {
mBackToTopButton.setVisibility(View.INVISIBLE); mBackToTopButton.setVisibility(View.INVISIBLE);
} }