mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
night mode removed from menu and placed in settings
This commit is contained in:
parent
03aa6d948e
commit
3c9697b566
@ -60,8 +60,6 @@
|
||||
|
||||
android:orderInCategory="0"
|
||||
android:showAsAction="never" />
|
||||
|
||||
<item android:id="@+id/menu_togglenightmode" android:title="@string/menu_togglenightmode" android:orderInCategory="0" android:showAsAction="never"></item>
|
||||
<item android:id="@+id/menu_help"
|
||||
android:title="@string/menu_help"
|
||||
android:icon="@drawable/action_help"
|
||||
|
@ -29,7 +29,8 @@
|
||||
<item>Large</item>
|
||||
</string-array>
|
||||
<string name="menu_exit">Exit</string>
|
||||
<string name="menu_togglenightmode">Toggle night mode</string>
|
||||
<string name="pref_zoom_enable">Enable Zoom</string>
|
||||
<string name="pref_zoom_enable_summary">Enable or disable the zoom controls</string>
|
||||
<string name="pref_nightmode">Enabled night mode</string>
|
||||
<string name="pref_nightmode_summary">Enable or disable the night mode</string>
|
||||
</resources>
|
||||
|
@ -12,6 +12,7 @@
|
||||
android:entryValues="@array/pref_zoom_entryvalues"
|
||||
android:defaultValue="automatic" />
|
||||
<CheckBoxPreference android:key="pref_zoom_enabled" android:title="@string/pref_zoom_enable" android:summary="@string/pref_zoom_enable_summary" android:defaultValue="false"/>
|
||||
<CheckBoxPreference android:key="pref_nightmode" android:title="@string/pref_nightmode" android:defaultValue="false" android:summary="@string/pref_nightmode_summary"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
<!-- PreferenceCategory
|
||||
|
@ -223,8 +223,8 @@ public class KiwixMobileActivity extends Activity {
|
||||
requestClearHistoryAfterLoad=false;
|
||||
}
|
||||
|
||||
|
||||
if(NightMode){
|
||||
Log.d("kiwix", "Loaded URL: "+webView.getUrl());
|
||||
if(NightMode){
|
||||
NightMode=false;
|
||||
ToggleNightMode();
|
||||
}
|
||||
@ -344,6 +344,7 @@ public class KiwixMobileActivity extends Activity {
|
||||
SharedPreferences mySharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
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);
|
||||
|
||||
if (pref_zoom.equals("automatic")) {
|
||||
setDefaultZoom();
|
||||
@ -361,6 +362,12 @@ public class KiwixMobileActivity extends Activity {
|
||||
//Pinch to zoom
|
||||
Log.d("kiwix","pref_zoom_enabled value ("+pref_zoom_enabled+")");
|
||||
webView.getSettings().setBuiltInZoomControls(pref_zoom_enabled);
|
||||
|
||||
//Night mode status
|
||||
Log.d("kiwix","pref_nightmode value ("+pref_nightmode+")");
|
||||
if(NightMode!=pref_nightmode)
|
||||
ToggleNightMode();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -453,10 +460,6 @@ public class KiwixMobileActivity extends Activity {
|
||||
Intent i = new Intent(this, KiwixSettings.class);
|
||||
startActivityForResult(i, PREFERENCES_REQUEST_CODE);
|
||||
break;
|
||||
|
||||
case R.id.menu_togglenightmode:
|
||||
ToggleNightMode();
|
||||
break;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
Loading…
x
Reference in New Issue
Block a user