To squash

This commit is contained in:
Benoit Marty 2021-02-23 11:27:04 +01:00 committed by Benoit Marty
parent 486815b9ab
commit 9c1475d2f1
2 changed files with 18 additions and 6 deletions

View File

@ -235,10 +235,11 @@
<activity
android:name=".features.call.VectorCallActivity"
android:excludeFromRecents="true" />
<!-- PIP Support https://developer.android.com/guide/topics/ui/picture-in-picture -->
<activity
android:name=".features.call.conference.VectorJitsiActivity"
android:configChanges="orientation|smallestScreenSize|screenLayout|screenSize"
android:resizeableActivity="true"
android:launchMode="singleTask"
android:supportsPictureInPicture="true" />
<activity android:name=".features.terms.ReviewTermsActivity" />

View File

@ -20,6 +20,8 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.pm.PackageManager
import android.content.res.Configuration
import android.os.Bundle
import android.os.Parcelable
import android.widget.FrameLayout
@ -31,6 +33,7 @@ import com.airbnb.mvrx.Success
import com.airbnb.mvrx.viewModel
import com.facebook.react.modules.core.PermissionListener
import im.vector.app.core.di.ScreenComponent
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.databinding.ActivityJitsiBinding
import kotlinx.parcelize.Parcelize
@ -81,14 +84,20 @@ class VectorJitsiActivity : VectorBaseActivity<ActivityJitsiBinding>(), JitsiMee
}
jitsiViewModel.observeViewEvents {
when(it) {
when (it) {
is JitsiCallViewEvents.StartConference -> configureJitsiView(it)
}
}.exhaustive
}
registerForBroadcastMessages()
}
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean,
newConfig: Configuration) {
super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
Timber.w("onPictureInPictureModeChanged($isInPictureInPictureMode)")
}
override fun initUiAndData() {
super.initUiAndData()
jitsiMeetView = JitsiMeetView(this)
@ -131,9 +140,9 @@ class VectorJitsiActivity : VectorBaseActivity<ActivityJitsiBinding>(), JitsiMee
jitsiMeetView?.join(jitsiMeetConferenceOptions)
}
override fun onPause() {
override fun onStop() {
JitsiMeetActivityDelegate.onHostPause(this)
super.onPause()
super.onStop()
}
override fun onResume() {
@ -154,7 +163,9 @@ class VectorJitsiActivity : VectorBaseActivity<ActivityJitsiBinding>(), JitsiMee
override fun onUserLeaveHint() {
super.onUserLeaveHint()
jitsiMeetView?.enterPictureInPicture()
if (packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
jitsiMeetView?.enterPictureInPicture()
}
}
override fun onNewIntent(intent: Intent?) {