mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
Merge pull request #7515 from element-hq/feature/bma/fixLint
Fix lint issue, ensure that PiP methods are not called on old devices not supporting them.
This commit is contained in:
+3
-1
@@ -60,7 +60,9 @@ class PictureInPicturePresenter(
|
||||
}
|
||||
is PictureInPictureEvent.SetPipOrientation -> {
|
||||
Timber.tag(loggerTag.value).d("onOrientationChange: ${event.orientation}")
|
||||
pipView?.setPipOrientation(event.orientation)
|
||||
if (isPipSupported) {
|
||||
pipView?.setPipOrientation(event.orientation)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -8,9 +8,15 @@
|
||||
|
||||
package io.element.android.features.call.impl.pip
|
||||
|
||||
import android.os.Build
|
||||
import androidx.annotation.RequiresApi
|
||||
|
||||
interface PipView {
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
fun setPipOrientation(orientation: Int?)
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
fun setPipParams()
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
fun enterPipMode(): Boolean
|
||||
fun hangUp()
|
||||
}
|
||||
|
||||
+4
-1
@@ -202,7 +202,9 @@ class ElementCallActivity :
|
||||
}
|
||||
DisposableEffect(Unit) {
|
||||
val onPictureInPictureModeChangedListener = Consumer { _: PictureInPictureModeChangedInfo ->
|
||||
setPipParams()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
setPipParams()
|
||||
}
|
||||
pipEventSink(PictureInPictureEvent.OnPictureInPictureModeChanged(isInPictureInPictureMode))
|
||||
if (!isInPictureInPictureMode && !lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)) {
|
||||
Timber.tag(loggerTag.value).d("Exiting PiP mode: Hangup the call")
|
||||
@@ -300,6 +302,7 @@ class ElementCallActivity :
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun setPipOrientation(orientation: Int?) {
|
||||
currentPipOrientation = orientation
|
||||
setPictureInPictureParams(getPictureInPictureParams())
|
||||
|
||||
Reference in New Issue
Block a user