Skip to content

Commit

Permalink
Use light nav bar on Player screen where available.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbutcher committed Jun 13, 2017
1 parent 3be8349 commit 7ff2bd0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
6 changes: 4 additions & 2 deletions app/src/main/java/io/plaidapp/ui/PlayerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ protected void onCreate(Bundle savedInstanceState) {
}

// setup immersive mode i.e. draw behind the system chrome & adjust insets
draggableFrame.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
draggableFrame.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
draggableFrame.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-v23/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

<resources>

<color name="light_immersive_bars">#b3eeeeee</color> <!-- 70% grey 200 -->
<color name="light_status_bar">@color/light_immersive_bars</color>

</resources>
22 changes: 22 additions & 0 deletions app/src/main/res/values-v26/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<resources>

<color name="light_nav_bar">@color/light_immersive_bars</color>

</resources>
4 changes: 3 additions & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
<color name="background_card">#ffffff</color>
<color name="background_dark">#ff333333</color>
<color name="immersive_bars">#99000000</color>
<color name="light_immersive_bars">@color/immersive_bars</color>
<color name="light_immersive_bars">#b3eeeeee</color> <!-- 70% grey 200 -->
<color name="light_status_bar">@color/immersive_bars</color> <!-- overridden on v23+ -->
<color name="light_nav_bar">@color/immersive_bars</color> <!-- overridden on v26+ -->
<color name="status_bar_back">#ff676767</color> <!-- this is blended with immersive_bars to produce the desired status bar color i.e. background_super_dark -->
<color name="background_super_dark">#ff292929</color>
<color name="scrim">#99323232</color>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@

<style name="Plaid.Translucent.Dribbble.Player">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@color/light_immersive_bars</item>
<item name="android:navigationBarColor">@color/immersive_bars</item>
<item name="android:statusBarColor">@color/light_status_bar</item>
<item name="android:navigationBarColor">@color/light_nav_bar</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowAllowEnterTransitionOverlap">true</item>
<item name="android:windowAllowReturnTransitionOverlap">true</item>
Expand Down

0 comments on commit 7ff2bd0

Please sign in to comment.