Merge "Add "Instant apps" filter to app listing"

This commit is contained in:
Antony Sargent
2017-02-22 18:40:40 +00:00
committed by Android (Google) Code Review
2 changed files with 19 additions and 9 deletions

View File

@@ -3456,9 +3456,9 @@
<string name="filter_dlg_title">Choose filter options</string>
<!-- Text for filter option in ManageApps screen to display all installed
applications -->
<string name="filter_apps_all">All</string>
<string name="filter_apps_all">All apps</string>
<!-- [CHAR LIMIT=NONE] Text for filter option in ManageApps screen to display disabled apps -->
<string name="filter_apps_disabled">Disabled</string>
<string name="filter_apps_disabled">Disabled apps</string>
<!-- Text for filter option in ManageApps screen to display third party
applications only -->
<string name="filter_apps_third_party">Downloaded</string>
@@ -6883,7 +6883,9 @@
<!-- Label for showing all apps in list [CHAR LIMIT=30] -->
<string name="filter_all_apps">All apps</string>
<!-- Label for showing enabled apps in list [CHAR LIMIT=30] -->
<string name="filter_enabled_apps">Enabled</string>
<string name="filter_enabled_apps">Installed apps</string>
<!-- Label for showing instant apps in list [CHAR LIMIT=30] -->
<string name="filter_instant_apps">Instant apps</string>
<!-- Label for showing personal apps in list [CHAR LIMIT=30] -->
<string name="filter_personal_apps">Personal</string>
<!-- Label for showing work apps in list [CHAR LIMIT=30] -->

View File

@@ -134,12 +134,13 @@ public class ManageApplications extends InstrumentedPreferenceFragment
public static final int FILTER_APPS_ALL = 2;
public static final int FILTER_APPS_ENABLED = 3;
public static final int FILTER_APPS_DISABLED = 4;
public static final int FILTER_APPS_BLOCKED = 5;
public static final int FILTER_APPS_PERSONAL = 6;
public static final int FILTER_APPS_WORK = 7;
public static final int FILTER_APPS_USAGE_ACCESS = 8;
public static final int FILTER_APPS_WITH_OVERLAY = 9;
public static final int FILTER_APPS_WRITE_SETTINGS = 10;
public static final int FILTER_APPS_INSTANT = 5;
public static final int FILTER_APPS_BLOCKED = 6;
public static final int FILTER_APPS_PERSONAL = 7;
public static final int FILTER_APPS_WORK = 8;
public static final int FILTER_APPS_USAGE_ACCESS = 9;
public static final int FILTER_APPS_WITH_OVERLAY = 10;
public static final int FILTER_APPS_WRITE_SETTINGS = 11;
public static final int FILTER_APPS_INSTALL_SOURCES = 12;
// Storage types. Used to determine what the extra item in the list of preferences is.
@@ -153,6 +154,7 @@ public class ManageApplications extends InstrumentedPreferenceFragment
R.string.filter_all_apps, // All apps
R.string.filter_enabled_apps, // Enabled
R.string.filter_apps_disabled, // Disabled
R.string.filter_instant_apps, // Instant apps
R.string.filter_notif_blocked_apps, // Blocked Notifications
R.string.filter_personal_apps, // Personal
R.string.filter_work_apps, // Work
@@ -172,6 +174,7 @@ public class ManageApplications extends InstrumentedPreferenceFragment
ApplicationsState.FILTER_EVERYTHING, // All apps
ApplicationsState.FILTER_ALL_ENABLED, // Enabled
ApplicationsState.FILTER_DISABLED, // Disabled
ApplicationsState.FILTER_INSTANT, // Instant
AppStateNotificationBridge.FILTER_APP_NOTIFICATION_BLOCKED, // Blocked Notifications
ApplicationsState.FILTER_PERSONAL, // Personal
ApplicationsState.FILTER_WORK, // Work
@@ -694,6 +697,10 @@ public class ManageApplications extends InstrumentedPreferenceFragment
mFilterAdapter.setFilterEnabled(FILTER_APPS_DISABLED, hasDisabledApps);
}
public void setHasInstant(boolean haveInstantApps) {
mFilterAdapter.setFilterEnabled(FILTER_APPS_INSTANT, haveInstantApps);
}
static class FilterSpinnerAdapter extends ArrayAdapter<CharSequence> {
private final ManageApplications mManageApplications;
@@ -1047,6 +1054,7 @@ public class ManageApplications extends InstrumentedPreferenceFragment
}
mManageApplications.setHasDisabled(mState.haveDisabledApps());
mManageApplications.setHasInstant(mState.haveInstantApps());
}
private void rebuildSections() {