From 83365ec6ea34a7f266a19c3a7aa478ac160c515c Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Fri, 26 May 2017 12:58:44 -0700 Subject: [PATCH] Update recently opened app string and "see all" summary Change-Id: I84a01f01ac1c685db87970c3137f30ba58c800b3 Fix: 62040104 Test: make RunSettingsRoboTests --- AndroidManifest.xml | 2 -- res/values/strings.xml | 4 ++-- res/xml/app_and_notification.xml | 1 - .../RecentAppsPreferenceController.java | 14 +++++++++++--- .../RecentAppsPreferenceControllerTest.java | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index e09b4b176d4..8a50b01854f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2530,8 +2530,6 @@ - Allow all app sources - Recently used apps + Recently opened - See all apps + See all %1$d installed apps diff --git a/res/xml/app_and_notification.xml b/res/xml/app_and_notification.xml index 9ddff85aa31..47fc3785b13 100644 --- a/res/xml/app_and_notification.xml +++ b/res/xml/app_and_notification.xml @@ -30,7 +30,6 @@ recentApps = getDisplayableRecentAppList(); if (recentApps != null && !recentApps.isEmpty()) { + mHasRecentApps = true; displayRecentApps(prefContext, recentApps); } else { + mHasRecentApps = false; displayOnlyAppInfo(); } } @@ -185,7 +193,7 @@ public class RecentAppsPreferenceController extends PreferenceController private void displayRecentApps(Context prefContext, List recentApps) { mCategory.setTitle(R.string.recent_app_category_title); - mSeeAllPref.setTitle(R.string.see_all_apps_title); + mSeeAllPref.setSummary(null); mSeeAllPref.setIcon(R.drawable.ic_chevron_right_24dp); // Rebind prefs/avoid adding new prefs if possible. Adding/removing prefs causes jank. diff --git a/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java index c28eed03d4d..4ddea135284 100644 --- a/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/applications/RecentAppsPreferenceControllerTest.java @@ -178,7 +178,7 @@ public class RecentAppsPreferenceControllerTest { // it's invalid app. verify(mCategory, times(1)).addPreference(any(Preference.class)); - verify(mSeeAllPref).setTitle(R.string.see_all_apps_title); + verify(mSeeAllPref).setSummary(null); verify(mSeeAllPref).setIcon(R.drawable.ic_chevron_right_24dp); }