Bug 1217416 - Override Snackbar.Message style in base theme. r=margaret
☠☠ backed out by eb835b982e8a ☠ ☠
authorSebastian Kaspari <s.kaspari@gmail.com>
Fri, 23 Oct 2015 21:16:37 +0200
changeset 304489 a6eb8032ebf668d7baa2637190aadb39ed2a810e
parent 304488 ccb7bb578fb15e0fe344b0e9a3b3628faed8bedc
child 304490 98b24322ef1d8e92ff35ac93c5810f9f2742db47
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1217416
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1217416 - Override Snackbar.Message style in base theme. r=margaret
mobile/android/base/GeckoApp.java
mobile/android/base/resources/values/styles.xml
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -67,16 +67,17 @@ import android.os.Bundle;
 import android.os.Environment;
 import android.os.Handler;
 import android.os.PowerManager;
 import android.os.Process;
 import android.os.StrictMode;
 import android.provider.ContactsContract;
 import android.provider.MediaStore.Images.Media;
 import android.support.design.widget.Snackbar;
+import android.support.v4.content.ContextCompat;
 import android.text.TextUtils;
 import android.util.AttributeSet;
 import android.util.Base64;
 import android.util.Log;
 import android.util.SparseBooleanArray;
 import android.view.Gravity;
 import android.view.KeyEvent;
 import android.view.Menu;
@@ -846,16 +847,17 @@ public abstract class GeckoApp
 
     void showSnackbar(final String message, final int duration, final String action, final EventCallback callback) {
         final Snackbar snackbar = Snackbar.make(mRootLayout, message, duration);
 
         if (!TextUtils.isEmpty(action)) {
             final SnackbarEventCallback snackbarCallback = new SnackbarEventCallback(callback);
 
             snackbar.setAction(action, snackbarCallback);
+            snackbar.setActionTextColor(ContextCompat.getColor(this, R.color.fennec_ui_orange));
             snackbar.setCallback(snackbarCallback);
         }
 
         snackbar.show();
     }
 
     private static class SnackbarEventCallback extends Snackbar.Callback implements View.OnClickListener {
         private EventCallback callback;
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
+<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
 
     <!--
         Base application styles. This could be overridden in other res/values-XXX/themes.xml.
     -->
     <style name="Widget"/>
 
     <style name="Widget.BaseButton" parent="android:style/Widget.Button"/>
 
@@ -288,16 +288,21 @@
     <style name="Widget.Doorhanger.Button" parent="Widget.BaseButton">
         <item name="android:layout_width">0dp</item>
         <item name="android:layout_height">wrap_content</item>
         <item name="android:layout_weight">1</item>
         <item name="android:minHeight">48dp</item>
         <item name="android:textSize">14sp</item>
     </style>
 
+    <style name="TextAppearance.Design.Snackbar.Message" parent="android:TextAppearance" tools:override="true">
+        <item name="android:textSize">@dimen/design_snackbar_text_size</item>
+        <item name="android:textColor">@android:color/white</item>
+    </style>
+
     <!--
         TextAppearance
         Note: Gecko uses light theme as default, while Android uses dark.
         If Android convention has to be followd, the list of colors specified 
         in themes.xml would be inverse, and things would get confusing.
         Hence, Gecko's TextAppearance is based on text over light theme and
         TextAppearance.Inverse is based on text over dark theme.
     -->