improve CaptionDialog for small screens (#4831)

(or giant soft keyboards)

https://mastodon.social/@bewitchedmind/113703199056088283

Before / After

<img
src="https://github.com/user-attachments/assets/04d9f9b8-1041-4b1e-bff4-3665865a6016"
width="300"/>
<img
src="https://github.com/user-attachments/assets/f88bb67e-ecb0-460a-b22b-58cff5a4b754"
width="300"/>


This makes it also look a bit weird on large screens, but I found no
easy way to limit the size. Its now basically back to where it was in
Tusky 26.

closes https://github.com/tuskyapp/Tusky/issues/4832
This commit is contained in:
Konrad Pozniak 2024-12-27 09:05:04 +01:00 committed by GitHub
commit f9fbf5de0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -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())
}