Extract common codes for personal / work profile tabs
These codes can be reused in the FullWidgetsSheet which we will be
adding tabs for personal / work profile.
Test: Set up work profile and then switch person / work profile tabs
in the AllAppsContainerView.
Bug: 179797520
Change-Id: Ib7eb1190e1384a664cbe3e34411c9362f1f6db03
This commit is contained in:
@@ -87,17 +87,18 @@ public class LauncherAllAppsContainerView extends AllAppsContainerView {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabChanged(int pos) {
|
||||
super.onTabChanged(pos);
|
||||
public void onActivePageChanged(int currentActivePage) {
|
||||
super.onActivePageChanged(currentActivePage);
|
||||
if (mUsingTabs) {
|
||||
// Log tab switches only when the launcher is in AllApps state
|
||||
if (mLauncher.getStateManager().getCurrentStableState() == LauncherState.ALL_APPS) {
|
||||
mLauncher.getStatsLogManager().logger()
|
||||
.log(pos == AdapterHolder.WORK ? LAUNCHER_ALLAPPS_SWITCHED_TO_WORK_TAB
|
||||
.log(currentActivePage == AdapterHolder.WORK
|
||||
? LAUNCHER_ALLAPPS_SWITCHED_TO_WORK_TAB
|
||||
: LAUNCHER_ALLAPPS_SWITCHED_TO_MAIN_TAB);
|
||||
}
|
||||
|
||||
if (pos == AdapterHolder.WORK) {
|
||||
if (currentActivePage == AdapterHolder.WORK) {
|
||||
WorkEduView.showWorkEduIfNeeded(mLauncher);
|
||||
} else {
|
||||
mWorkTabListener = WorkEduView.showEduFlowIfNeeded(mLauncher, mWorkTabListener);
|
||||
|
||||
Reference in New Issue
Block a user