Merge "Add touch feedback to tertiary buttons"

This commit is contained in:
TreeHugger Robot 2018-03-09 07:41:28 +00:00 committed by Android (Google) Code Review
commit 480f0c352e
3 changed files with 8 additions and 6 deletions

View file

@ -26,6 +26,8 @@
<!-- Calculated by (suw_glif_margin_sides - suw_glif_button_padding) -->
<dimen name="suw_glif_button_margin_start">8dp</dimen>
<dimen name="suw_glif_button_padding">16dp</dimen>
<!-- Negative of suw_glif_button_padding -->
<dimen name="suw_glif_negative_button_padding">-16dp</dimen>
<dimen name="suw_glif_footer_padding_vertical">8dp</dimen>
<dimen name="suw_glif_footer_min_height">72dp</dimen>
<dimen name="suw_glif_margin_sides">24dp</dimen>

View file

@ -195,10 +195,10 @@
<item name="android:buttonStyle">@style/SuwGlifButton.Tertiary</item>
<item name="android:theme">@style/SuwGlifButton.Tertiary</item>
<item name="android:background">@null</item>
<item name="android:fontFamily" tools:targetApi="jelly_bean">sans-serif</item>
<item name="android:layout_gravity">?attr/suwGlifHeaderGravity</item>
<item name="android:padding">0dp</item>
<item name="android:layout_marginLeft">@dimen/suw_glif_negative_button_padding</item>
<item name="android:layout_marginRight">@dimen/suw_glif_negative_button_padding</item>
<!-- Always lowercase instead of reading attr/suwButtonAllCaps, since this is a tertiary
button -->
<item name="android:textAllCaps" tools:targetApi="ice_cream_sandwich">false</item>

View file

@ -16,8 +16,9 @@
package com.android.setupwizardlib.util;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.robolectric.RuntimeEnvironment.application;
@ -59,9 +60,8 @@ public class GlifStyleTest {
Robolectric.buildAttributeSet()
.setStyleAttribute("@style/SuwGlifButton.Tertiary")
.build());
assertNull("Background of tertiary button should be null", button.getBackground());
assertNull("Tertiary button should have no transformation method",
button.getTransformationMethod());
assertThat(button.getBackground()).named("background").isNotNull();
assertThat(button.getTransformationMethod()).named("transformation method").isNull();
if (VERSION.SDK_INT < VERSION_CODES.M) {
// Robolectric resolved the wrong theme attribute on versions >= M
// https://github.com/robolectric/robolectric/issues/2940