mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-24 19:20:15 +08:00
set android display mode
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -18,6 +18,8 @@ import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.util.Rational;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.Keep;
|
||||
@@ -150,4 +152,13 @@ public final class AndroidHelper {
|
||||
Objects.requireNonNull(MediaHelper.buildMediaButtonPendingIntent(activity, mbrComponent, action))
|
||||
);
|
||||
}
|
||||
|
||||
public static void setPreferredDisplayMode(long engineId, int mode) {
|
||||
Activity activity = JniFlutterPlugin.getActivity(engineId);
|
||||
assert activity != null;
|
||||
final Window window = activity.getWindow();
|
||||
final WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.preferredDisplayModeId = mode;
|
||||
window.setAttributes(params);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user