diff --git a/res/layout/battery_usage_graph.xml b/res/layout/battery_usage_graph.xml index 79a64a9fd47..bd6e7a5ff2e 100644 --- a/res/layout/battery_usage_graph.xml +++ b/res/layout/battery_usage_graph.xml @@ -18,7 +18,7 @@ xmlns:settings="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingStart="@dimen/preference_no_icon_padding_start" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:orientation="vertical"> diff --git a/res/layout/horizontal_preference.xml b/res/layout/horizontal_preference.xml index 722e0535017..b5871d95154 100644 --- a/res/layout/horizontal_preference.xml +++ b/res/layout/horizontal_preference.xml @@ -21,7 +21,7 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:paddingTop="1dp" - android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingStart="@dimen/preference_no_icon_padding_start" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"> - - - - - - - - - - - - - - - - - diff --git a/res/layout/preference_category_material_settings.xml b/res/layout/preference_category_material_settings.xml index 13cefdbf05b..2a25bbcef73 100644 --- a/res/layout/preference_category_material_settings.xml +++ b/res/layout/preference_category_material_settings.xml @@ -35,6 +35,7 @@ android:id="@android:id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:tint="?android:attr/textColorPrimary" android:maxWidth="18dp" android:maxHeight="18dp"/> diff --git a/res/layout/preference_category_short.xml b/res/layout/preference_category_short.xml deleted file mode 100644 index 452d0bc80b4..00000000000 --- a/res/layout/preference_category_short.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - diff --git a/res/layout/preference_progress_category.xml b/res/layout/preference_progress_category.xml index 6ed6df38608..138069829f7 100644 --- a/res/layout/preference_progress_category.xml +++ b/res/layout/preference_progress_category.xml @@ -16,37 +16,46 @@ + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:orientation="horizontal" + android:layout_marginBottom="16dp" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingTop="16dp" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"> + + + + + android:textAppearance="@android:style/TextAppearance.Material.Body2"/> + android:text="@string/progress_scanning"/> diff --git a/res/layout/running_processes_header.xml b/res/layout/running_processes_header.xml index 615d30e276c..aa106ac2c27 100644 --- a/res/layout/running_processes_header.xml +++ b/res/layout/running_processes_header.xml @@ -20,18 +20,18 @@ @@ -44,12 +44,12 @@ diff --git a/res/layout/settings_summary_preference.xml b/res/layout/settings_summary_preference.xml index 7614fca1384..a5dee5283b3 100644 --- a/res/layout/settings_summary_preference.xml +++ b/res/layout/settings_summary_preference.xml @@ -18,7 +18,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingStart="@dimen/preference_no_icon_padding_start" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:orientation="vertical"> diff --git a/res/values/styles_preference.xml b/res/values/styles_preference.xml index a504166d469..1eedd4d9f68 100644 --- a/res/values/styles_preference.xml +++ b/res/values/styles_preference.xml @@ -18,6 +18,9 @@ + + 72dp + diff --git a/res/xml/app_memory_settings.xml b/res/xml/app_memory_settings.xml index 56d18244e18..53a71ff6854 100644 --- a/res/xml/app_memory_settings.xml +++ b/res/xml/app_memory_settings.xml @@ -18,8 +18,7 @@ android:title="@string/memory_usage"> + android:title="@string/average_memory_use"/> + android:title="@string/usage"> + android:key="usage_amount"> diff --git a/res/xml/device_info_status.xml b/res/xml/device_info_status.xml index a0b7590509e..1b173f12c0b 100644 --- a/res/xml/device_info_status.xml +++ b/res/xml/device_info_status.xml @@ -29,18 +29,18 @@ android:title="@string/battery_level_title" android:summary="@string/device_info_not_available" android:persistent="false" /> - - - + - + + android:title="@string/average_memory_use"/> mActiveItems = new HashMap(); ActivityManager mAm; - + RunningState mState; - + Fragment mOwner; - + Runnable mDataAvail; StringBuilder mBuilder = new StringBuilder(128); - + RunningState.BaseItem mCurSelected; - + ListView mListView; View mHeader; ServiceListAdapter mAdapter; @@ -102,19 +102,19 @@ public class RunningProcessesView extends FrameLayout void updateTime(Context context, StringBuilder builder) { TextView uptimeView = null; - + if (mItem instanceof RunningState.ServiceItem) { // If we are displaying a service, then the service // uptime goes at the top. uptimeView = mHolder.size; - + } else { String size = mItem.mSizeStr != null ? mItem.mSizeStr : ""; if (!size.equals(mItem.mCurSizeStr)) { mItem.mCurSizeStr = size; mHolder.size.setText(size); } - + if (mItem.mBackground) { // This is a background process; no uptime. if (!mSetBackground) { @@ -150,7 +150,7 @@ public class RunningProcessesView extends FrameLayout } } } - + public static class ViewHolder { public View rootView; public ImageView icon; @@ -158,7 +158,7 @@ public class RunningProcessesView extends FrameLayout public TextView description; public TextView size; public TextView uptime; - + public ViewHolder(View v) { rootView = v; icon = (ImageView)v.findViewById(R.id.icon); @@ -168,7 +168,7 @@ public class RunningProcessesView extends FrameLayout uptime = (TextView)v.findViewById(R.id.uptime); v.setTag(this); } - + public ActiveItem bind(RunningState state, RunningState.BaseItem item, StringBuilder builder) { synchronized (state.mLock) { @@ -202,13 +202,7 @@ public class RunningProcessesView extends FrameLayout } } } - - static class TimeTicker extends TextView { - public TimeTicker(Context context, AttributeSet attrs) { - super(context, attrs); - } - } - + class ServiceListAdapter extends BaseAdapter { final RunningState mState; final LayoutInflater mInflater; @@ -216,7 +210,7 @@ public class RunningProcessesView extends FrameLayout ArrayList mOrigItems; final ArrayList mItems = new ArrayList(); - + ServiceListAdapter(RunningState state) { mState = state; mInflater = (LayoutInflater)getContext().getSystemService( @@ -254,11 +248,11 @@ public class RunningProcessesView extends FrameLayout } } } - + public boolean hasStableIds() { return true; } - + public int getCount() { return mItems.size(); } @@ -294,13 +288,13 @@ public class RunningProcessesView extends FrameLayout bindView(v, position); return v; } - + public View newView(ViewGroup parent) { View v = mInflater.inflate(R.layout.running_processes_item, parent, false); new ViewHolder(v); return v; } - + public void bindView(View view, int position) { synchronized (mState.mLock) { if (position >= mItems.size()) { @@ -323,7 +317,7 @@ public class RunningProcessesView extends FrameLayout adapter.refreshItems(); adapter.notifyDataSetChanged(); } - + if (mDataAvail != null) { mDataAvail.run(); mDataAvail = null; @@ -396,7 +390,7 @@ public class RunningProcessesView extends FrameLayout } } } - + public void onItemClick(AdapterView parent, View v, int position, long id) { ListView l = (ListView)parent; RunningState.MergedItem mi = (RunningState.MergedItem)l.getAdapter().getItem(position); @@ -421,7 +415,7 @@ public class RunningProcessesView extends FrameLayout R.string.runningservicedetails_settings_title, null, null, 0); } } - + public void onMovedToScrapHeap(View view) { mActiveItems.remove(view); } @@ -430,7 +424,7 @@ public class RunningProcessesView extends FrameLayout super(context, attrs); mMyUserId = UserHandle.myUserId(); } - + public void doCreate() { mAm = (ActivityManager)getContext().getSystemService(Context.ACTIVITY_SERVICE); mState = RunningState.getInstance(getContext()); @@ -464,7 +458,7 @@ public class RunningProcessesView extends FrameLayout mAm.getMemoryInfo(memInfo); SECONDARY_SERVER_MEM = memInfo.secondaryServerThreshold; } - + public void doPause() { mState.pause(); mDataAvail = null; diff --git a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java index a45e7b40a5c..b956aa58b28 100644 --- a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java +++ b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java @@ -65,9 +65,9 @@ public final class BluetoothDevicePreference extends Preference implements /* Talk-back descriptions for various BT icons */ Resources r = getContext().getResources(); - public final String COMPUTER = r.getString(R.string.bluetooth_talkback_computer); + public final String COMPUTER = r.getString(R.string.bluetooth_talkback_computer); public final String INPUT_PERIPHERAL = r.getString( - R.string.bluetooth_talkback_input_peripheral); + R.string.bluetooth_talkback_input_peripheral); public final String HEADSET = r.getString(R.string.bluetooth_talkback_headset); public final String PHONE = r.getString(R.string.bluetooth_talkback_phone); public final String IMAGING = r.getString(R.string.bluetooth_talkback_imaging); @@ -85,11 +85,9 @@ public final class BluetoothDevicePreference extends Preference implements mCachedDevice = cachedDevice; - setLayoutResource(R.layout.preference_bt_icon); - if (cachedDevice.getBondState() == BluetoothDevice.BOND_BONDED) { UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); - if (! um.hasUserRestriction(DISALLOW_CONFIG_BLUETOOTH)) { + if (!um.hasUserRestriction(DISALLOW_CONFIG_BLUETOOTH)) { setWidgetLayoutResource(R.layout.preference_bluetooth); } } @@ -266,7 +264,7 @@ public final class BluetoothDevicePreference extends Preference implements case BluetoothClass.Device.Major.PERIPHERAL: return new Pair(HidProfile.getHidClassDrawable(btClass), - INPUT_PERIPHERAL); + INPUT_PERIPHERAL); case BluetoothClass.Device.Major.IMAGING: return new Pair(R.drawable.ic_bt_imaging, IMAGING); diff --git a/src/com/android/settings/bluetooth/BluetoothProgressCategory.java b/src/com/android/settings/bluetooth/BluetoothProgressCategory.java index ae94981c05e..a36c98b60fe 100644 --- a/src/com/android/settings/bluetooth/BluetoothProgressCategory.java +++ b/src/com/android/settings/bluetooth/BluetoothProgressCategory.java @@ -27,21 +27,28 @@ import com.android.settings.R; */ public class BluetoothProgressCategory extends ProgressCategory { public BluetoothProgressCategory(Context context) { - this(context, null); + super(context); + init(); } public BluetoothProgressCategory(Context context, AttributeSet attrs) { - this(context, attrs, 0); + super(context, attrs); + init(); } public BluetoothProgressCategory(Context context, AttributeSet attrs, int defStyleAttr) { - this(context, attrs, defStyleAttr, 0); + super(context, attrs, defStyleAttr); + init(); } public BluetoothProgressCategory(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); + init(); + } + private void init() { + setIcon(R.drawable.ic_settings_bluetooth); setEmptyTextRes(R.string.bluetooth_no_devices_found); } } diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java index 1dd0471c495..5c18d66c949 100644 --- a/src/com/android/settings/bluetooth/BluetoothSettings.java +++ b/src/com/android/settings/bluetooth/BluetoothSettings.java @@ -161,13 +161,13 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem @Override void addPreferencesForActivity() { addPreferencesFromResource(R.xml.bluetooth_settings); - - mPairedDevicesCategory = new PreferenceCategory(getPrefContext()); + final Context prefContext = getPrefContext(); + mPairedDevicesCategory = new PreferenceCategory(prefContext); mPairedDevicesCategory.setKey(KEY_PAIRED_DEVICES); mPairedDevicesCategory.setOrder(1); getPreferenceScreen().addPreference(mPairedDevicesCategory); - mAvailableDevicesCategory = new BluetoothProgressCategory(getActivity()); + mAvailableDevicesCategory = new BluetoothProgressCategory(prefContext); mAvailableDevicesCategory.setSelectable(false); mAvailableDevicesCategory.setOrder(2); getPreferenceScreen().addPreference(mAvailableDevicesCategory); diff --git a/src/com/android/settings/datausage/CellDataPreference.java b/src/com/android/settings/datausage/CellDataPreference.java index 0194178267a..77460ef8f71 100644 --- a/src/com/android/settings/datausage/CellDataPreference.java +++ b/src/com/android/settings/datausage/CellDataPreference.java @@ -25,6 +25,7 @@ import android.os.Looper; import android.os.Parcel; import android.os.Parcelable; import android.provider.Settings.Global; +import android.support.v4.content.res.TypedArrayUtils; import android.support.v7.preference.PreferenceViewHolder; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; @@ -53,7 +54,9 @@ public class CellDataPreference extends CustomDialogPreference implements Templa private SubscriptionManager mSubscriptionManager; public CellDataPreference(Context context, AttributeSet attrs) { - super(context, attrs, android.R.attr.switchPreferenceStyle); + super(context, attrs, TypedArrayUtils.getAttr(context, + android.support.v7.preference.R.attr.switchPreferenceStyle, + android.R.attr.switchPreferenceStyle)); } @Override diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status.java index fb6627ad2c3..baddc6cac2b 100644 --- a/src/com/android/settings/deviceinfo/Status.java +++ b/src/com/android/settings/deviceinfo/Status.java @@ -46,14 +46,6 @@ import java.lang.ref.WeakReference; import static android.content.Context.CONNECTIVITY_SERVICE; import static android.content.Context.WIFI_SERVICE; -/** - * Display the following information - * # Battery Strength : TODO - * # Uptime - * # Awake Time - * # XMPP/buzz/tickle status : TODO - * - */ public class Status extends SettingsPreferenceFragment { private static final String KEY_BATTERY_STATUS = "battery_status";