Update SummaryPreference to use config_headlineFontFamily.
Also deleted a couple of unused files.
Change-Id: I42b6f6c79c3a7ba00040d657204830c5a468a2b2
Fixes: 62385826
Test: manual
diff --git a/res/layout/preference_linearcolor.xml b/res/layout/preference_linearcolor.xml
deleted file mode 100644
index f3abb9c..0000000
--- a/res/layout/preference_linearcolor.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 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.
--->
-
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="?android:attr/listPreferredItemHeight"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
- <com.android.settings.applications.LinearColorBar
- android:id="@+id/linear_color_bar"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginTop="16dp"
- android:layout_marginBottom="16dp"
- android:gravity="center_vertical"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:shadowRadius="4"
- android:shadowColor="?android:attr/colorBackground"
- android:shadowDx="2"
- android:shadowDy="2">
- </com.android.settings.applications.LinearColorBar>
-
-</FrameLayout>
\ No newline at end of file
diff --git a/res/layout/settings_summary_preference.xml b/res/layout/settings_summary_preference.xml
index a5dee52..7d550b5 100644
--- a/res/layout/settings_summary_preference.xml
+++ b/res/layout/settings_summary_preference.xml
@@ -26,9 +26,10 @@
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingTop="0dp"
android:layout_marginTop="0dp"
android:layout_marginBottom="5dp"
+ android:fontFamily="@*android:string/config_headlineFontFamily"
+ android:paddingTop="0dp"
android:textColor="?android:attr/colorAccent"
android:textAppearance="@android:style/TextAppearance.Material.Display1"
/>
diff --git a/src/com/android/settings/applications/LinearColorPreference.java b/src/com/android/settings/applications/LinearColorPreference.java
deleted file mode 100644
index e400f5e..0000000
--- a/src/com/android/settings/applications/LinearColorPreference.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2013 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.
- */
-
-package com.android.settings.applications;
-
-import android.content.Context;
-import android.support.v7.preference.Preference;
-import android.support.v7.preference.PreferenceViewHolder;
-
-import com.android.settings.R;
-
-public class LinearColorPreference extends Preference {
- float mRedRatio;
- float mYellowRatio;
- float mGreenRatio;
- int mRedColor = 0xffaa5030;
- int mYellowColor = 0xffaaaa30;
- int mGreenColor = 0xff30aa50;
- int mColoredRegions = LinearColorBar.REGION_ALL;
- LinearColorBar.OnRegionTappedListener mOnRegionTappedListener;
-
- public LinearColorPreference(Context context) {
- super(context);
- setLayoutResource(R.layout.preference_linearcolor);
- }
-
- public void setRatios(float red, float yellow, float green) {
- mRedRatio = red;
- mYellowRatio = yellow;
- mGreenRatio = green;
- notifyChanged();
- }
-
- public void setColors(int red, int yellow, int green) {
- mRedColor = red;
- mYellowColor = yellow;
- mGreenColor = green;
- notifyChanged();
- }
-
- public void setOnRegionTappedListener(LinearColorBar.OnRegionTappedListener listener) {
- mOnRegionTappedListener = listener;
- notifyChanged();
- }
-
- public void setColoredRegions(int regions) {
- mColoredRegions = regions;
- notifyChanged();
- }
-
- @Override
- public void onBindViewHolder(PreferenceViewHolder view) {
- super.onBindViewHolder(view);
-
- LinearColorBar colors = (LinearColorBar)view.findViewById(
- R.id.linear_color_bar);
- colors.setShowIndicator(false);
- colors.setColors(mRedColor, mYellowColor, mGreenColor);
- colors.setRatios(mRedRatio, mYellowRatio, mGreenRatio);
- colors.setColoredRegions(mColoredRegions);
- colors.setOnRegionTappedListener(mOnRegionTappedListener);
- }
-}
diff --git a/tests/robotests/src/com/android/settings/SummaryPreferenceTest.java b/tests/robotests/src/com/android/settings/SummaryPreferenceTest.java
index d7e133e..59a5867 100644
--- a/tests/robotests/src/com/android/settings/SummaryPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/SummaryPreferenceTest.java
@@ -32,9 +32,14 @@
import static junit.framework.Assert.assertTrue;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settings.testutils.shadow.SettingsShadowResources;
@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
+ shadows = {
+ SettingsShadowResources.class,
+ SettingsShadowResources.SettingsShadowTheme.class
+})
public class SummaryPreferenceTest {
private Context mContext;