mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Reload the task list when multiwindow mode changes
Bug: 73097187 Change-Id: I05d8635f78451600cbb8a9c03515e60d3c32e1ae
This commit is contained in:
@@ -20,6 +20,7 @@ import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Point;
|
||||
import android.view.Display;
|
||||
import android.view.View.AccessibilityDelegate;
|
||||
@@ -33,6 +34,8 @@ import java.util.ArrayList;
|
||||
public abstract class BaseActivity extends Activity {
|
||||
|
||||
private final ArrayList<OnDeviceProfileChangeListener> mDPChangeListeners = new ArrayList<>();
|
||||
private final ArrayList<MultiWindowModeChangedListener> mMultiWindowModeChangedListeners =
|
||||
new ArrayList<>();
|
||||
|
||||
protected DeviceProfile mDeviceProfile;
|
||||
protected UserEventDispatcher mUserEventDispatcher;
|
||||
@@ -100,6 +103,14 @@ public abstract class BaseActivity extends Activity {
|
||||
super.onUserLeaveHint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMultiWindowModeChanged(boolean isInMultiWindowMode, Configuration newConfig) {
|
||||
super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig);
|
||||
for (int i = mMultiWindowModeChangedListeners.size() - 1; i >= 0; i--) {
|
||||
mMultiWindowModeChangedListeners.get(i).onMultiWindowModeChanged(isInMultiWindowMode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
mStarted = false;
|
||||
@@ -129,6 +140,14 @@ public abstract class BaseActivity extends Activity {
|
||||
}
|
||||
}
|
||||
|
||||
public void addMultiWindowModeChangedListener(MultiWindowModeChangedListener listener) {
|
||||
mMultiWindowModeChangedListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeMultiWindowModeChangedListener(MultiWindowModeChangedListener listener) {
|
||||
mMultiWindowModeChangedListeners.remove(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to set the override visibility state, used only to handle the transition home with the
|
||||
* recents animation.
|
||||
@@ -157,4 +176,8 @@ public abstract class BaseActivity extends Activity {
|
||||
mDeviceProfile = mDeviceProfile.getMultiWindowProfile(this, mwSize);
|
||||
}
|
||||
}
|
||||
|
||||
public interface MultiWindowModeChangedListener {
|
||||
void onMultiWindowModeChanged(boolean isInMultiWindowMode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user