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
 import android.app.Activity;
4
 import android.app.Activity;
5
 import android.content.Context;
5
 import android.content.Context;
6
 import android.content.res.Resources;
6
 import android.content.res.Resources;
7
+import android.graphics.Color;
7
 import android.graphics.drawable.Drawable;
8
 import android.graphics.drawable.Drawable;
8
 import android.os.AsyncTask;
9
 import android.os.AsyncTask;
9
 import android.support.annotation.ColorInt;
10
 import android.support.annotation.ColorInt;
137
     @SuppressWarnings({"ConstantConditions"})
138
     @SuppressWarnings({"ConstantConditions"})
138
     private Drawable setupBackButton(Screen screen) {
139
     private Drawable setupBackButton(Screen screen) {
139
         Resources resources = getResources();
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
         return backButton;
146
         return backButton;
152
     }
147
     }
153
 
148