mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
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 -> {
|
is PictureInPictureEvent.SetPipOrientation -> {
|
||||||
Timber.tag(loggerTag.value).d("onOrientationChange: ${event.orientation}")
|
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
|
package io.element.android.features.call.impl.pip
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
|
|
||||||
interface PipView {
|
interface PipView {
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
fun setPipOrientation(orientation: Int?)
|
fun setPipOrientation(orientation: Int?)
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
fun setPipParams()
|
fun setPipParams()
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
fun enterPipMode(): Boolean
|
fun enterPipMode(): Boolean
|
||||||
fun hangUp()
|
fun hangUp()
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -202,7 +202,9 @@ class ElementCallActivity :
|
|||||||
}
|
}
|
||||||
DisposableEffect(Unit) {
|
DisposableEffect(Unit) {
|
||||||
val onPictureInPictureModeChangedListener = Consumer { _: PictureInPictureModeChangedInfo ->
|
val onPictureInPictureModeChangedListener = Consumer { _: PictureInPictureModeChangedInfo ->
|
||||||
setPipParams()
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
setPipParams()
|
||||||
|
}
|
||||||
pipEventSink(PictureInPictureEvent.OnPictureInPictureModeChanged(isInPictureInPictureMode))
|
pipEventSink(PictureInPictureEvent.OnPictureInPictureModeChanged(isInPictureInPictureMode))
|
||||||
if (!isInPictureInPictureMode && !lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)) {
|
if (!isInPictureInPictureMode && !lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)) {
|
||||||
Timber.tag(loggerTag.value).d("Exiting PiP mode: Hangup the call")
|
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?) {
|
override fun setPipOrientation(orientation: Int?) {
|
||||||
currentPipOrientation = orientation
|
currentPipOrientation = orientation
|
||||||
setPictureInPictureParams(getPictureInPictureParams())
|
setPictureInPictureParams(getPictureInPictureParams())
|
||||||
|
|||||||
Reference in New Issue
Block a user