mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Various multi-window fixes
> Fixing scale up calculator for swipe-down > Offsetting pivot so that the preview is aligned to bottom-right > Allowing insets to be available in multi-window mode as well > Offsetting taskViewSimulator appropriately in multi-window mode Change-Id: I7da4c145efca72ef219a5ffcaf23d726812df270
This commit is contained in:
@@ -24,6 +24,7 @@ import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.LauncherApps;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.os.Process;
|
||||
@@ -31,6 +32,7 @@ import android.os.StrictMode;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
import android.view.ActionMode;
|
||||
import android.view.Display;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.Toast;
|
||||
@@ -270,4 +272,16 @@ public abstract class BaseDraggingActivity extends BaseActivity
|
||||
}
|
||||
|
||||
protected abstract void reapplyUi();
|
||||
|
||||
protected Rect getMultiWindowDisplaySize() {
|
||||
if (Utilities.ATLEAST_R) {
|
||||
return new Rect(getWindowManager().getCurrentWindowMetrics().getBounds());
|
||||
}
|
||||
// Note: Calls to getSize() can't rely on our cached DefaultDisplay since it can return
|
||||
// the app window size
|
||||
Display display = getWindowManager().getDefaultDisplay();
|
||||
Point mwSize = new Point();
|
||||
display.getSize(mwSize);
|
||||
return new Rect(0, 0, mwSize.x, mwSize.y);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user