Przeglądaj źródła

toolbar: navigation icon & back button

tobiasKaminsky 7 lat temu
rodzic
commit
6ab67f9c9d

+ 1 - 0
src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java

@@ -253,6 +253,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
         // Set the drawer toggle as the DrawerListener
         mDrawerLayout.addDrawerListener(mDrawerToggle);
         mDrawerToggle.setDrawerIndicatorEnabled(true);
+        mDrawerToggle.getDrawerArrowDrawable().setColor(DisplayUtils.fontColor());
     }
 
     /**

+ 0 - 5
src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -50,7 +50,6 @@ import android.support.v4.content.ContextCompat;
 import android.support.v4.view.MenuItemCompat;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.widget.SearchView;
-import android.support.v7.widget.Toolbar;
 import android.text.TextUtils;
 import android.view.Menu;
 import android.view.MenuInflater;
@@ -384,10 +383,6 @@ public class FileDisplayActivity extends HookActivity
                 setupDrawer();
             }
 
-            // update toolbar
-            Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
-            toolbar.setBackgroundColor(DisplayUtils.primaryColor());
-
             if (!stateWasRecovered) {
                 Log_OC.d(TAG, "Initializing Fragments in onAccountChanged..");
                 initFragmentsWithFile();

+ 1 - 1
src/main/java/com/owncloud/android/ui/activity/NotificationsActivity.java

@@ -119,7 +119,7 @@ public class NotificationsActivity extends FileActivity {
 
         // setup drawer
         setupDrawer(R.id.nav_notifications);
-        getSupportActionBar().setTitle(getString(R.string.drawer_item_notifications));
+        DisplayUtils.setColoredTitle(getSupportActionBar(), getString(R.string.drawer_item_notifications));
 
         swipeListRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
             @Override

+ 11 - 8
src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java

@@ -58,12 +58,20 @@ public abstract class ToolbarActivity extends BaseActivity {
         if (mProgressBar != null) {
             mProgressBar.setIndeterminateDrawable(
                     ContextCompat.getDrawable(this, R.drawable.actionbar_progress_indeterminate_horizontal));
+
+            DisplayUtils.colorToolbarProgressBar(this, DisplayUtils.primaryColor());
         }
 
+        DisplayUtils.colorStatusBar(this, DisplayUtils.primaryDarkColor());
+
         if (toolbar.getOverflowIcon() != null) {
             DisplayUtils.tintDrawable(toolbar.getOverflowIcon(), DisplayUtils.fontColor());
         }
 
+        if (toolbar.getNavigationIcon() != null) {
+            DisplayUtils.tintDrawable(toolbar.getNavigationIcon(), DisplayUtils.fontColor());
+        }
+
         if (!useBackgroundImage) {
             toolbar.setBackgroundColor(DisplayUtils.primaryColor());
         }
@@ -102,15 +110,9 @@ public abstract class ToolbarActivity extends BaseActivity {
             titleToSet = title;
         }
 
-        // set the chosen title
+        // set & color the chosen title
         ActionBar actionBar = getSupportActionBar();
-
-        // color folder name
-        DisplayUtils.setColoredTitle(actionBar, title);
-
-        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
-
-//        toolbar.setBackgroundColor(DisplayUtils.primaryColor());
+        DisplayUtils.setColoredTitle(actionBar, titleToSet);
 
         // set home button properties
         if (actionBar != null) {
@@ -118,6 +120,7 @@ public abstract class ToolbarActivity extends BaseActivity {
             actionBar.setDisplayShowTitleEnabled(true);
         }
 
+        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
         if (toolbar.getNavigationIcon() != null) {
             DisplayUtils.tintDrawable(toolbar.getNavigationIcon(), DisplayUtils.fontColor());
         }