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

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
zsakvo committed Feb 9, 2019
1 parent 87732c4 commit a4960e9
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 28 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "cc.zsakvo.yueduhchelper"
minSdkVersion 21
targetSdkVersion 28
versionCode 4
versionName "1.1.0207"
versionCode 5
versionName "1.1.0209"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,14 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_cache_helper);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
StatusbarUtil.setStatusBarColor(CacheHelperActivity.this,R.color.grey);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
StatusbarUtil.setStatusBarColor(CacheHelperActivity.this,R.color.white);
}


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

WhatsNew whatsNew = WhatsNew.newInstance(
new WhatsNewItem("修正", "修正状态栏颜色,使界面更统一"),
new WhatsNewItem("精确来源", "可精确显示缓存来源"),
new WhatsNewItem("导出源切换", "如果某本书从多个网站进行缓存,在导出时支持自选导出来源(在TXT导出界面点击书名位置的蓝色字体)"),
new WhatsNewItem("bug fix", "修正某些逻辑问题"));
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/java/cc/zsakvo/yueduhchelper/ExportActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_export);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
StatusbarUtil.setStatusBarColor(ExportActivity.this,R.color.grey);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
StatusbarUtil.setStatusBarColor(ExportActivity.this,R.color.white);
}

toolbar = findViewById(R.id.export_toolbar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_settings);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
StatusbarUtil.setStatusBarColor(SettingsActivity.this,R.color.grey);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
StatusbarUtil.setStatusBarColor(SettingsActivity.this,R.color.white);
}

toolbar = findViewById(R.id.toolbar);
Expand Down
21 changes: 9 additions & 12 deletions app/src/main/java/cc/zsakvo/yueduhchelper/utils/StatusbarUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public static void transparencyBar(Activity activity){
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);

} else
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
} else {
Window window =activity.getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
Expand Down Expand Up @@ -67,15 +66,13 @@ public static void setStatusBarColor(Activity activity,int colorId) {
*/
public static int StatusBarLightMode(Activity activity){
int result=0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if(MIUISetStatusBarLightMode(activity, true)){
result=1;
}else if(FlymeSetStatusBarLightMode(activity.getWindow(), true)){
result=2;
}else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
activity.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
result=3;
}
if(MIUISetStatusBarLightMode(activity, true)){
result=1;
}else if(FlymeSetStatusBarLightMode(activity.getWindow(), true)){
result=2;
}else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
activity.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
result=3;
}
return result;
}
Expand Down Expand Up @@ -182,7 +179,7 @@ public static boolean MIUISetStatusBarLightMode(Activity activity, boolean dark)
}
}
}catch (Exception e){

e.printStackTrace();
}
}
return result;
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_cache_helper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true"
android:clipToPadding="true"
android:orientation="vertical">
android:orientation="vertical"
android:background="@color/white">

<androidx.appcompat.widget.Toolbar
android:id="@+id/cache_toolbar"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_export.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<RelativeLayout 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:orientation="vertical">
android:orientation="vertical"
android:background="@color/white">

<androidx.appcompat.widget.Toolbar
android:id="@+id/export_toolbar"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true"
android:clipToPadding="true"
android:orientation="vertical">
android:orientation="vertical"
android:background="@color/white">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-v23/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<style name="AppTheme.PreferenceTheme" parent="PreferenceThemeOverlay">
<!-- Only need this on pre-Lollipop -->
<item name="colorPrimaryDark">@color/grey</item>
<item name="colorPrimaryDark">@color/white</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="preferenceTheme">@style/AppTheme.PreferenceTheme</item>
<item name="android:windowLightStatusBar">true</item>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-v27/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<item name="android:navigationBarDividerColor">#ff545454</item>
</style>
<style name="Base.V27.Theme.AppCompat.Light" parent="@style/Base.V26.Theme.AppCompat.Light">
<item name="android:navigationBarColor">@color/grey</item>
<item name="android:navigationBarColor">@android:color/white</item>
<item name="android:windowLightNavigationBar">true</item>
<item name="android:navigationBarDividerColor">#ffdcdcdc</item>
</style>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-v28/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<item name="android:navigationBarDividerColor">#ff545454</item>
</style>
<style name="Base.V28.Theme.AppCompat.Light" parent="@style/Base.V26.Theme.AppCompat.Light">
<item name="android:navigationBarColor">@color/grey</item>
<item name="android:navigationBarColor">@android:color/white</item>
<item name="android:windowLightNavigationBar">true</item>
<item name="android:navigationBarDividerColor">#ffdcdcdc</item>
</style>
Expand Down

0 comments on commit a4960e9

Please sign in to comment.