Skip to content

Commit 3646217

Browse files
snowtimeglassdavid-allison
authored andcommitted
Add consistent padding to Custom study menu items
Co-authored-by: lukstbit <[email protected]> Each item in Custom study menu may need more than one line, but the current layout (suitable for single-line items) doesn't give the items a sufficient and consistent padding. This PR intends to add the sufficient and consistent padding between the items even if each of the items has more than one line.
1 parent 5b7087f commit 3646217

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

AnkiDroid/src/main/java/com/ichi2/anki/dialogs/customstudy/CustomStudyDialog.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import androidx.appcompat.app.AlertDialog
3838
import androidx.core.content.edit
3939
import androidx.core.os.bundleOf
4040
import androidx.core.view.isVisible
41+
import androidx.core.view.updatePadding
4142
import androidx.core.widget.doAfterTextChanged
4243
import androidx.fragment.app.setFragmentResult
4344
import androidx.lifecycle.lifecycleScope
@@ -248,6 +249,10 @@ class CustomStudyDialog : AnalyticsDialogFragment() {
248249
}.forEach { (menuItem, isItemEnabled) ->
249250
(layoutInflater.inflate(android.R.layout.simple_list_item_1, container, false) as TextView)
250251
.apply {
252+
updatePadding(
253+
top = 12.dp.toPx(requireContext()),
254+
bottom = 12.dp.toPx(requireContext()),
255+
)
251256
text = menuItem.getTitle(requireContext().resources)
252257
isEnabled = isItemEnabled
253258
setBackgroundResource(ta.resourceId)

0 commit comments

Comments
 (0)