fix some padding issues

This commit is contained in:
Helium314 2024-01-06 16:33:37 +01:00
parent 447df7ab0d
commit 3e38253c0f
3 changed files with 5 additions and 3 deletions

View file

@ -54,7 +54,8 @@ fun loadCustomLayout(layoutContent: String, layoutName: String, localeString: St
.setView(EditText(context).apply {
setText(name)
doAfterTextChanged { name = it.toString() }
setPadding(30, 10, 30, 10)
val padding = (8 * context.resources.displayMetrics.density).toInt()
setPadding(3 * padding, padding, 3 * padding, padding)
inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_NORMAL
})
.setPositiveButton(android.R.string.ok) { _, _ ->

View file

@ -114,7 +114,8 @@ fun reorderMoreKeysDialog(context: Context, key: String, defaultSetting: String,
both.first() to both.last().toBoolean()
}
val rv = RecyclerView(context)
rv.setPadding(30, 10, 10, 10)
val padding = (8 * context.resources.displayMetrics.density).toInt()
rv.setPadding(3 * padding, padding, padding, padding)
rv.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
val callback = object : DiffUtil.ItemCallback<Pair<String, Boolean>>() {
override fun areItemsTheSame(p0: Pair<String, Boolean>, p1: Pair<String, Boolean>) = p0 == p1

View file

@ -13,7 +13,6 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="4dp"
android:hapticFeedbackEnabled="false"
android:soundEffectsEnabled="false">
<!-- Provide audio and haptic feedback by ourselves based on the keyboard settings.
@ -24,6 +23,7 @@
android:layout_height="@dimen/config_suggestions_strip_edge_key_width"
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:layout_marginStart="4dp"
style="?attr/suggestionWordStyle"
android:contentDescription="@string/more_keys_strip_description" />
<HorizontalScrollView