Fix robolectric tests
- Override a button style to avoid dependency on new style name.
Change-Id: I62935afe16424d8ddf0c2448327d76eda00440a5
Fixes: 69918100
Test: robotests
diff --git a/res/layout/support_escalation_options.xml b/res/layout/support_escalation_options.xml
index 17e03ff..ae208f1 100644
--- a/res/layout/support_escalation_options.xml
+++ b/res/layout/support_escalation_options.xml
@@ -65,7 +65,7 @@
android:orientation="vertical">
<Button
android:id="@android:id/text1"
- style="@style/SupportPrimaryButton"
+ style="@style/ActionPrimaryButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"/>
@@ -86,7 +86,7 @@
android:orientation="vertical">
<Button
android:id="@android:id/text2"
- style="@style/SupportPrimaryButton"
+ style="@style/ActionPrimaryButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"/>
diff --git a/res/layout/support_offline_escalation_options.xml b/res/layout/support_offline_escalation_options.xml
index 18d8f98..09863d3 100644
--- a/res/layout/support_offline_escalation_options.xml
+++ b/res/layout/support_offline_escalation_options.xml
@@ -56,7 +56,7 @@
</LinearLayout>
<Button
android:id="@android:id/text1"
- style="@style/SupportPrimaryButton"
+ style="@style/ActionPrimaryButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
diff --git a/res/layout/support_sign_in_button.xml b/res/layout/support_sign_in_button.xml
index 45de571..5bea068 100644
--- a/res/layout/support_sign_in_button.xml
+++ b/res/layout/support_sign_in_button.xml
@@ -38,7 +38,7 @@
android:textColor="?android:attr/textColorSecondary"/>
<Button
android:id="@android:id/text1"
- style="@style/SupportPrimaryButton"
+ style="@style/ActionPrimaryButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"/>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 7c43e99..c68eb72 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -338,8 +338,6 @@
<style name="TextAppearance.SupportSummary" parent="TextAppearance.CategoryTitle"/>
- <style name="SupportPrimaryButton" parent="android:Widget.DeviceDefault.Button.Colored"/>
-
<style name="SupportSecondaryButton"
parent="android:Widget.DeviceDefault.Button.Borderless.Colored">
<item name="android:textSize">12sp</item>
diff --git a/tests/robotests/res/values/themes.xml b/tests/robotests/res/values/themes.xml
index b91df65..74bdd9b 100644
--- a/tests/robotests/res/values/themes.xml
+++ b/tests/robotests/res/values/themes.xml
@@ -1,3 +1,7 @@
<resources>
- <style name="Theme.Settings" parent="@android:style/Theme.DeviceDefault.Settings"/>
+ <style name="Theme.Settings" parent="@android:style/Theme.DeviceDefault.Settings" />
+
+ <!-- Override the main app's style for ActionPrimaryButton to get around lack of new style
+ support in robolectric -->
+ <style name="ActionPrimaryButton" parent="android:Widget.DeviceDefault.Button" />
</resources>