summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
diff options
context:
space:
mode:
authorTony Mak <tonymak@google.com>2017-11-24 16:40:03 +0800
committerTony Mak <tonymak@google.com>2017-11-29 20:37:11 +0000
commit6ffe4e0eeeb3c33909737e3918d6030cc5e347ad (patch)
tree45bcaaafc7d6583222755c3fe553f5b2f0c9791f /src/com/android/launcher3/allapps/AlphabeticalAppsList.java
parent0c2d9b0f3e65fefc74520479d963613055ef6ccf (diff)
downloadandroid_packages_apps_Trebuchet-6ffe4e0eeeb3c33909737e3918d6030cc5e347ad.tar.gz
android_packages_apps_Trebuchet-6ffe4e0eeeb3c33909737e3918d6030cc5e347ad.tar.bz2
android_packages_apps_Trebuchet-6ffe4e0eeeb3c33909737e3918d6030cc5e347ad.zip
Add work profile footer in work tab
Screenshot(work mode is on): https://hsv.googleplex.com/6279751685636096 Screenshot (work mode is off): https://hsv.googleplex.com/6279751685636096 TODO: It is just the UX bit, once the platform change is in, we should then consume the new API to 1. Turn on / off work mode 2. Get the organization name and set the textview accordingly. BUG=69905244 Change-Id: Id94ae57625d6b629dac89c1c28f8d65f395fff6c
Diffstat (limited to 'src/com/android/launcher3/allapps/AlphabeticalAppsList.java')
-rw-r--r--src/com/android/launcher3/allapps/AlphabeticalAppsList.java28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index 7cf2d9564..12715cba2 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -140,9 +140,9 @@ public class AlphabeticalAppsList {
return item;
}
- public static AdapterItem asMarketDivider(int pos) {
+ public static AdapterItem asAllAppsDivider(int pos) {
AdapterItem item = new AdapterItem();
- item.viewType = AllAppsGridAdapter.VIEW_TYPE_SEARCH_MARKET_DIVIDER;
+ item.viewType = AllAppsGridAdapter.VIEW_TYPE_ALL_APPS_DIVIDER;
item.position = pos;
return item;
}
@@ -160,6 +160,13 @@ public class AlphabeticalAppsList {
item.position = pos;
return item;
}
+
+ public static AdapterItem asWorkTabFooter(int pos) {
+ AdapterItem item = new AdapterItem();
+ item.viewType = AllAppsGridAdapter.VIEW_TYPE_WORK_TAB_FOOTER;
+ item.position = pos;
+ return item;
+ }
}
private final Launcher mLauncher;
@@ -179,6 +186,8 @@ public class AlphabeticalAppsList {
// The set of predicted apps resolved from the component names and the current set of apps
private final List<AppInfo> mPredictedApps = new ArrayList<>();
private final List<AppDiscoveryAppInfo> mDiscoveredApps = new ArrayList<>();
+ // Is it the work profile app list.
+ private final boolean mIsWork;
// The of ordered component names as a result of a search query
private ArrayList<ComponentKey> mSearchResults;
@@ -191,11 +200,16 @@ public class AlphabeticalAppsList {
private int mNumAppRowsInAdapter;
private ItemInfoMatcher mItemFilter;
- public AlphabeticalAppsList(Context context, HashMap<ComponentKey, AppInfo> componentToAppMap) {
+ public AlphabeticalAppsList(
+ Context context,
+ HashMap<ComponentKey,
+ AppInfo> componentToAppMap,
+ boolean isWork) {
mComponentToAppMap = componentToAppMap;
mLauncher = Launcher.getLauncher(context);
mIndexer = new AlphabeticIndexCompat(context);
mAppNameComparator = new AppInfoComparator(context);
+ mIsWork = isWork;
}
public void updateItemFilter(ItemInfoMatcher itemFilter) {
@@ -545,7 +559,7 @@ public class AlphabeticalAppsList {
if (hasNoFilteredResults()) {
mAdapterItems.add(AdapterItem.asEmptySearch(position++));
} else {
- mAdapterItems.add(AdapterItem.asMarketDivider(position++));
+ mAdapterItems.add(AdapterItem.asAllAppsDivider(position++));
}
mAdapterItems.add(AdapterItem.asMarketSearch(position++));
}
@@ -604,6 +618,12 @@ public class AlphabeticalAppsList {
break;
}
}
+
+ // Add the work profile footer if required.
+ if (mIsWork) {
+ mAdapterItems.add(AdapterItem.asAllAppsDivider(position++));
+ mAdapterItems.add(AdapterItem.asWorkTabFooter(position++));
+ }
}
public boolean isAppDiscoveryRunning() {