From 72abe07284a1bc1a7fa5c8bb36a872c9d42e4c2b Mon Sep 17 00:00:00 2001 From: darthpaul Date: Mon, 7 Nov 2022 17:47:59 +0000 Subject: [PATCH] remove duplicate layouts, use commons --- .../keyboard/dialogs/KeyboardRadioGroupDialog.kt | 8 ++++---- app/src/main/res/layout/dialog_radio_group.xml | 16 ---------------- app/src/main/res/layout/radio_button_item.xml | 5 ----- 3 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 app/src/main/res/layout/dialog_radio_group.xml delete mode 100644 app/src/main/res/layout/radio_button_item.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/dialogs/KeyboardRadioGroupDialog.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/dialogs/KeyboardRadioGroupDialog.kt index bf9770f..578e501 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/dialogs/KeyboardRadioGroupDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/dialogs/KeyboardRadioGroupDialog.kt @@ -6,13 +6,13 @@ import android.view.View import android.view.ViewGroup import android.widget.RadioButton import android.widget.RadioGroup +import android.widget.ScrollView import androidx.appcompat.app.AlertDialog import com.simplemobiletools.commons.extensions.onGlobalLayout import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.keyboard.R import com.simplemobiletools.keyboard.extensions.getKeyboardDialogBuilder import com.simplemobiletools.keyboard.extensions.setupKeyboardDialogStuff -import kotlinx.android.synthetic.main.dialog_radio_group.view.* class KeyboardRadioGroupDialog( private val inputView: View, @@ -31,7 +31,7 @@ class KeyboardRadioGroupDialog( init { val view = layoutInflater.inflate(R.layout.dialog_radio_group, null) - view.dialog_radio_group.apply { + val radioGroup = view.findViewById(R.id.dialog_radio_group).apply { for (i in 0 until items.size) { val radioButton = (layoutInflater.inflate(R.layout.radio_button, null) as RadioButton).apply { text = items[i].title @@ -62,9 +62,9 @@ class KeyboardRadioGroupDialog( } if (selectedItemId != -1) { - view.dialog_radio_holder.apply { + view.findViewById(R.id.dialog_radio_holder).apply { onGlobalLayout { - scrollY = view.dialog_radio_group.findViewById(selectedItemId).bottom - height + scrollY = radioGroup.findViewById(selectedItemId).bottom - height } } } diff --git a/app/src/main/res/layout/dialog_radio_group.xml b/app/src/main/res/layout/dialog_radio_group.xml deleted file mode 100644 index d081a64..0000000 --- a/app/src/main/res/layout/dialog_radio_group.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/app/src/main/res/layout/radio_button_item.xml b/app/src/main/res/layout/radio_button_item.xml deleted file mode 100644 index 1e1ff71..0000000 --- a/app/src/main/res/layout/radio_button_item.xml +++ /dev/null @@ -1,5 +0,0 @@ - -