Under "recent location requests", add "See all"

Under Settings -> Security & Location -> Location, add "See all" button
under recent location requests

On location settings page, display at most 3 recent location requests.
If there are more than 3, show a "see all" button.
When user clicks "See all", take them to a new fragment with all recent
location requests.

Test: Robo
Test: Manual
Bug: 70350519
Change-Id: Id1f9a8da1593814a8f30f8e6ec8ac75fb10f6672
This commit is contained in:
Maggie
2018-01-26 16:30:17 -08:00
parent 45520fce49
commit 51fc2889f8
10 changed files with 418 additions and 41 deletions

View File

@@ -70,8 +70,10 @@ public class LocationSettings extends DashboardFragment {
public int getInitialExpandedChildCount() {
final RecentLocationApps recentLocationApps = new RecentLocationApps(getActivity());
final int locationRequestsApps = recentLocationApps.getAppList().size();
final int locationRequestsPrefs = locationRequestsApps == 0 ? 1 : locationRequestsApps;
return locationRequestsPrefs + 2;
final int locationRequestsPrefs =
locationRequestsApps == 0
? 1 : (locationRequestsApps > 3 ? 4 : locationRequestsApps);
return locationRequestsPrefs + 1;
}
@Override