Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Commit a4960e9

Browse files
committed
new version
1 parent 87732c4 commit a4960e9

11 files changed

Lines changed: 37 additions & 28 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66
applicationId "cc.zsakvo.yueduhchelper"
77
minSdkVersion 21
88
targetSdkVersion 28
9-
versionCode 4
10-
versionName "1.1.0207"
9+
versionCode 5
10+
versionName "1.1.0209"
1111
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1212
}
1313
buildTypes {

app/src/main/java/cc/zsakvo/yueduhchelper/CacheHelperActivity.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,14 @@ protected void onCreate(Bundle savedInstanceState) {
7474
setContentView(R.layout.activity_cache_helper);
7575

7676
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
77-
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
78-
StatusbarUtil.setStatusBarColor(CacheHelperActivity.this,R.color.grey);
77+
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
78+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
79+
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
80+
}
81+
StatusbarUtil.setStatusBarColor(CacheHelperActivity.this,R.color.white);
7982
}
8083

84+
8185
toolbar = findViewById(R.id.cache_toolbar);
8286
toolbar.setTitle("阅读缓存提取");
8387
toolbar.setTitleTextColor(getResources().getColor(R.color.colorAccent));
@@ -160,6 +164,7 @@ private void requestPermission() {
160164
.onGranted(permissions -> {
161165

162166
WhatsNew whatsNew = WhatsNew.newInstance(
167+
new WhatsNewItem("修正", "修正状态栏颜色,使界面更统一"),
163168
new WhatsNewItem("精确来源", "可精确显示缓存来源"),
164169
new WhatsNewItem("导出源切换", "如果某本书从多个网站进行缓存,在导出时支持自选导出来源(在TXT导出界面点击书名位置的蓝色字体)"),
165170
new WhatsNewItem("bug fix", "修正某些逻辑问题"));

app/src/main/java/cc/zsakvo/yueduhchelper/ExportActivity.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,11 @@ protected void onCreate(Bundle savedInstanceState) {
6262
setContentView(R.layout.activity_export);
6363

6464
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
65-
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
66-
StatusbarUtil.setStatusBarColor(ExportActivity.this,R.color.grey);
65+
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
66+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
67+
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
68+
}
69+
StatusbarUtil.setStatusBarColor(ExportActivity.this,R.color.white);
6770
}
6871

6972
toolbar = findViewById(R.id.export_toolbar);

app/src/main/java/cc/zsakvo/yueduhchelper/SettingsActivity.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ protected void onCreate(Bundle savedInstanceState) {
3535
setContentView(R.layout.activity_settings);
3636

3737
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
38-
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
39-
StatusbarUtil.setStatusBarColor(SettingsActivity.this,R.color.grey);
38+
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
39+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
40+
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
41+
}
42+
StatusbarUtil.setStatusBarColor(SettingsActivity.this,R.color.white);
4043
}
4144

4245
toolbar = findViewById(R.id.toolbar);

app/src/main/java/cc/zsakvo/yueduhchelper/utils/StatusbarUtil.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public static void transparencyBar(Activity activity){
3030
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
3131
window.setStatusBarColor(Color.TRANSPARENT);
3232

33-
} else
34-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
33+
} else {
3534
Window window =activity.getWindow();
3635
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
3736
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
@@ -67,15 +66,13 @@ public static void setStatusBarColor(Activity activity,int colorId) {
6766
*/
6867
public static int StatusBarLightMode(Activity activity){
6968
int result=0;
70-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
71-
if(MIUISetStatusBarLightMode(activity, true)){
72-
result=1;
73-
}else if(FlymeSetStatusBarLightMode(activity.getWindow(), true)){
74-
result=2;
75-
}else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
76-
activity.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
77-
result=3;
78-
}
69+
if(MIUISetStatusBarLightMode(activity, true)){
70+
result=1;
71+
}else if(FlymeSetStatusBarLightMode(activity.getWindow(), true)){
72+
result=2;
73+
}else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
74+
activity.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
75+
result=3;
7976
}
8077
return result;
8178
}
@@ -182,7 +179,7 @@ public static boolean MIUISetStatusBarLightMode(Activity activity, boolean dark)
182179
}
183180
}
184181
}catch (Exception e){
185-
182+
e.printStackTrace();
186183
}
187184
}
188185
return result;

app/src/main/res/layout/activity_cache_helper.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
6-
xmlns:app="http://schemas.android.com/apk/res-auto"
76
android:fitsSystemWindows="true"
87
android:clipToPadding="true"
9-
android:orientation="vertical">
8+
android:orientation="vertical"
9+
android:background="@color/white">
1010

1111
<androidx.appcompat.widget.Toolbar
1212
android:id="@+id/cache_toolbar"

app/src/main/res/layout/activity_export.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:layout_width="match_parent"
44
android:layout_height="match_parent"
5-
xmlns:app="http://schemas.android.com/apk/res-auto"
6-
android:orientation="vertical">
5+
android:orientation="vertical"
6+
android:background="@color/white">
77

88
<androidx.appcompat.widget.Toolbar
99
android:id="@+id/export_toolbar"

app/src/main/res/layout/activity_settings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
xmlns:app="http://schemas.android.com/apk/res-auto"
77
android:fitsSystemWindows="true"
88
android:clipToPadding="true"
9-
android:orientation="vertical">
9+
android:orientation="vertical"
10+
android:background="@color/white">
1011

1112
<androidx.appcompat.widget.Toolbar
1213
android:id="@+id/toolbar"

app/src/main/res/values-v23/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<style name="AppTheme.PreferenceTheme" parent="PreferenceThemeOverlay">
55
<!-- Only need this on pre-Lollipop -->
6-
<item name="colorPrimaryDark">@color/grey</item>
6+
<item name="colorPrimaryDark">@color/white</item>
77
<item name="colorAccent">@color/colorAccent</item>
88
<item name="preferenceTheme">@style/AppTheme.PreferenceTheme</item>
99
<item name="android:windowLightStatusBar">true</item>

app/src/main/res/values-v27/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<item name="android:navigationBarDividerColor">#ff545454</item>
99
</style>
1010
<style name="Base.V27.Theme.AppCompat.Light" parent="@style/Base.V26.Theme.AppCompat.Light">
11-
<item name="android:navigationBarColor">@color/grey</item>
11+
<item name="android:navigationBarColor">@android:color/white</item>
1212
<item name="android:windowLightNavigationBar">true</item>
1313
<item name="android:navigationBarDividerColor">#ffdcdcdc</item>
1414
</style>

0 commit comments

Comments
 (0)