Moving taskbar lifecycle to TouchInteractionService

> Inflating taskbar views with a non-launcher window context
> Removing separate taskbar view in Launcher
> Handling taskbar icon clicks directly instead of going via launcher
> Fixing some relayouts during show/hide animation

Bug: 187353581
Test: Manual
Change-Id: Ia7d44acbb770bf0345922234b3daa5cc040a5843
This commit is contained in:
Sunny Goyal
2021-05-05 14:04:11 -07:00
parent eed1711038
commit e215fb730b
29 changed files with 948 additions and 982 deletions

View File

@@ -16,7 +16,8 @@
package com.android.launcher3.taskbar;
import android.content.Context;
import static android.view.Display.DEFAULT_DISPLAY;
import android.content.Intent;
import android.view.inputmethod.InputMethodManager;
@@ -53,11 +54,10 @@ public class TaskbarNavButtonController {
static final int BUTTON_RECENTS = BUTTON_HOME << 1;
static final int BUTTON_IME_SWITCH = BUTTON_RECENTS << 1;
private final TouchInteractionService mService;
private final Context mContext;
public TaskbarNavButtonController(Context context) {
mContext = context;
public TaskbarNavButtonController(TouchInteractionService service) {
mService = service;
}
public void onButtonClick(@TaskbarButton int buttonType) {
@@ -78,13 +78,13 @@ public class TaskbarNavButtonController {
}
private void navigateHome() {
mContext.startActivity(new Intent(Intent.ACTION_MAIN)
mService.startActivity(new Intent(Intent.ACTION_MAIN)
.addCategory(Intent.CATEGORY_HOME)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
private void navigateToOverview() {
TouchInteractionService.getInstance().getOverviewCommandHelper()
mService.getOverviewCommandHelper()
.addCommand(OverviewCommandHelper.TYPE_SHOW);
}
@@ -93,8 +93,8 @@ public class TaskbarNavButtonController {
}
private void showIMESwitcher() {
mContext.getSystemService(InputMethodManager.class).showInputMethodPickerFromSystem(
true /* showAuxiliarySubtypes */, mContext.getDisplayId());
mService.getSystemService(InputMethodManager.class)
.showInputMethodPickerFromSystem(true /* showAuxiliarySubtypes */,
DEFAULT_DISPLAY);
}
}