From e249c00a3ca1993bf429ca93c82a4d70ec210400 Mon Sep 17 00:00:00 2001 From: Doris Ling Date: Thu, 4 May 2017 14:33:52 -0700 Subject: [PATCH] Limit the summary text for App info->Permissions to one line. - the summary text is the list of permissions that the app has. It is dynamic, and when the list is long, setting the summary will expand the text view height and make the page launch looks janky. We cannot pre-set the summary to certain line, since the permissions list for each app is unknown beforehand. To avoid the jank, limit the summary to 1 line and truncate it if necessary. Change-Id: I1acb1ac9f46c55808ce03626e53cf71502231ab2 Fix: 36413664 Test: make RunSettingsRoboTests --- res/xml/installed_app_details_ia.xml | 2 +- .../widget/SingleLineSummaryPreference.java | 42 +++++++++++ .../SingleLineSummaryPreferenceTest.java | 69 +++++++++++++++++++ 3 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 src/com/android/settings/widget/SingleLineSummaryPreference.java create mode 100644 tests/robotests/src/com/android/settings/widget/SingleLineSummaryPreferenceTest.java diff --git a/res/xml/installed_app_details_ia.xml b/res/xml/installed_app_details_ia.xml index 538205f8343..5f8e8660587 100644 --- a/res/xml/installed_app_details_ia.xml +++ b/res/xml/installed_app_details_ia.xml @@ -40,7 +40,7 @@ android:title="@string/notifications_label" android:selectable="true"/> -