From 61ec54748c79083fe8681b7134d02c897f697e73 Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Wed, 25 Dec 2024 10:34:19 +0100 Subject: [PATCH] improve CaptionDialog for small screens --- .../tusky/components/compose/dialog/CaptionDialog.kt | 5 +++++ app/src/main/res/values/dimens.xml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/compose/dialog/CaptionDialog.kt b/app/src/main/java/com/keylesspalace/tusky/components/compose/dialog/CaptionDialog.kt index be7ff237c9..8a60473797 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/compose/dialog/CaptionDialog.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/compose/dialog/CaptionDialog.kt @@ -49,8 +49,13 @@ class CaptionDialog : DialogFragment() { override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { val localId = arguments?.getInt(LOCAL_ID_ARG) ?: error("Missing localId") + val inset = requireContext().resources.getDimensionPixelSize(R.dimen.caption_dialog_inset) return MaterialAlertDialogBuilder(requireContext()) .setView(createView(savedInstanceState)) + .setBackgroundInsetTop(inset) + .setBackgroundInsetEnd(inset) + .setBackgroundInsetBottom(inset) + .setBackgroundInsetStart(inset) .setPositiveButton(android.R.string.ok) { _, _ -> listener.onUpdateDescription(localId, binding.imageDescriptionText.text.toString()) } diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 0d867eac08..c0e64436aa 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -79,4 +79,6 @@ 88dp 32dp + 24dp +