mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-08 20:14:51 +08:00
@@ -20,6 +20,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@Keep
|
||||
public final class AndroidHelper {
|
||||
public static volatile boolean isPipMode = false;
|
||||
|
||||
public static volatile boolean isPipAvailable = false;
|
||||
|
||||
private AndroidHelper() {
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,9 @@ class MainActivity : AudioServiceActivity() {
|
||||
window.attributes.layoutInDisplayCutoutMode =
|
||||
LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
|
||||
}
|
||||
|
||||
AndroidHelper.isPipAvailable =
|
||||
packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
@@ -52,8 +55,6 @@ class MainActivity : AudioServiceActivity() {
|
||||
isInPictureInPictureMode: Boolean, newConfig: Configuration?
|
||||
) {
|
||||
super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
|
||||
MethodChannel(flutterEngine!!.dartExecutor.binaryMessenger, "floating").invokeMethod(
|
||||
"onPipChanged", isInPictureInPictureMode
|
||||
)
|
||||
AndroidHelper.isPipMode = isInPictureInPictureMode
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user