Merge "Left align preferences and graphs to leave space for icon."
This commit is contained in:
committed by
Android (Google) Code Review
commit
a4ddf57270
@@ -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">
|
||||
|
||||
|
@@ -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">
|
||||
|
||||
<TextView
|
||||
|
@@ -1,75 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2014 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.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
|
||||
<ImageView
|
||||
android:id="@android:id/icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dip"
|
||||
android:layout_marginEnd="6dip"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="15dip"
|
||||
android:paddingTop="16dip"
|
||||
android:paddingBottom="16dip">
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Subhead"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:ellipsize="marquee"
|
||||
android:fadingEdge="horizontal" />
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@android:id/title"
|
||||
android:layout_alignStart="@android:id/title"
|
||||
android:visibility="gone"
|
||||
android:textAlignment="viewStart"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Body1"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:maxLines="10" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@android:id/widget_frame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:minWidth="58dip"
|
||||
android:gravity="end|center_vertical"
|
||||
android:orientation="vertical" />
|
||||
|
||||
</LinearLayout>
|
@@ -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"/>
|
||||
</LinearLayout>
|
||||
|
@@ -1,27 +0,0 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<!-- Layout used for PreferenceCategory in a PreferenceActivity. -->
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@android:id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Body2"
|
||||
android:textColor="?android:attr/colorAccent"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:paddingTop="16dip" />
|
@@ -16,37 +16,46 @@
|
||||
|
||||
<!-- Layout used for ProgressCategory in bluetooth settings. -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:background="@null"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" >
|
||||
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">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/icon_container"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start|center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<com.android.internal.widget.PreferenceImageView
|
||||
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"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- This text view has the style of the list separator text view without the background and padding. -->
|
||||
<TextView
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Body2"
|
||||
android:textColor="?android:attr/colorAccent"
|
||||
android:background="@null"
|
||||
android:id="@android:id/title"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingTop="6dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="start|center"
|
||||
/>
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Body2"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/scanning_progress"
|
||||
android:text="@string/progress_scanning"
|
||||
android:paddingTop="6dp"
|
||||
style="?android:attr/progressBarStyleSmallTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="16dip"
|
||||
style="?android:attr/progressBarStyleSmallTitle"
|
||||
/>
|
||||
android:text="@string/progress_scanning"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@@ -20,18 +20,18 @@
|
||||
<LinearLayout 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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48sp"
|
||||
android:layout_height="48dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Body2"
|
||||
android:textColor="?android:attr/colorAccent"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textAlignment="viewStart"
|
||||
android:gravity="left|center_vertical"
|
||||
android:text="@string/running_processes_header_title" />
|
||||
@@ -44,12 +44,12 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32sp"
|
||||
android:layout_marginTop="8sp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="16sp"
|
||||
android:layout_height="16sp"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@color/running_processes_system_ram"
|
||||
@@ -90,11 +90,11 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32sp"
|
||||
android:layout_height="32dp"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="16sp"
|
||||
android:layout_height="16sp"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerInside"
|
||||
android:src="?android:attr/colorAccent"
|
||||
@@ -135,11 +135,11 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32sp"
|
||||
android:layout_height="32dp"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_width="16sp"
|
||||
android:layout_height="16sp"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@color/running_processes_free_ram"
|
||||
@@ -182,11 +182,11 @@
|
||||
android:id="@+id/listHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="8sp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Body2"
|
||||
android:textColor="?android:attr/colorAccent"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textAlignment="viewStart"
|
||||
android:gravity="left|center_vertical"
|
||||
android:text="@string/running_processes_header_footer" />
|
||||
|
@@ -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">
|
||||
|
||||
|
@@ -18,6 +18,9 @@
|
||||
<!-- This file only contains custom attribute and style definition for preferences -->
|
||||
<!-- Things unrelated to preference framework UI customization should go to other styles files -->
|
||||
<resources>
|
||||
|
||||
<dimen name="preference_no_icon_padding_start">72dp</dimen>
|
||||
|
||||
<style name="ApnPreference">
|
||||
<item name="android:layout">@layout/apn_preference_layout</item>
|
||||
</style>
|
||||
|
@@ -18,8 +18,7 @@
|
||||
android:title="@string/memory_usage">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/average_memory_use"
|
||||
android:layout="@layout/preference_category_short" />
|
||||
android:title="@string/average_memory_use"/>
|
||||
|
||||
<com.android.settings.SummaryPreference
|
||||
android:key="status_header"
|
||||
|
@@ -19,8 +19,7 @@
|
||||
android:title="@string/data_usage_summary_title">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/usage"
|
||||
android:layout="@layout/preference_category_short">
|
||||
android:title="@string/usage">
|
||||
|
||||
<com.android.settings.SummaryPreference
|
||||
android:key="status_header"
|
||||
|
@@ -18,8 +18,7 @@
|
||||
android:title="@string/data_usage_summary_title">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="usage_amount"
|
||||
android:layout="@layout/preference_category_short">
|
||||
android:key="usage_amount">
|
||||
|
||||
<com.android.settings.datausage.ChartDataUsagePreference
|
||||
android:key="chart_data" />
|
||||
|
@@ -29,18 +29,18 @@
|
||||
android:title="@string/battery_level_title"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
<PreferenceScreen android:key="sim_status"
|
||||
<Preference android:key="sim_status"
|
||||
android:title="@string/sim_status_title"
|
||||
android:persistent="false">
|
||||
<intent android:targetPackage="com.android.settings"
|
||||
android:targetClass="com.android.settings.Settings$SimStatusActivity" />
|
||||
</PreferenceScreen>
|
||||
<PreferenceScreen android:key="imei_info"
|
||||
</Preference>
|
||||
<Preference android:key="imei_info"
|
||||
android:title="@string/imei_information_title"
|
||||
android:persistent="false">
|
||||
<intent android:targetPackage="com.android.settings"
|
||||
android:targetClass="com.android.settings.Settings$ImeiInformationActivity" />
|
||||
</PreferenceScreen>
|
||||
</Preference>
|
||||
<com.android.settings.CopyablePreference android:key="wifi_ip_address"
|
||||
android:enabled="false"
|
||||
android:shouldDisableView="false"
|
||||
|
@@ -20,8 +20,7 @@
|
||||
android:key="app_list">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/average_memory_use"
|
||||
android:layout="@layout/preference_category_short" />
|
||||
android:title="@string/average_memory_use"/>
|
||||
|
||||
<com.android.settings.SummaryPreference
|
||||
android:key="status_header"
|
||||
|
@@ -33,16 +33,19 @@ public class ProgressCategory extends ProgressCategoryBase {
|
||||
private boolean mNoDeviceFoundAdded;
|
||||
|
||||
public ProgressCategory(Context context) {
|
||||
this(context, null);
|
||||
super(context);
|
||||
setLayoutResource(R.layout.preference_progress_category);
|
||||
}
|
||||
|
||||
public ProgressCategory(Context context, AttributeSet attrs) {
|
||||
super(context, attrs, 0);
|
||||
super(context, attrs);
|
||||
setLayoutResource(R.layout.preference_progress_category);
|
||||
}
|
||||
|
||||
public ProgressCategory(Context context, AttributeSet attrs,
|
||||
int defStyleAttr) {
|
||||
this(context, attrs, defStyleAttr, 0);
|
||||
super(context, attrs, defStyleAttr);
|
||||
setLayoutResource(R.layout.preference_progress_category);
|
||||
}
|
||||
|
||||
public ProgressCategory(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
@@ -71,7 +74,7 @@ public class ProgressCategory extends ProgressCategoryBase {
|
||||
} else {
|
||||
if (!mNoDeviceFoundAdded) {
|
||||
if (mNoDeviceFoundPreference == null) {
|
||||
mNoDeviceFoundPreference = new Preference(getPreferenceManager().getContext());
|
||||
mNoDeviceFoundPreference = new Preference(getContext());
|
||||
mNoDeviceFoundPreference.setLayoutResource(R.layout.preference_empty_list);
|
||||
mNoDeviceFoundPreference.setTitle(mEmptyTextRes);
|
||||
mNoDeviceFoundPreference.setSelectable(false);
|
||||
|
@@ -22,24 +22,25 @@ import android.util.AttributeSet;
|
||||
|
||||
public abstract class ProgressCategoryBase extends PreferenceCategory {
|
||||
public ProgressCategoryBase(Context context) {
|
||||
this(context, null);
|
||||
super(context);
|
||||
}
|
||||
|
||||
public ProgressCategoryBase(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public ProgressCategoryBase(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr, 0);
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public ProgressCategoryBase(Context context, AttributeSet attrs, int defStyleAttr,
|
||||
int defStyleRes) {
|
||||
int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn on/off the progress indicator and text on the right.
|
||||
*
|
||||
* @param progressOn whether or not the progress should be displayed
|
||||
*/
|
||||
public abstract void setProgress(boolean progressOn);
|
||||
|
@@ -52,25 +52,25 @@ import java.util.Iterator;
|
||||
public class RunningProcessesView extends FrameLayout
|
||||
implements AdapterView.OnItemClickListener, RecyclerListener,
|
||||
RunningState.OnRefreshUiListener {
|
||||
|
||||
|
||||
final int mMyUserId;
|
||||
|
||||
long SECONDARY_SERVER_MEM;
|
||||
|
||||
|
||||
final HashMap<View, ActiveItem> mActiveItems = new HashMap<View, ActiveItem>();
|
||||
|
||||
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<RunningState.MergedItem> mOrigItems;
|
||||
final ArrayList<RunningState.MergedItem> mItems
|
||||
= new ArrayList<RunningState.MergedItem>();
|
||||
|
||||
|
||||
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;
|
||||
|
@@ -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<Integer, String>(HidProfile.getHidClassDrawable(btClass),
|
||||
INPUT_PERIPHERAL);
|
||||
INPUT_PERIPHERAL);
|
||||
|
||||
case BluetoothClass.Device.Major.IMAGING:
|
||||
return new Pair<Integer, String>(R.drawable.ic_bt_imaging, IMAGING);
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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
|
||||
|
@@ -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";
|
||||
|
Reference in New Issue
Block a user