Rename PipActivity to PipView
This commit is contained in:
parent
9fab13c50b
commit
7f4b84638f
5 changed files with 21 additions and 21 deletions
|
|
@ -35,7 +35,7 @@ class PictureInPicturePresenter @Inject constructor(
|
|||
pipSupportProvider: PipSupportProvider,
|
||||
) : Presenter<PictureInPictureState> {
|
||||
private val isPipSupported = pipSupportProvider.isPipSupported()
|
||||
private var pipActivity: PipActivity? = null
|
||||
private var pipView: PipView? = null
|
||||
|
||||
@Composable
|
||||
override fun present(): PictureInPictureState {
|
||||
|
|
@ -72,13 +72,13 @@ class PictureInPicturePresenter @Inject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
fun setPipActivity(pipActivity: PipActivity?) {
|
||||
fun setPipView(pipView: PipView?) {
|
||||
if (isPipSupported) {
|
||||
Timber.tag(loggerTag.value).d("Setting PiP params")
|
||||
this.pipActivity = pipActivity
|
||||
pipActivity?.setPipParams()
|
||||
this.pipView = pipView
|
||||
pipView?.setPipParams()
|
||||
} else {
|
||||
Timber.tag(loggerTag.value).d("onCreate: PiP is not supported")
|
||||
Timber.tag(loggerTag.value).d("setPipView: PiP is not supported")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -92,11 +92,11 @@ class PictureInPicturePresenter @Inject constructor(
|
|||
}
|
||||
if (pipController == null || pipController.canEnterPip()) {
|
||||
Timber.tag(loggerTag.value).d("Switch to PiP mode")
|
||||
pipActivity?.enterPipMode()
|
||||
pipView?.enterPipMode()
|
||||
?.also { Timber.tag(loggerTag.value).d("Switch to PiP mode result: $it") }
|
||||
} else {
|
||||
Timber.tag(loggerTag.value).w("Cannot enter PiP mode, hangup the call")
|
||||
pipActivity?.hangUp()
|
||||
pipView?.hangUp()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package io.element.android.features.call.impl.pip
|
||||
|
||||
interface PipActivity {
|
||||
interface PipView {
|
||||
fun setPipParams()
|
||||
fun enterPipMode(): Boolean
|
||||
fun hangUp()
|
||||
|
|
@ -48,7 +48,7 @@ import io.element.android.features.call.impl.di.CallBindings
|
|||
import io.element.android.features.call.impl.pip.PictureInPictureEvents
|
||||
import io.element.android.features.call.impl.pip.PictureInPicturePresenter
|
||||
import io.element.android.features.call.impl.pip.PictureInPictureState
|
||||
import io.element.android.features.call.impl.pip.PipActivity
|
||||
import io.element.android.features.call.impl.pip.PipView
|
||||
import io.element.android.features.call.impl.services.CallForegroundService
|
||||
import io.element.android.features.call.impl.utils.CallIntentDataParser
|
||||
import io.element.android.libraries.architecture.bindings
|
||||
|
|
@ -60,7 +60,7 @@ import javax.inject.Inject
|
|||
class ElementCallActivity :
|
||||
AppCompatActivity(),
|
||||
CallScreenNavigator,
|
||||
PipActivity {
|
||||
PipView {
|
||||
@Inject lateinit var callIntentDataParser: CallIntentDataParser
|
||||
@Inject lateinit var presenterFactory: CallScreenPresenter.Factory
|
||||
@Inject lateinit var appPreferencesStore: AppPreferencesStore
|
||||
|
|
@ -101,7 +101,7 @@ class ElementCallActivity :
|
|||
updateUiMode(resources.configuration)
|
||||
}
|
||||
|
||||
pictureInPicturePresenter.setPipActivity(this)
|
||||
pictureInPicturePresenter.setPipView(this)
|
||||
|
||||
audioManager = getSystemService(AUDIO_SERVICE) as AudioManager
|
||||
requestAudioFocus()
|
||||
|
|
@ -177,7 +177,7 @@ class ElementCallActivity :
|
|||
super.onDestroy()
|
||||
releaseAudioFocus()
|
||||
CallForegroundService.stop(this)
|
||||
pictureInPicturePresenter.setPipActivity(null)
|
||||
pictureInPicturePresenter.setPipView(null)
|
||||
}
|
||||
|
||||
override fun finish() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue