Code review fix.
This commit is contained in:
parent
23a25cf240
commit
792fca8400
|
@ -41,6 +41,7 @@ import im.vector.app.databinding.ActivityWidgetBinding
|
|||
import im.vector.app.features.widgets.permissions.RoomWidgetPermissionBottomSheet
|
||||
import im.vector.app.features.widgets.permissions.RoomWidgetPermissionViewEvents
|
||||
import im.vector.app.features.widgets.permissions.RoomWidgetPermissionViewModel
|
||||
import org.matrix.android.sdk.api.extensions.orFalse
|
||||
import org.matrix.android.sdk.api.session.events.model.Content
|
||||
import java.io.Serializable
|
||||
|
||||
|
@ -145,7 +146,7 @@ class WidgetActivity : VectorBaseActivity<ActivityWidgetBinding>() {
|
|||
override fun onUserLeaveHint() {
|
||||
super.onUserLeaveHint()
|
||||
val widgetArgs: WidgetArgs? = intent?.extras?.getParcelable(Mavericks.KEY_ARG)
|
||||
if (widgetArgs?.kind == WidgetKind.ELEMENT_CALL) {
|
||||
if (widgetArgs?.kind?.supportsPictureInPictureMode().orFalse()) {
|
||||
enterPictureInPicture()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,10 @@ enum class WidgetKind(@StringRes val nameRes: Int, val screenId: String?) {
|
|||
fun isAdmin(): Boolean {
|
||||
return this == STICKER_PICKER || this == INTEGRATION_MANAGER
|
||||
}
|
||||
|
||||
fun supportsPictureInPictureMode(): Boolean {
|
||||
return this == ELEMENT_CALL
|
||||
}
|
||||
}
|
||||
|
||||
data class WidgetViewState(
|
||||
|
|
Loading…
Reference in New Issue