Make Process Stats more beautiful
- update padding layouts for being consistent with the rest of the Settings App See bug: #15384992 Setting Dashboard - padding updates Change-Id: I1813eec92a97e4cd9adb4a9c9852c8cd03c38a05
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!--Label for the item-->
|
||||
<TextView
|
||||
android:id="@+id/label"
|
||||
@@ -31,8 +32,8 @@
|
||||
android:layout_toStartOf="@+id/value"
|
||||
android:layout_marginBottom="4dip"
|
||||
android:layout_marginTop="4dip"
|
||||
android:layout_marginStart="4dip"
|
||||
android:layout_marginEnd="4dip"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/value"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -42,6 +43,6 @@
|
||||
android:textStyle="normal"
|
||||
android:singleLine="true"
|
||||
android:layout_marginBottom="4dip"
|
||||
android:layout_marginTop="4dip"
|
||||
android:layout_marginEnd="10dip"/>
|
||||
android:layout_marginTop="4dip" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@@ -25,6 +25,8 @@
|
||||
android:id="@+id/all_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:paddingTop="5dip"
|
||||
android:paddingBottom="5dip"
|
||||
android:orientation="vertical">
|
||||
@@ -33,61 +35,62 @@
|
||||
|
||||
<!-- Force stop and report buttons -->
|
||||
<LinearLayout
|
||||
android:id="@+id/two_buttons_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="6dip"
|
||||
android:orientation="vertical">
|
||||
android:id="@+id/two_buttons_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="6dip"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
layout="@layout/two_buttons_panel"/>
|
||||
layout="@layout/two_buttons_panel"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:text="@string/details_subtitle" />
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:text="@string/details_subtitle" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="6dip"
|
||||
android:orientation="vertical">
|
||||
android:id="@+id/details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="6dip"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Insert detail items here -->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/controls"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:id="@+id/controls"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/controls_title"
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:layout_marginTop="6dip"
|
||||
android:text="@string/controls_subtitle" />
|
||||
android:id="@+id/controls_title"
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:layout_marginTop="6dip"
|
||||
android:text="@string/controls_subtitle" />
|
||||
|
||||
<!-- Controls go here ... -->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/packages_section_title"
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:layout_marginTop="6dip"
|
||||
android:text="@string/packages_subtitle" />
|
||||
android:id="@+id/packages_section_title"
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:layout_marginTop="6dip"
|
||||
android:text="@string/packages_subtitle" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/packages_section"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="6dip"
|
||||
android:orientation="vertical">
|
||||
android:id="@+id/packages_section"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="6dip"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Insert detail items here -->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
@@ -17,7 +17,9 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||
android:paddingEnd="?android:attr/scrollbarSize">
|
||||
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"
|
||||
@@ -31,4 +33,5 @@
|
||||
android:shadowDx="2"
|
||||
android:shadowDy="2">
|
||||
</com.android.settings.applications.LinearColorBar>
|
||||
|
||||
</FrameLayout>
|
@@ -31,46 +31,54 @@
|
||||
|
||||
<include layout="@layout/app_percentage_item" />
|
||||
|
||||
<!-- Force stop and report buttons -->
|
||||
<LinearLayout
|
||||
android:id="@+id/two_buttons_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="6dip"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
layout="@layout/two_buttons_panel"/>
|
||||
</LinearLayout>
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:text="@string/details_subtitle" />
|
||||
<!-- Force stop and report buttons -->
|
||||
<LinearLayout
|
||||
android:id="@+id/two_buttons_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="6dip"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="6dip"
|
||||
android:orientation="vertical">
|
||||
<include layout="@layout/two_buttons_panel"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Insert detail items here -->
|
||||
<TextView
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:text="@string/details_subtitle" />
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:text="@string/services_subtitle" />
|
||||
<!-- Insert detail items here -->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/services"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="6dip"
|
||||
android:orientation="vertical">
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Insert service items here -->
|
||||
<TextView
|
||||
style="?android:attr/listSeparatorTextViewStyle"
|
||||
android:text="@string/services_subtitle" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/services"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Insert service items here -->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
@@ -21,20 +21,37 @@ import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.preference.Preference;
|
||||
import android.text.format.Formatter;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import com.android.settings.R;
|
||||
|
||||
public class ProcessStatsPreference extends Preference {
|
||||
private final ProcStatsEntry mEntry;
|
||||
private ProcStatsEntry mEntry;
|
||||
private int mProgress;
|
||||
private CharSequence mProgressText;
|
||||
|
||||
public ProcessStatsPreference(Context context, Drawable icon, ProcStatsEntry entry) {
|
||||
super(context);
|
||||
mEntry = entry;
|
||||
public ProcessStatsPreference(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public ProcessStatsPreference(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public ProcessStatsPreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
this(context, attrs, defStyleAttr, 0);
|
||||
}
|
||||
|
||||
public ProcessStatsPreference(Context context, AttributeSet attrs, int defStyleAttr,
|
||||
int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
setLayoutResource(R.layout.app_percentage_item);
|
||||
}
|
||||
|
||||
public void init(Drawable icon, ProcStatsEntry entry) {
|
||||
mEntry = entry;
|
||||
setIcon(icon != null ? icon : new ColorDrawable(0));
|
||||
}
|
||||
|
||||
|
@@ -579,7 +579,8 @@ public class ProcessStatsUi extends PreferenceFragment
|
||||
+ " time=" + percentOfTime);
|
||||
continue;
|
||||
}
|
||||
ProcessStatsPreference pref = new ProcessStatsPreference(getActivity(), null, proc);
|
||||
ProcessStatsPreference pref = new ProcessStatsPreference(getActivity());
|
||||
pref.init(null, proc);
|
||||
proc.evaluateTargetPackage(pm, mStats, totals, sEntryCompare, mUseUss,
|
||||
mStatsType == MENU_TYPE_BACKGROUND);
|
||||
proc.retrieveUiData(pm);
|
||||
|
Reference in New Issue
Block a user