diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/FieldEditLine.kt b/AnkiDroid/src/main/java/com/ichi2/anki/FieldEditLine.kt index 23dd2db691d7..f0fe10860001 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/FieldEditLine.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/FieldEditLine.kt @@ -87,7 +87,7 @@ class FieldEditLine : FrameLayout { setExpanderBackgroundImage() expandButton.setOnClickListener { toggleExpansionState() } editText.init() - label.setPadding(getDensityAdjustedValue(context, 3.4f).toInt(), 0, 0, 0) + label.setPaddingRelative(getDensityAdjustedValue(context, 3.4f).toInt(), 0, 0, 0) } private fun toggleExpansionState() { diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/WhiteBoardWidthDialog.kt b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/WhiteBoardWidthDialog.kt index 8d7870def0bf..6e984e173311 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/WhiteBoardWidthDialog.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/WhiteBoardWidthDialog.kt @@ -59,7 +59,7 @@ class WhiteBoardWidthDialog( fun showStrokeWidthDialog() { val layout = LinearLayout(context) layout.orientation = LinearLayout.VERTICAL - layout.setPadding(6, 6, 6, 6) + layout.setPaddingRelative(6, 6, 6, 6) strokeWidthText = FixedTextView(context) strokeWidthText!!.gravity = Gravity.CENTER_HORIZONTAL strokeWidthText!!.textSize = 30f diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsArrayAdapter.kt b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsArrayAdapter.kt index 3f4c3e942b84..3a1c37d180fa 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsArrayAdapter.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/tags/TagsArrayAdapter.kt @@ -296,6 +296,8 @@ class TagsArrayAdapter( // shift according to the level val lp = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT) lp.setMargins(HIERARCHY_SHIFT_BASE * holder.node.level, 0, 0, 0) + lp.setMarginStart(HIERARCHY_SHIFT_BASE * holder.node.level) + lp.setMarginEnd(0) holder.expandButton.layoutParams = lp } else { // do not add padding if there is no visible nested tag diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/multimedia/audio/AudioRecordingController.kt b/AnkiDroid/src/main/java/com/ichi2/anki/multimedia/audio/AudioRecordingController.kt index 815fe3636480..7775f732e3d1 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/multimedia/audio/AudioRecordingController.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/multimedia/audio/AudioRecordingController.kt @@ -167,7 +167,7 @@ class AudioRecordingController( FixedTextView(this).apply { text = field?.text textSize = 16f - setPadding(16, 0, 16, 24) + setPaddingRelative(16, 0, 16, 24) previewLayout.addView(this) } hasTextContents = hasTextContents or !field?.text.isNullOrBlank() diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/noteeditor/Toolbar.kt b/AnkiDroid/src/main/java/com/ichi2/anki/noteeditor/Toolbar.kt index 1d7032b42a93..29ac505d0861 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/noteeditor/Toolbar.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/noteeditor/Toolbar.kt @@ -205,7 +205,7 @@ class Toolbar : FrameLayout { params.gravity = Gravity.CENTER button.layoutParams = params val twoDp = ceil((2 / context.resources.displayMetrics.density).toDouble()).toInt() - button.setPadding(twoDp, twoDp, twoDp, twoDp) + button.setPaddingRelative(twoDp, twoDp, twoDp, twoDp) // end apply style val shouldScroll = AnkiDroidApp.instance diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/widgets/DeckAdapter.kt b/AnkiDroid/src/main/java/com/ichi2/anki/widgets/DeckAdapter.kt index b8a53aea89ae..4ceee26c1983 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/widgets/DeckAdapter.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/widgets/DeckAdapter.kt @@ -178,17 +178,17 @@ class DeckAdapter( val node = filteredDeckList[position] // Set the expander icon and padding according to whether or not there are any subdecks val deckLayout = holder.deckLayout - val rightPadding = deckLayout.resources.getDimension(R.dimen.deck_picker_right_padding).toInt() + val endPadding = deckLayout.resources.getDimension(R.dimen.deck_picker_right_padding).toInt() if (hasSubdecks) { val smallPadding = deckLayout.resources.getDimension(R.dimen.deck_picker_left_padding_small).toInt() - deckLayout.setPadding(smallPadding, 0, rightPadding, 0) + deckLayout.setPaddingRelative(smallPadding, 0, endPadding, 0) holder.deckExpander.visibility = View.VISIBLE // Create the correct expander for this deck runBlocking { setDeckExpander(holder.deckExpander, holder.indentView, node) } } else { holder.deckExpander.visibility = View.GONE val normalPadding = deckLayout.resources.getDimension(R.dimen.deck_picker_left_padding).toInt() - deckLayout.setPadding(normalPadding, 0, rightPadding, 0) + deckLayout.setPaddingRelative(normalPadding, 0, endPadding, 0) } if (node.children.isNotEmpty()) { holder.deckExpander.tag = node.did diff --git a/AnkiDroid/src/main/res/drawable/ic_baseline_check_box_24_inset.xml b/AnkiDroid/src/main/res/drawable/ic_baseline_check_box_24_inset.xml index e3149a390355..251a11da1441 100644 --- a/AnkiDroid/src/main/res/drawable/ic_baseline_check_box_24_inset.xml +++ b/AnkiDroid/src/main/res/drawable/ic_baseline_check_box_24_inset.xml @@ -1,4 +1,4 @@ \ No newline at end of file + android:paddingStart="12dp" /> \ No newline at end of file diff --git a/AnkiDroid/src/main/res/drawable/ic_baseline_check_box_outline_blank_24_inset.xml b/AnkiDroid/src/main/res/drawable/ic_baseline_check_box_outline_blank_24_inset.xml index a6a49517ee62..a5dac75a8919 100644 --- a/AnkiDroid/src/main/res/drawable/ic_baseline_check_box_outline_blank_24_inset.xml +++ b/AnkiDroid/src/main/res/drawable/ic_baseline_check_box_outline_blank_24_inset.xml @@ -1,4 +1,4 @@ \ No newline at end of file + android:paddingStart="12dp" /> \ No newline at end of file diff --git a/AnkiDroid/src/main/res/drawable/ic_baseline_indeterminate_check_box_24_inset.xml b/AnkiDroid/src/main/res/drawable/ic_baseline_indeterminate_check_box_24_inset.xml index 1099c9b3750d..62b945546a47 100644 --- a/AnkiDroid/src/main/res/drawable/ic_baseline_indeterminate_check_box_24_inset.xml +++ b/AnkiDroid/src/main/res/drawable/ic_baseline_indeterminate_check_box_24_inset.xml @@ -1,4 +1,4 @@ \ No newline at end of file + android:paddingStart="12dp" /> \ No newline at end of file diff --git a/AnkiDroid/src/main/res/layout/card_browser_item_my_searches_dialog.xml b/AnkiDroid/src/main/res/layout/card_browser_item_my_searches_dialog.xml index 2dfa0f5ec2ec..c22189a5cb3f 100644 --- a/AnkiDroid/src/main/res/layout/card_browser_item_my_searches_dialog.xml +++ b/AnkiDroid/src/main/res/layout/card_browser_item_my_searches_dialog.xml @@ -5,8 +5,8 @@ android:layout_height="wrap_content" android:descendantFocusability="blocksDescendants" android:paddingTop="8dp" - android:paddingLeft="32dp" - android:paddingRight="32dp" + android:paddingStart="32dp" + android:paddingEnd="32dp" android:paddingBottom="8dp"> diff --git a/AnkiDroid/src/main/res/layout/feedback.xml b/AnkiDroid/src/main/res/layout/feedback.xml index 237344a8f002..93be089850e9 100644 --- a/AnkiDroid/src/main/res/layout/feedback.xml +++ b/AnkiDroid/src/main/res/layout/feedback.xml @@ -5,8 +5,8 @@ android:gravity="center_vertical" android:orientation="vertical" android:paddingBottom="10dp" - android:paddingLeft="5dp" - android:paddingRight="5dp" + android:paddingStart="5dp" + android:paddingEnd="5dp" android:paddingTop="10dp" >