Răsfoiți Sursa

Merge pull request #6087 from nextcloud/newDesign-navigationBar

Add light navigationbar and fix statusbar with actionMode
Andy Scherzinger 4 ani în urmă
părinte
comite
a1a1a8d565

+ 4 - 3
src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -696,9 +696,10 @@ public class OCFileListFragment extends ExtendedListFragment implements
             mActiveActionMode = null;
 
             // reset to previous color
-            final FragmentActivity activity = getActivity();
-            if (activity != null) {
-                ThemeUtils.colorStatusBar(activity);
+            FragmentActivity fragmentActivity;
+            if ((fragmentActivity = getActivity()) != null && fragmentActivity instanceof FileDisplayActivity) {
+                FileDisplayActivity fileDisplayActivity = (FileDisplayActivity) fragmentActivity;
+                fileDisplayActivity.updateActionBarTitleAndHomeButton(fileDisplayActivity.getCurrentDir());
             }
 
             // show FAB on multi selection mode exit

+ 7 - 1
src/main/java/com/owncloud/android/utils/ThemeUtils.java

@@ -472,7 +472,13 @@ public final class ThemeUtils {
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                 View decor = window.getDecorView();
                 if (isLightTheme) {
-                    decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+                    int systemUiFlagLightStatusBar;
+                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+                        systemUiFlagLightStatusBar = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
+                    } else {
+                        systemUiFlagLightStatusBar = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
+                    }
+                    decor.setSystemUiVisibility(systemUiFlagLightStatusBar);
                 } else {
                     decor.setSystemUiVisibility(0);
                 }

+ 2 - 0
src/main/res/layout/toolbar_standard.xml

@@ -99,7 +99,9 @@
                 android:layout_height="wrap_content"
                 android:layout_marginStart="18dp"
                 android:layout_marginEnd="18dp"
+                android:ellipsize="end"
                 android:gravity="start"
+                android:lines="1"
                 android:textColor="@color/fontSecondaryAppbar"
                 android:textSize="16sp"
                 app:layout_constraintBottom_toBottomOf="parent"

+ 25 - 0
src/main/res/values-night-v21/styles.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Nextcloud Android client application
+
+  Copyright (C) 2020 Nextcloud
+
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+  License as published by the Free Software Foundation; either
+  version 3 of the License, or any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+
+  You should have received a copy of the GNU Affero General Public
+  License along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <style name="Theme.ownCloud.Toolbar.Drawer">
+        <item name="android:navigationBarColor">@color/bg_default</item>
+    </style>
+</resources>

+ 19 - 1
src/main/res/values-v19/styles.xml

@@ -1,4 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
+<!--
+  Nextcloud Android client application
+
+  Copyright (C) 2020 Nextcloud
+
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+  License as published by the Free Software Foundation; either
+  version 3 of the License, or any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+
+  You should have received a copy of the GNU Affero General Public
+  License along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
 <resources>
 
     <style name="Theme.ownCloud.Overlay" parent="Theme.ownCloud">
@@ -10,4 +28,4 @@
         <item name="actionBarStyle">@style/Theme.ownCloud.Overlay.ActionBar</item>
         <item name="windowActionBarOverlay">true</item>
     </style>
-</resources>
+</resources>

+ 3 - 2
src/main/res/values-v21/styles.xml

@@ -56,11 +56,12 @@
         <item name="android:windowDrawsSystemBarBackgrounds">true</item>
     </style>
 
-    <style name="Theme.ownCloud.Toolbar.Drawer">
+    <style name="Theme.ownCloud.Toolbar.DrawerBase" parent="Theme.ownCloud.Toolbar">
         <item name="android:statusBarColor">@android:color/transparent</item>
-        <item name="android:colorBackground">@color/bg_default</item>
     </style>
 
+    <style name="Theme.ownCloud.Toolbar.Drawer" parent="Theme.ownCloud.Toolbar.DrawerBase"/>
+
     <!-- Launch screen -->
     <style name="Theme.ownCloud.Launcher">
         <item name="android:statusBarColor">@color/primary</item>

+ 27 - 0
src/main/res/values-v27/styles.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Nextcloud Android client application
+
+  Copyright (C) 2020 Nextcloud
+  Copyright (C) 2020 Joris Bodin <joris.bodin@infomaniak.com>
+
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+  License as published by the Free Software Foundation; either
+  version 3 of the License, or any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+
+  You should have received a copy of the GNU Affero General Public
+  License along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <style name="Theme.ownCloud.Toolbar.Drawer" parent="Theme.ownCloud.Toolbar.DrawerBase">
+        <item name="android:windowLightNavigationBar">true</item>
+        <item name="android:navigationBarColor">@color/bg_default</item>
+    </style>
+</resources>

+ 2 - 2
src/main/res/values/styles.xml

@@ -79,6 +79,7 @@
         <item name="actionModeBackground">@color/action_mode_background</item>
         <item name="alertDialogTheme">@style/ownCloud.AlertDialog</item>
         <item name="android:alertDialogTheme">@style/Theme.ownCloud.Dialog</item>
+        <item name="android:colorBackground">@color/bg_default</item>
         <item name="android:windowBackground">@color/bg_default</item>
         <item name="colorAccent">@color/color_accent</item>
         <item name="colorPrimary">@color/primary</item>
@@ -92,8 +93,7 @@
     <style name="Theme.ownCloud.Toolbar" parent="BaseTheme.ownCloud.Toolbar" />
 
 	<!-- separate style for Drawer activities needed for v21+ theming -->
-	<style name="Theme.ownCloud.Toolbar.Drawer" parent="Theme.ownCloud.Toolbar">
-	</style>
+	<style name="Theme.ownCloud.Toolbar.Drawer" parent="Theme.ownCloud.Toolbar"/>
 
 	<style name="Theme.ownCloud.noActionBar.Login" parent="Theme.ownCloud.Toolbar">
 		<item name="android:windowBackground">@color/primary</item>