Modify Running Services layout

- Also remove some unused resource

Fixes: 139911198
Test: manual
Change-Id: I70447255df822c5b2a940ecbc3f2fa27707c660b
Screenshot: https://screenshot.googleplex.com/jBEdhunufTb
This commit is contained in:
Raff Tsai
2019-10-24 14:31:54 +08:00
parent 5b4f01e4b2
commit 52ee4888be
13 changed files with 97 additions and 296 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 B

View File

@@ -1,65 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
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.DeviceDefault.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.DeviceDefault.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>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/widget_summary1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"/>
<TextView
android:id="@+id/widget_summary2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"/>
</LinearLayout>

View File

@@ -55,38 +55,29 @@
android:scaleType="centerInside"
android:src="@color/running_processes_system_ram"
android:contentDescription="@null" />
<LinearLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal">
android:layout_gravity="center">
<TextView
android:id="@+id/systemSizePrefix"
android:text="@string/running_processes_header_system_prefix"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
android:textColor="?android:attr/textColorSecondary"
android:layout_alignParentStart="true"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="16dp"
android:maxLines="1" />
<ImageView
android:src="@drawable/dotted_line_480px"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="1px"
android:layout_marginStart="1dip"
android:layout_marginEnd="1dip"
android:baselineAlignBottom="true"
android:scaleType="center"
android:contentDescription="@null" />
<TextView
android:id="@+id/systemSize"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
android:textColor="?android:attr/textColorSecondary"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentEnd="true"
android:maxLines="1" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
@@ -100,7 +91,7 @@
android:scaleType="centerInside"
android:src="?android:attr/colorAccent"
android:contentDescription="@null" />
<LinearLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
@@ -113,25 +104,17 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="16dp"
android:layout_alignParentStart="true"
android:maxLines="1" />
<ImageView
android:src="@drawable/dotted_line_480px"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="1px"
android:baselineAlignBottom="true"
android:layout_marginStart="1dip"
android:layout_marginEnd="1dip"
android:scaleType="center"
android:contentDescription="@null" />
<TextView
android:id="@+id/appsSize"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
android:textColor="?android:attr/textColorSecondary"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentEnd="true"
android:maxLines="1" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
@@ -145,7 +128,7 @@
android:scaleType="centerInside"
android:src="@color/running_processes_free_ram"
android:contentDescription="@null" />
<LinearLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
@@ -158,25 +141,17 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="16dp"
android:layout_alignParentStart="true"
android:maxLines="1" />
<ImageView
android:src="@drawable/dotted_line_480px"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="1px"
android:baselineAlignBottom="true"
android:layout_marginStart="1dip"
android:layout_marginEnd="1dip"
android:scaleType="center"
android:contentDescription="@null" />
<TextView
android:id="@+id/freeSize"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
android:textColor="?android:attr/textColorSecondary"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentEnd="true"
android:maxLines="1" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<TextView

View File

@@ -17,71 +17,19 @@
*/
-->
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingTop="8dip"
android:paddingBottom="8dip"
android:columnCount="2">
<ImageView
android:id="@+id/icon"
android:layout_width="@android:dimen/app_icon_size"
android:layout_height="@android:dimen/app_icon_size"
android:layout_rowSpan="2"
android:layout_marginEnd="8dip"
android:scaleType="centerInside"
android:contentDescription="@null" />
<LinearLayout
android:layout_width="0dip"
android:layout_gravity="fill_horizontal"
android:layout_marginTop="2dip">
<TextView
android:id="@+id/name"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead"
android:textAlignment="viewStart" />
<TextView
android:id="@+id/size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dip"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
<LinearLayout
android:layout_width="0dip"
android:layout_gravity="fill_horizontal|top">
<TextView
android:id="@+id/description"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
android:textColor="?android:attr/textColorSecondary"
android:textAlignment="viewStart" />
<TextView
android:id="@+id/uptime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dip"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
</GridLayout>
android:layout_height="match_parent">
<include
android:layout_width="60dp"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:id="@+id/widget_summary"
layout="@layout/preference_widget_two_summary"/>
<include
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toStartOf="@id/widget_summary"
layout="@layout/preference_material"/>
</RelativeLayout>

View File

@@ -15,26 +15,31 @@
* limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ListView
android:id="@android:id/list"
style="@style/PreferenceFragmentListSinglePane"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1">
<ListView android:id="@android:id/list"
style="@style/PreferenceFragmentListSinglePane"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawSelectorOnTop="false"
android:scrollbarStyle="outsideOverlay"
android:fastScrollEnabled="true" />
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/no_running_services"
android:textAppearance="?android:attr/textAppearanceLarge" />
android:layout_height="match_parent"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:drawSelectorOnTop="false"
android:scrollbarStyle="outsideOverlay"
android:fastScrollEnabled="true"/>
<TextView
android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/no_running_services"
android:textAppearance="?android:attr/textAppearanceLarge"/>
</FrameLayout>
</LinearLayout>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2008, 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.
*/
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
style="?android:attr/listSeparatorTextViewStyle" />

View File

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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.
-->
<!-- Based on frameworks/base/core/res/res/layout/preference_category_material.xml.
except has paddingBottom set.-->
<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="16dip"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"
android:textColor="?android:attr/colorAccent"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingBottom="8dp"
android:paddingTop="16dip" />

View File

@@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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:orientation="horizontal"
android:duplicateParentState="true">
<TextView
android:id="@+id/widget_text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="fill_horizontal|top"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
android:textColor="?android:attr/textColorSecondary"
android:textAlignment="viewStart"
android:singleLine="true"
android:ellipsize="marquee"
android:duplicateParentState="true" />
<TextView
android:id="@+id/widget_text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="8dip"
android:layout_gravity="fill_horizontal|top"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
android:textColor="?android:attr/textColorSecondary"
android:textAlignment="viewEnd"
android:singleLine="true"
android:ellipsize="marquee"
android:duplicateParentState="true" />
</LinearLayout>

View File

@@ -164,11 +164,11 @@ public class RunningProcessesView extends FrameLayout
public ViewHolder(View v) {
rootView = v;
icon = (ImageView)v.findViewById(R.id.icon);
name = (TextView)v.findViewById(R.id.name);
description = (TextView)v.findViewById(R.id.description);
size = (TextView)v.findViewById(R.id.size);
uptime = (TextView)v.findViewById(R.id.uptime);
icon = v.findViewById(android.R.id.icon);
name = v.findViewById(android.R.id.title);
description = v.findViewById(android.R.id.summary);
size = v.findViewById(R.id.widget_summary1);
uptime = v.findViewById(R.id.widget_summary2);
v.setTag(this);
}

View File

@@ -226,7 +226,7 @@ public class RunningServiceDetails extends InstrumentedFragment
void addServicesHeader() {
if (mNumServices == 0) {
mServicesHeader = (TextView)mInflater.inflate(R.layout.separator_label,
mServicesHeader = (TextView) mInflater.inflate(R.layout.preference_category,
mAllDetails, false);
mServicesHeader.setText(R.string.runningservicedetails_services_title);
mAllDetails.addView(mServicesHeader);
@@ -236,7 +236,7 @@ public class RunningServiceDetails extends InstrumentedFragment
void addProcessesHeader() {
if (mNumProcesses == 0) {
mProcessesHeader = (TextView)mInflater.inflate(R.layout.separator_label,
mProcessesHeader = (TextView) mInflater.inflate(R.layout.preference_category,
mAllDetails, false);
mProcessesHeader.setText(R.string.runningservicedetails_processes_title);
mAllDetails.addView(mProcessesHeader);