Added the color of the colorPrimaryVariant to avoid the run time exception
while load the MaterialCardView resource.
Modified the test case for the new version material design library.
Bug:
118886724
Test: robotest
Change-Id: I55791b8eef2263587b2ae3d7a2f5b9da9929fc9a
<item name="batteryGoodColor">@color/battery_good_color_light</item>
<item name="batteryMaybeColor">@color/battery_maybe_color_light</item>
<item name="batteryBadColor">@color/battery_bad_color_light</item>
+ <!-- Define this color for material design -->
+ <item name="colorPrimaryVariant">@android:color/white</item>
</style>
<style name="Theme.Settings.Home" parent="Theme.Settings.HomeBase">
<item name="colorAccent">#ffffff</item>
<item name="preferenceTheme">@style/PreferenceTheme</item>
<item name="android:windowLightStatusBar">true</item>
+ <!-- Define this color for material design -->
+ <item name="colorPrimaryVariant">@android:color/white</item>
</style>
<style name="ThemeOverlay.SwitchBar.Settings" parent="@android:style/ThemeOverlay.Material.ActionBar">
final ActivityController<Activity> activityController = Robolectric.buildActivity(
Activity.class);
mActivity = activityController.get();
- mActivity.setTheme(R.style.Theme_AppCompat);
+ mActivity.setTheme(R.style.Theme_Settings_Home);
activityController.create();
mRenderer = new ConditionContextualCardRenderer(mActivity, mControllerRendererPool);
}
final ActivityController<Activity> activityController = Robolectric.buildActivity(
Activity.class);
mActivity = activityController.get();
- mActivity.setTheme(R.style.Theme_AppCompat);
+ mActivity.setTheme(R.style.Theme_Settings_Home);
activityController.create();
mRenderer = new ConditionHeaderContextualCardRenderer(mActivity, mControllerRendererPool);
}
final ActivityController<Activity> activityController = Robolectric.buildActivity(
Activity.class);
mActivity = activityController.get();
- mActivity.setTheme(R.style.Theme_AppCompat);
+ mActivity.setTheme(R.style.Theme_Settings_Home);
activityController.create();
mRenderer = new LegacySuggestionContextualCardRenderer(mActivity, mControllerRendererPool);
final ActivityController<Activity> activityController = Robolectric.buildActivity(
Activity.class);
mActivity = activityController.get();
- mActivity.setTheme(R.style.Theme_AppCompat);
+ mActivity.setTheme(R.style.Theme_Settings_Home);
activityController.create();
mLifecycleOwner = new ContextualCardsFragment();
mRenderer = new SliceContextualCardRenderer(mActivity, mLifecycleOwner,