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