mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Merge "Fixing out of order taskbar callbacks" into sc-v2-dev
This commit is contained in:
@@ -132,7 +132,7 @@ public abstract class BaseQuickstepLauncher extends Launcher
|
||||
|
||||
unbindService(mTisBinderConnection);
|
||||
if (mTaskbarManager != null) {
|
||||
mTaskbarManager.setLauncher(null);
|
||||
mTaskbarManager.clearLauncher(this);
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@@ -98,11 +98,11 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
onLauncherResumedOrPaused(false);
|
||||
mIconAlignmentForResumedState.finishAnimation();
|
||||
mIconAlignmentForGestureState.finishAnimation();
|
||||
|
||||
mHotseatController.cleanup();
|
||||
setTaskbarViewVisible(true);
|
||||
mLauncher.getHotseat().setIconsAlpha(1f);
|
||||
mLauncher.setTaskbarUIController(null);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import android.content.Context;
|
||||
import android.hardware.display.DisplayManager;
|
||||
import android.view.Display;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.launcher3.BaseQuickstepLauncher;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
@@ -103,14 +103,25 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets or clears a launcher to act as taskbar callback
|
||||
* Sets a launcher to act as taskbar callback
|
||||
*/
|
||||
public void setLauncher(@Nullable BaseQuickstepLauncher launcher) {
|
||||
public void setLauncher(@NonNull BaseQuickstepLauncher launcher) {
|
||||
mLauncher = launcher;
|
||||
if (mTaskbarActivityContext != null) {
|
||||
mTaskbarActivityContext.setUIController(mLauncher == null
|
||||
? TaskbarUIController.DEFAULT
|
||||
: new LauncherTaskbarUIController(launcher, mTaskbarActivityContext));
|
||||
mTaskbarActivityContext.setUIController(
|
||||
new LauncherTaskbarUIController(launcher, mTaskbarActivityContext));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears a previously set Launcher
|
||||
*/
|
||||
public void clearLauncher(@NonNull BaseQuickstepLauncher launcher) {
|
||||
if (mLauncher == launcher) {
|
||||
mLauncher = null;
|
||||
if (mTaskbarActivityContext != null) {
|
||||
mTaskbarActivityContext.setUIController(TaskbarUIController.DEFAULT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user