Fix navigation bar color
This commit is contained in:
5 files changed
+7
-43
No files matched your search
@@ -20,7 +20,6 @@ import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.util.SparseArray;
|
||||
@@ -32,7 +31,6 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
@@ -181,7 +179,6 @@ public abstract class BaseScene extends SceneFragment {
|
||||
drawerView = null;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
public void setLightStatusBar(boolean set) {
|
||||
View decorView = requireActivity().getWindow().getDecorView();
|
||||
int flags = decorView.getSystemUiVisibility();
|
||||
@@ -214,9 +211,7 @@ public abstract class BaseScene extends SceneFragment {
|
||||
|
||||
// Hide soft ime
|
||||
AppHelper.hideSoftInput(getActivity());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
setLightStatusBar(needWhiteStatusBar);
|
||||
}
|
||||
setLightStatusBar(needWhiteStatusBar);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -263,10 +258,5 @@ public abstract class BaseScene extends SceneFragment {
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
if (drawerView != null) {
|
||||
drawerViewState = new SparseArray<>();
|
||||
drawerView.saveHierarchyState(drawerViewState);
|
||||
outState.putSparseParcelableArray(KEY_DRAWER_VIEW_STATE, drawerViewState);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -788,25 +788,19 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
|
||||
switch (state) {
|
||||
case STATE_NORMAL:
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
setLightStatusBar(false);
|
||||
}
|
||||
setLightStatusBar(false);
|
||||
// Show mMainView
|
||||
mViewTransition.showView(0, animation);
|
||||
// Show mBelowHeader
|
||||
mViewTransition2.showView(0, animation);
|
||||
break;
|
||||
case STATE_REFRESH:
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
setLightStatusBar(true);
|
||||
}
|
||||
setLightStatusBar(true);
|
||||
// Show mProgressView
|
||||
mViewTransition.showView(1, animation);
|
||||
break;
|
||||
case STATE_REFRESH_HEADER:
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
setLightStatusBar(false);
|
||||
}
|
||||
setLightStatusBar(false);
|
||||
// Show mMainView
|
||||
mViewTransition.showView(0, animation);
|
||||
// Show mProgress
|
||||
@@ -815,9 +809,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
default:
|
||||
case STATE_INIT:
|
||||
case STATE_FAILED:
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
setLightStatusBar(true);
|
||||
}
|
||||
setLightStatusBar(true);
|
||||
// Show mFailedView
|
||||
mViewTransition.showView(2, animation);
|
||||
break;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<resources>
|
||||
|
||||
<style name="ToolbarPopupTheme" parent="ThemeOverlay.MaterialComponents.Dark" />
|
||||
</resources>
|
||||
@@ -17,10 +17,6 @@
|
||||
<resources>
|
||||
<style name="AppTheme" parent="Base.AppTheme.Light" />
|
||||
|
||||
<style name="ActionBarStyle" parent="@style/Widget.MaterialComponents.ActionBar.Solid">
|
||||
<item name="background">?attr/toolbarColor</item>
|
||||
</style>
|
||||
|
||||
<!-- TextAppearance -->
|
||||
<style name="TextAppearance" parent="TextAppearance.AppCompat" />
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<resources>
|
||||
|
||||
<!-- ========== -->
|
||||
<!-- Base Theme -->
|
||||
@@ -24,7 +24,6 @@
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:colorBackground">@color/colorBackground</item>
|
||||
<item name="actionBarStyle">@style/ActionBarStyle</item>
|
||||
|
||||
<item name="colorEdgeEffect">@color/colorPrimary</item>
|
||||
<item name="dividerColor">@color/divider</item>
|
||||
@@ -51,12 +50,8 @@
|
||||
<item name="galleryDetailButtonBackgroundColor">@color/gallery_detail_button_background
|
||||
</item>
|
||||
|
||||
<item name="toolbarPopupTheme">@style/ToolbarPopupTheme</item>
|
||||
<item name="toolbarPopupTheme">@style/ThemeOverlay.MaterialComponents.Light</item>
|
||||
<item name="galleryDetailDivider">@drawable/divider_gallery_detail</item>
|
||||
<item name="android:navigationBarColor">@color/colorNavigationBar</item>
|
||||
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">
|
||||
@bool/lightNavigationBar
|
||||
</item>
|
||||
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
@@ -69,7 +64,6 @@
|
||||
<item name="colorPrimaryDark">@color/grey_875</item>
|
||||
<item name="colorAccent">@color/colorPrimary</item>
|
||||
<item name="colorControlActivated">@color/colorPrimary</item>
|
||||
<item name="actionBarStyle">@style/ActionBarStyle</item>
|
||||
|
||||
<item name="android:windowBackground">@color/grey_850</item>
|
||||
<item name="android:colorBackground">@color/grey_850</item>
|
||||
@@ -102,7 +96,6 @@
|
||||
|
||||
<item name="toolbarPopupTheme">@style/ThemeOverlay.MaterialComponents.Dark</item>
|
||||
<item name="galleryDetailDivider">@drawable/divider_gallery_detail_dark</item>
|
||||
<item name="android:navigationBarColor">@color/colorNavigationBar</item>
|
||||
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
@@ -110,8 +103,6 @@
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="ToolbarPopupTheme" parent="ThemeOverlay.MaterialComponents.Light" />
|
||||
|
||||
<!-- =============== -->
|
||||
<!-- Base Black Theme -->
|
||||
<!-- =============== -->
|
||||
@@ -146,7 +137,6 @@
|
||||
</item>
|
||||
|
||||
<item name="galleryDetailDivider">@drawable/divider_gallery_detail_dark</item>
|
||||
<item name="android:navigationBarColor">@android:color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Gallery" parent="AppTheme">
|
||||
|
||||
Reference in new issue
Block a user