+ 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,
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,
li,
lt,
lv,
mk,
da,
km,
ml,
mn,
ms,
mt,
my,
nb,
ne,
nl,
nn,
oc,
or,
pl,
ps,
pt,
qu,
rm,
ro,
ru,
sa,
sh,
si,
sk,
sl,
sq,
su,
sv,
sw,
ta,
te,
th,
tl,
tr,
uk,
ur,
af,
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,
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,
sw,
kn,
en

View File

@ -21,10 +21,10 @@
android:defaultValue="false"
android:summary="@string/pref_nightmode_summary"/>
<CheckBoxPreference
android:key="pref_back_to_top"
android:key="pref_backtotop"
android:title="@string/pref_backtotop"
android:summary="@string/pref_backtotop_summary"
android:defaultValue="true"/>
android:defaultValue="value"/>
</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_BACK_TO_TOP = "pref_back_to_top";
private static final String PREF_BACK_TO_TOP = "pref_backtotop";
private static final String AUTOMATIC = "automatic";
@ -116,7 +116,7 @@ public class KiwixMobileFragment extends Fragment {
protected int requestWebReloadOnFinished;
private boolean isButtonEnabled;
private boolean isFullscreenButtonEnabled;
private SharedPreferences mySharedPreferences;
@ -139,7 +139,7 @@ public class KiwixMobileFragment extends Fragment {
requestWebReloadOnFinished = 0;
requestInitAllMenuItems = false;
nightMode = false;
isButtonEnabled = true;
isFullscreenButtonEnabled = true;
isFullscreenOpened = false;
}
@ -366,7 +366,7 @@ public class KiwixMobileFragment extends Fragment {
@Override
public void onPageChanged(int page, int maxPages) {
if (isButtonEnabled) {
if (isFullscreenButtonEnabled) {
if (webView.getScrollY() > 200) {
if (mBackToTopButton.getVisibility() == View.INVISIBLE) {
mBackToTopButton.setText(R.string.button_backtotop);
@ -634,7 +634,7 @@ public class KiwixMobileFragment extends Fragment {
String pref_zoom = mySharedPreferences.getString(PREF_ZOOM, AUTOMATIC);
Boolean pref_zoom_enabled = mySharedPreferences.getBoolean(PREF_ZOOM_ENABLED, 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)) {
setDefaultZoom();
@ -655,7 +655,7 @@ public class KiwixMobileFragment extends Fragment {
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setDisplayZoomControls(pref_zoom_enabled);
if (!isButtonEnabled) {
if (!isFullscreenButtonEnabled) {
mBackToTopButton.setVisibility(View.INVISIBLE);
}