Browse Source

Set default back button color to black

Guy Carmeli 8 years ago
parent
commit
08a4775b98

+ 6
- 11
android/app/src/main/java/com/reactnativenavigation/views/RnnToolBar.java View File

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
4 4
 import android.app.Activity;
5 5
 import android.content.Context;
6 6
 import android.content.res.Resources;
7
+import android.graphics.Color;
7 8
 import android.graphics.drawable.Drawable;
8 9
 import android.os.AsyncTask;
9 10
 import android.support.annotation.ColorInt;
@@ -137,17 +138,11 @@ public class RnnToolBar extends Toolbar {
137 138
     @SuppressWarnings({"ConstantConditions"})
138 139
     private Drawable setupBackButton(Screen screen) {
139 140
         Resources resources = getResources();
140
-        final Drawable backButton;
141
-        if (screen.navBarButtonColor != null) {
142
-            backButton = ResourcesCompat.getDrawable(resources,
143
-                    R.drawable.abc_ic_ab_back_mtrl_am_alpha,
144
-                    null);
145
-            ImageUtils.tint(backButton, screen.navBarButtonColor);
146
-        } else {
147
-            backButton = ResourcesCompat.getDrawable(resources,
148
-                    R.drawable.abc_ic_ab_back_mtrl_am_alpha,
149
-                    ContextProvider.getActivityContext().getTheme());
150
-        }
141
+        final Drawable backButton = ResourcesCompat.getDrawable(resources,
142
+                R.drawable.abc_ic_ab_back_mtrl_am_alpha,
143
+                ContextProvider.getActivityContext().getTheme());
144
+        int tintColor = screen.navBarButtonColor != null ? screen.navBarButtonColor : Color.BLACK;
145
+        ImageUtils.tint(backButton, tintColor);
151 146
         return backButton;
152 147
     }
153 148