mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-24 05:04:50 -04:00
Added more comprehensive night mode #353
This commit is contained in:
parent
afde421c36
commit
47fbc4db7c
@ -40,7 +40,6 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".KiwixMobileActivity"
|
android:name=".KiwixMobileActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|screenSize|locale"
|
android:configChanges="orientation|keyboardHidden|screenSize|locale"
|
||||||
android:theme="@style/AppTheme.Main"
|
|
||||||
android:label="@string/app_name">
|
android:label="@string/app_name">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
@ -1,65 +1,73 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/bookmarks_activity_layout"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="fill_parent"
|
android:id="@+id/bookmarks_activity_layout"
|
||||||
android:layout_height="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:orientation="vertical"
|
android:layout_height="fill_parent"
|
||||||
android:background="@color/white">
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context=".BookmarksActivity">
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?actionBarSize"
|
android:layout_height="?actionBarSize"
|
||||||
android:background="?colorPrimaryDark"
|
android:background="?colorPrimaryDark"
|
||||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
|
app:theme="@style/AppTheme.AppBarOverlay" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<ListView
|
|
||||||
android:id="@+id/bookmarks_list"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
/>
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/bookmarks_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/listBackground"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/bookmarks_none_linlayout"
|
android:id="@+id/bookmarks_none_linlayout"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:gravity="center"
|
|
||||||
android:visibility="gone"
|
|
||||||
>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="100dp"
|
|
||||||
android:layout_height="100dp"
|
|
||||||
android:src="@drawable/ic_star_yellow"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
style="@android:style/TextAppearance.Large"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingBottom="15dp"
|
android:visibility="gone"
|
||||||
android:paddingLeft="10dp"
|
>
|
||||||
android:paddingRight="10dp"
|
|
||||||
android:paddingTop="15dp"
|
|
||||||
android:text="@string/no_bookmarks"
|
|
||||||
android:visibility="visible" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
<ImageView
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:src="@drawable/ic_star_yellow"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@android:style/TextAppearance.Large"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingBottom="15dp"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:paddingTop="15dp"
|
||||||
|
android:text="@string/no_bookmarks"
|
||||||
|
android:visibility="visible" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
@ -8,14 +8,16 @@
|
|||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/listBackground">
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/library_list"
|
android:id="@+id/library_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingBottom="60dp"
|
android:paddingBottom="60dp"
|
||||||
android:divider="@null"/>
|
android:divider="@null"
|
||||||
|
android:background="?attr/listBackground"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/network_permission_text"
|
android:id="@+id/network_permission_text"
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:background="?attr/listBackground">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/download_management_no_downloads"
|
android:id="@+id/download_management_no_downloads"
|
||||||
@ -20,6 +21,7 @@
|
|||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/zim_downloader_list"
|
android:id="@+id/zim_downloader_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/listBackground"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -7,6 +7,7 @@
|
|||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/language_check_view"
|
android:id="@+id/language_check_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/listBackground"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -1,21 +1,30 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layoutDirection="ltr">
|
android:orientation="vertical"
|
||||||
|
android:layoutDirection="ltr"
|
||||||
<include layout="@layout/toolbar"/>
|
android:fitsSystemWindows="true">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:background="?colorPrimaryDark"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||||
|
app:theme="@style/AppTheme.AppBarOverlay" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="?attr/listBackground"
|
||||||
android:id="@+id/search_list"/>
|
android:id="@+id/search_list"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
@ -1,19 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:fitsSystemWindows="true">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:fitsSystemWindows="true">
|
|
||||||
|
|
||||||
<include
|
<android.support.v7.widget.Toolbar
|
||||||
layout="@layout/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:id="@+id/toolbar_container"/>
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/content_frame"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="?actionBarSize"
|
||||||
android:layout_below="@+id/toolbar_container"
|
android:background="?colorPrimaryDark"
|
||||||
android:background="@color/white"/>
|
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||||
|
app:theme="@style/AppTheme.AppBarOverlay" />
|
||||||
|
|
||||||
</RelativeLayout>
|
<FrameLayout
|
||||||
|
android:id="@+id/content_frame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@+id/toolbar"
|
||||||
|
android:background="?attr/listBackground"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
@ -18,7 +18,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="3dp"
|
android:layout_height="3dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
app:backgroundColor="@color/primary_dark"
|
app:backgroundColor="?attr/progressBackgroundColor"
|
||||||
app:bidirectionalAnimate="false"
|
app:bidirectionalAnimate="false"
|
||||||
app:progressColor="@color/accent"/>
|
app:progressColor="@color/accent"/>
|
||||||
|
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:background="?attr/listBackground">
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -29,6 +30,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_below="@id/toolbar"
|
android:layout_below="@id/toolbar"
|
||||||
android:paddingBottom="60dp"
|
android:paddingBottom="60dp"
|
||||||
|
android:background="?attr/listBackground"
|
||||||
android:divider="@null">
|
android:divider="@null">
|
||||||
</ListView>
|
</ListView>
|
||||||
|
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<color name="primary">#000000</color>
|
<color name="primary">#000000</color>
|
||||||
|
<color name="primary_night">#283c64</color>
|
||||||
<color name="primary_dark">#000000</color>
|
<color name="primary_dark">#000000</color>
|
||||||
|
<color name="primary_dark_night">#283c64</color>
|
||||||
<color name="primary_light">#ffffff</color>
|
<color name="primary_light">#ffffff</color>
|
||||||
<color name="accent">#304e9a</color>
|
<color name="accent">#304e9a</color>
|
||||||
<color name="primary_text">#212121</color>
|
<color name="primary_text">#212121</color>
|
||||||
@ -11,12 +13,13 @@
|
|||||||
<color name="divider">#304e9a</color>
|
<color name="divider">#304e9a</color>
|
||||||
<color name="white">#FAFAFA</color>
|
<color name="white">#FAFAFA</color>
|
||||||
<color name="gray_list_bg">#0d000000</color>
|
<color name="gray_list_bg">#0d000000</color>
|
||||||
<color name="drawer_background">#ffffff</color>
|
<color name="drawer_background_day">#ffffff</color>
|
||||||
|
<color name="drawer_background_night">#5a5a5a</color>
|
||||||
<color name="selected_light">#0F000000</color>
|
<color name="selected_light">#0F000000</color>
|
||||||
<color name="divider_light">#2b3f6a</color>
|
<color name="divider_light">#2b3f6a</color>
|
||||||
<color name="greyed_out_selected">#BDBDBD</color>
|
<color name="greyed_out_selected">#BDBDBD</color>
|
||||||
<color name="black_regular_mat_design">#212121</color>
|
<color name="black_regular_mat_design">#212121</color>
|
||||||
<color name="grey">#808080</color>
|
<color name="grey">#5a5a5a</color>
|
||||||
<color name="blue_grey">#ECEFF1</color>
|
<color name="blue_grey">#ECEFF1</color>
|
||||||
<color name="foreground_material_dark">@android:color/white</color>
|
<color name="foreground_material_dark">@android:color/white</color>
|
||||||
</resources>
|
</resources>
|
@ -18,16 +18,23 @@
|
|||||||
<item name="windowActionModeOverlay">true</item>
|
<item name="windowActionModeOverlay">true</item>
|
||||||
<item name="arrowBackDrawable">@drawable/ic_action_back</item>
|
<item name="arrowBackDrawable">@drawable/ic_action_back</item>
|
||||||
<item name="arrowForwardDrawable">@drawable/ic_action_forward</item>
|
<item name="arrowForwardDrawable">@drawable/ic_action_forward</item>
|
||||||
<item name="drawerBackground">@color/drawer_background</item>
|
<item name="drawerBackground">@color/drawer_background_day</item>
|
||||||
<item name="plusDrawable">@drawable/ic_action_plus</item>
|
<item name="plusDrawable">@drawable/ic_action_plus</item>
|
||||||
<item name="deleteDrawable">@drawable/ic_action_delete</item>
|
<item name="deleteDrawable">@drawable/ic_action_delete</item>
|
||||||
<item name="dividerColor">@color/divider_light</item>
|
<item name="dividerColor">@color/divider_light</item>
|
||||||
<item name="selectedBackground">@drawable/list_bg_light</item>
|
<item name="selectedBackground">@drawable/list_bg_light</item>
|
||||||
<item name="android:itemBackground">@color/primary_light</item>
|
<item name="android:itemBackground">@color/primary_light</item>
|
||||||
|
<item name="android:windowTranslucentStatus" tools:targetApi="19">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.Main">
|
<style name="AppTheme.Night" parent="AppTheme.Base">
|
||||||
<item name="android:windowTranslucentStatus" tools:targetApi="19">true</item>
|
<item name="colorPrimary">@color/primary_night</item>
|
||||||
|
<item name="colorPrimaryDark">@color/primary_dark_night</item>
|
||||||
|
<item name="colorAccent">@color/accent</item>
|
||||||
|
<item name="progressBackgroundColor">@color/primary_dark_night</item>
|
||||||
|
<item name="drawerBackground">@color/drawer_background_night</item>
|
||||||
|
<item name="listBackground">@color/grey</item>
|
||||||
|
<item name="android:itemBackground">@color/grey</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.Launcher">
|
<style name="AppTheme.Launcher">
|
||||||
|
@ -21,8 +21,11 @@
|
|||||||
package org.kiwix.kiwixmobile;
|
package org.kiwix.kiwixmobile;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.support.design.widget.CoordinatorLayout;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
@ -54,16 +57,20 @@ public class BookmarksActivity extends AppCompatActivity
|
|||||||
private ArrayAdapter adapter;
|
private ArrayAdapter adapter;
|
||||||
private ArrayList<String> selected;
|
private ArrayList<String> selected;
|
||||||
private int numOfSelected;
|
private int numOfSelected;
|
||||||
private LinearLayout snackbarLayout;
|
private CoordinatorLayout snackbarLayout;
|
||||||
private LinearLayout noBookmarksLayout;
|
private LinearLayout noBookmarksLayout;
|
||||||
private BookmarksDao bookmarksDao;
|
private BookmarksDao bookmarksDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
if (sharedPreferences.getBoolean(KiwixMobileActivity.PREF_NIGHT_MODE, false)) {
|
||||||
|
setTheme(R.style.AppTheme_Night);
|
||||||
|
}
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_bookmarks);
|
setContentView(R.layout.activity_bookmarks);
|
||||||
setUpToolbar();
|
setUpToolbar();
|
||||||
snackbarLayout = (LinearLayout) findViewById(R.id.bookmarks_activity_layout);
|
snackbarLayout = (CoordinatorLayout) findViewById(R.id.bookmarks_activity_layout);
|
||||||
selected = new ArrayList<>();
|
selected = new ArrayList<>();
|
||||||
bookmarksList = (ListView) findViewById(R.id.bookmarks_list);
|
bookmarksList = (ListView) findViewById(R.id.bookmarks_list);
|
||||||
noBookmarksLayout = (LinearLayout) findViewById(R.id.bookmarks_none_linlayout);
|
noBookmarksLayout = (LinearLayout) findViewById(R.id.bookmarks_none_linlayout);
|
||||||
|
@ -125,7 +125,7 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
|||||||
|
|
||||||
private static final String TAG_CURRENT_TAB = "currenttab";
|
private static final String TAG_CURRENT_TAB = "currenttab";
|
||||||
|
|
||||||
private static final String PREF_NIGHT_MODE = "pref_nightmode";
|
public static final String PREF_NIGHT_MODE = "pref_nightmode";
|
||||||
|
|
||||||
private static final String PREF_KIWIX_MOBILE = "kiwix-mobile";
|
private static final String PREF_KIWIX_MOBILE = "kiwix-mobile";
|
||||||
|
|
||||||
@ -285,6 +285,11 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
nightMode = sharedPreferences.getBoolean(PREF_NIGHT_MODE, false);
|
||||||
|
if (nightMode) {
|
||||||
|
setTheme(R.style.AppTheme_Night);
|
||||||
|
}
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
handleLocaleCheck();
|
handleLocaleCheck();
|
||||||
setContentView(R.layout.main);
|
setContentView(R.layout.main);
|
||||||
@ -296,7 +301,6 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
|||||||
|
|
||||||
initPlayStoreUri();
|
initPlayStoreUri();
|
||||||
|
|
||||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
isHideToolbar = sharedPreferences.getBoolean(PREF_HIDE_TOOLBAR, false);
|
isHideToolbar = sharedPreferences.getBoolean(PREF_HIDE_TOOLBAR, false);
|
||||||
|
|
||||||
FileReader fileReader = new FileReader();
|
FileReader fileReader = new FileReader();
|
||||||
@ -1054,10 +1058,8 @@ public class KiwixMobileActivity extends AppCompatActivity implements WebViewCal
|
|||||||
selectTab(currentWebViewIndex);
|
selectTab(currentWebViewIndex);
|
||||||
}
|
}
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
for (KiwixWebView kiwixWebView : mWebViews) {
|
|
||||||
kiwixWebView.reload();
|
|
||||||
}
|
|
||||||
refresh = false;
|
refresh = false;
|
||||||
|
recreate();
|
||||||
}
|
}
|
||||||
if (menu != null) {
|
if (menu != null) {
|
||||||
refreshBookmarkSymbol(menu);
|
refreshBookmarkSymbol(menu);
|
||||||
|
@ -3,7 +3,9 @@ package org.kiwix.kiwixmobile;
|
|||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.speech.RecognizerIntent;
|
import android.speech.RecognizerIntent;
|
||||||
import android.support.v4.view.MenuItemCompat;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
@ -43,6 +45,10 @@ public class SearchActivity extends AppCompatActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
if (sharedPreferences.getBoolean(KiwixMobileActivity.PREF_NIGHT_MODE, false)) {
|
||||||
|
setTheme(R.style.AppTheme_Night);
|
||||||
|
}
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
View contentView = LayoutInflater.from(this).inflate(R.layout.search, null);
|
View contentView = LayoutInflater.from(this).inflate(R.layout.search, null);
|
||||||
setContentView(contentView);
|
setContentView(contentView);
|
||||||
|
@ -2,7 +2,9 @@ package org.kiwix.kiwixmobile;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.support.design.widget.TabLayout;
|
import android.support.design.widget.TabLayout;
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
@ -60,6 +62,10 @@ public class ZimManageActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
if (sharedPreferences.getBoolean(KiwixMobileActivity.PREF_NIGHT_MODE, false)) {
|
||||||
|
setTheme(R.style.AppTheme_Night);
|
||||||
|
}
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.zim_manager);
|
setContentView(R.layout.zim_manager);
|
||||||
|
|
||||||
|
@ -81,6 +81,10 @@ public class KiwixSettingsActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
if (sharedPreferences.getBoolean(KiwixMobileActivity.PREF_NIGHT_MODE, false)) {
|
||||||
|
setTheme(R.style.AppTheme_Night);
|
||||||
|
}
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.settings);
|
setContentView(R.layout.settings);
|
||||||
|
|
||||||
@ -252,6 +256,7 @@ public class KiwixSettingsActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
if (key.equals(PREF_NIGHTMODE)) {
|
if (key.equals(PREF_NIGHTMODE)) {
|
||||||
KiwixMobileActivity.refresh = true;
|
KiwixMobileActivity.refresh = true;
|
||||||
|
getActivity().recreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user