diff --git a/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerActivity.kt b/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerActivity.kt index 418b5b5cbb..f909418d6f 100644 --- a/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerActivity.kt +++ b/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerActivity.kt @@ -33,6 +33,7 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import androidx.core.view.GestureDetectorCompat import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat import androidx.core.view.isVisible import androidx.core.view.updatePadding import androidx.transition.TransitionManager @@ -124,9 +125,11 @@ abstract class AttachmentViewerActivity : AppCompatActivity(), AttachmentEventLi scaleDetector = createScaleGestureDetector() ViewCompat.setOnApplyWindowInsetsListener(views.rootContainer) { _, insets -> - overlayView?.updatePadding(top = insets.systemWindowInsetTop, bottom = insets.systemWindowInsetBottom) - topInset = insets.systemWindowInsetTop - bottomInset = insets.systemWindowInsetBottom + val systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) + + overlayView?.updatePadding(top = systemBarsInsets.top, bottom = systemBarsInsets.bottom) + topInset = systemBarsInsets.top + bottomInset = systemBarsInsets.bottom insets } } diff --git a/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewFragment.kt b/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewFragment.kt index 9594f89a0e..0e46cb2c78 100644 --- a/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewFragment.kt +++ b/vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewFragment.kt @@ -30,6 +30,7 @@ import android.view.ViewGroup import android.widget.Toast import androidx.core.net.toUri import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat import androidx.core.view.updateLayoutParams import androidx.core.view.updatePadding import androidx.recyclerview.widget.LinearLayoutManager @@ -172,12 +173,14 @@ class AttachmentsPreviewFragment @Inject constructor( view?.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION } ViewCompat.setOnApplyWindowInsetsListener(views.attachmentPreviewerBottomContainer) { v, insets -> - v.updatePadding(bottom = insets.systemWindowInsetBottom) + val systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) + v.updatePadding(bottom = systemBarsInsets.bottom) insets } ViewCompat.setOnApplyWindowInsetsListener(views.attachmentPreviewerToolbar) { v, insets -> + val systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) v.updateLayoutParams { - topMargin = insets.systemWindowInsetTop + topMargin = systemBarsInsets.top } insets } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt index 2257e5ee81..45c937ca5e 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt @@ -41,8 +41,8 @@ class ComposerEditText @JvmOverloads constructor(context: Context, attrs: Attrib var callback: Callback? = null - override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection { - val ic: InputConnection = super.onCreateInputConnection(editorInfo) + override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection? { + val ic = super.onCreateInputConnection(editorInfo) ?: return null EditorInfoCompat.setContentMimeTypes(editorInfo, arrayOf("*/*")) val callback = diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt b/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt index e7cafc6a9b..35cc95f3dc 100755 --- a/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt @@ -559,9 +559,8 @@ class NotificationUtils @Inject constructor(private val context: Context, NotificationCompat.Action.Builder(R.drawable.vector_notification_quick_reply, stringProvider.getString(R.string.action_quick_reply), replyPendingIntent) .addRemoteInput(remoteInput) - .build()?.let { - addAction(it) - } + .build() + .let { addAction(it) } } }