mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Code review fix.
This commit is contained in:
parent
23a25cf240
commit
792fca8400
2 changed files with 6 additions and 1 deletions
|
@ -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 a new issue