Apply LightActionBar theme to Settings app.
Bug: 33558692 Test: visual Test: RunSettingsRoboTests Change-Id: I9f0fb71eb0cd0c58ac3b0f69544adec963faf2dd
This commit is contained in:
27
res/drawable/ic_search_24dp.xml
Normal file
27
res/drawable/ic_search_24dp.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2016 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0"
|
||||
android:tint="?android:attr/colorControlNormal">
|
||||
<path
|
||||
android:pathData="M15.5,14l-0.8,0l-0.3,-0.3c1,-1.1 1.6,-2.6 1.6,-4.2C16,5.9 13.1,3 9.5,3C5.9,3 3,5.9 3,9.5S5.9,16 9.5,16c1.6,0 3.1,-0.6 4.2,-1.6l0.3,0.3l0,0.8l5,5l1.5,-1.5L15.5,14zM9.5,14C7,14 5,12 5,9.5S7,5 9.5,5C12,5 14,7 14,9.5S12,14 9.5,14z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
@@ -18,7 +18,6 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
android:background="@drawable/switchbar_background"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingEnd="@dimen/switchbar_subsettings_margin_end"
|
||||
android:theme="?attr/switchBarTheme" >
|
||||
|
@@ -437,5 +437,4 @@
|
||||
</style>
|
||||
|
||||
<style name="AppActionPrimaryButton" parent="android:Widget.Material.Button.Colored"/>
|
||||
|
||||
</resources>
|
||||
|
@@ -120,7 +120,7 @@
|
||||
layouts against a remote context using our local theme colors. Due to the implementation
|
||||
details of Theme, we can't reference any local resources and MUST instead use the values
|
||||
directly. So use #ff263238 instead of @color/theme_primary and so on. -->
|
||||
<style name="Theme.SettingsBase" parent="@android:style/Theme.DeviceDefault.Settings" />
|
||||
<style name="Theme.SettingsBase" parent="@*android:style/Theme.DeviceDefault.Settings.LightActionBar" />
|
||||
|
||||
<style name="Theme.Settings" parent="Theme.SettingsBase">
|
||||
<item name="preferenceTheme">@style/PreferenceTheme</item>
|
||||
@@ -175,7 +175,7 @@
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.ActionBar" parent="@android:style/Widget.Material.ActionBar.Solid">
|
||||
<style name="Theme.ActionBar" parent="@android:style/Widget.DeviceDefault.Light.ActionBar">
|
||||
<item name="android:contentInsetStart">@dimen/actionbar_contentInsetStart</item>
|
||||
</style>
|
||||
|
||||
@@ -183,16 +183,16 @@
|
||||
<item name="android:contentInsetStart">@dimen/actionbar_subsettings_contentInsetStart</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeOverlay.SwitchBar.Settings" parent="@*android:style/ThemeOverlay.DeviceDefault.Dark.ActionBar.Accent">
|
||||
<style name="ThemeOverlay.SwitchBar.Settings" parent="@*android:style/ThemeOverlay.DeviceDefault.ActionBar.Accent">
|
||||
<item name="switchBarMarginStart">@dimen/switchbar_subsettings_margin_start</item>
|
||||
<item name="switchBarMarginEnd">@dimen/switchbar_subsettings_margin_end</item>
|
||||
<item name="switchBarBackgroundColor">?android:attr/colorSecondary</item>
|
||||
<item name="switchBarBackgroundColor">?android:attr/colorBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeOverlay.SwitchBar.SubSettings" parent="@android:style/ThemeOverlay.Material.Dark.ActionBar">
|
||||
<style name="ThemeOverlay.SwitchBar.SubSettings" parent="@*android:style/ThemeOverlay.DeviceDefault.ActionBar.Accent">
|
||||
<item name="switchBarMarginStart">@dimen/switchbar_subsettings_margin_start</item>
|
||||
<item name="switchBarMarginEnd">@dimen/switchbar_subsettings_margin_end</item>
|
||||
<item name="switchBarBackgroundColor">?android:attr/colorSecondary</item>
|
||||
<item name="switchBarBackgroundColor">?android:attr/colorBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.DialogWhenLarge" parent="@*android:style/Theme.DeviceDefault.Settings.DialogWhenLarge">
|
||||
@@ -217,8 +217,7 @@
|
||||
<style name="Theme.SubSettingsDialogWhenLarge" parent="Theme.DialogWhenLarge">
|
||||
<item name="preferenceTheme">@style/PreferenceTheme</item>
|
||||
<item name="android:actionBarWidgetTheme">@null</item>
|
||||
<item name="android:actionBarTheme">@android:style/ThemeOverlay.Material.Dark.ActionBar</item>
|
||||
|
||||
<item name="android:actionBarTheme">@*android:style/ThemeOverlay.DeviceDefault.ActionBar.Accent</item>
|
||||
<item name="preferenceBackgroundColor">@drawable/preference_background</item>
|
||||
</style>
|
||||
|
||||
|
@@ -46,7 +46,7 @@ public class SearchFeatureProviderImpl implements SearchFeatureProvider {
|
||||
}
|
||||
String menuTitle = activity.getString(R.string.search_menu);
|
||||
MenuItem menuItem = menu.add(Menu.NONE, Menu.NONE, Menu.NONE, menuTitle)
|
||||
.setIcon(R.drawable.abc_ic_search_api_material)
|
||||
.setIcon(R.drawable.ic_search_24dp)
|
||||
.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
|
3
tests/robotests/res/values/themes.xml
Normal file
3
tests/robotests/res/values/themes.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<style name="Theme.Settings" parent="@android:style/Theme.DeviceDefault.Settings"/>
|
||||
</resources>
|
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
package com.android.settings;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.content.Intent;
|
||||
|
||||
import org.junit.runners.model.InitializationError;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.annotation.Config;
|
||||
@@ -55,10 +55,10 @@ public class SettingsRobolectricTestRunner extends RobolectricTestRunner {
|
||||
// Using the manifest file's relative path, we can figure out the application directory.
|
||||
final String appRoot = "packages/apps/Settings";
|
||||
final String manifestPath = appRoot + "/AndroidManifest.xml";
|
||||
final String resDir = appRoot + "/res";
|
||||
final String resDir = appRoot + "/tests/robotests/res";
|
||||
final String assetsDir = appRoot + config.assetDir();
|
||||
|
||||
// By adding any resources from libraries we need to the AndroidManifest, we can access
|
||||
// By adding any resources from libraries we need the AndroidManifest, we can access
|
||||
// them from within the parallel universe's resource loader.
|
||||
final AndroidManifest manifest = new AndroidManifest(Fs.fileFromPath(manifestPath),
|
||||
Fs.fileFromPath(resDir), Fs.fileFromPath(assetsDir)) {
|
||||
|
@@ -18,37 +18,37 @@ package com.android.settings.dashboard;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.provider.Settings;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.SpinnerAdapter;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.TestConfig;
|
||||
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
|
||||
import com.android.settings.dashboard.SupportItemAdapter.EscalationData;
|
||||
import com.android.settings.overlay.SupportFeatureProvider;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.Robolectric;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.annotation.Config;
|
||||
import com.android.settings.R;
|
||||
import org.robolectric.shadows.ShadowActivity;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyInt;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.robolectric.Shadows.shadowOf;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.robolectric.Shadows.shadowOf;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@RunWith(SettingsRobolectricTestRunner.class)
|
||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
||||
public class SupportItemAdapterTest {
|
||||
private static final String ACCOUNT_TYPE = "com.google";
|
||||
@@ -106,7 +106,8 @@ public class SupportItemAdapterTest {
|
||||
|
||||
@Test
|
||||
public void testSetAccount_AccountEmpty_NotCrash() {
|
||||
when(mSupportFeatureProvider.getSupportEligibleAccounts(mActivity)).thenReturn(ZERO_ACCOUNT);
|
||||
when(mSupportFeatureProvider.getSupportEligibleAccounts(mActivity)).thenReturn(
|
||||
ZERO_ACCOUNT);
|
||||
mSupportItemAdapter = new SupportItemAdapter(mActivity, null, mSupportFeatureProvider,
|
||||
mMetricsFeatureProvider, null);
|
||||
|
||||
|
Reference in New Issue
Block a user