summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.java54
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.kt41
2 files changed, 41 insertions, 54 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.java
deleted file mode 100644
index 2b05739e7..000000000
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.yuzu.yuzu_emu.features.settings.ui.viewholder;
-
-import android.view.View;
-import android.widget.CheckBox;
-import android.widget.TextView;
-
-import org.yuzu.yuzu_emu.R;
-import org.yuzu.yuzu_emu.features.settings.model.view.CheckBoxSetting;
-import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem;
-import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter;
-
-public final class CheckBoxSettingViewHolder extends SettingViewHolder {
- private CheckBoxSetting mItem;
-
- private TextView mTextSettingName;
- private TextView mTextSettingDescription;
-
- private CheckBox mCheckbox;
-
- public CheckBoxSettingViewHolder(View itemView, SettingsAdapter adapter) {
- super(itemView, adapter);
- }
-
- @Override
- protected void findViews(View root) {
- mTextSettingName = root.findViewById(R.id.text_setting_name);
- mTextSettingDescription = root.findViewById(R.id.text_setting_description);
- mCheckbox = root.findViewById(R.id.checkbox);
- }
-
- @Override
- public void bind(SettingsItem item) {
- mItem = (CheckBoxSetting) item;
-
- mTextSettingName.setText(item.getNameId());
-
- if (item.getDescriptionId() > 0) {
- mTextSettingDescription.setText(item.getDescriptionId());
- mTextSettingDescription.setVisibility(View.VISIBLE);
- } else {
- mTextSettingDescription.setText("");
- mTextSettingDescription.setVisibility(View.GONE);
- }
-
- mCheckbox.setChecked(mItem.isChecked());
- }
-
- @Override
- public void onClick(View clicked) {
- mCheckbox.toggle();
-
- getAdapter().onBooleanClick(mItem, getAdapterPosition(), mCheckbox.isChecked());
- }
-}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.kt
new file mode 100644
index 000000000..5f9d564db
--- /dev/null
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.kt
@@ -0,0 +1,41 @@
+package org.yuzu.yuzu_emu.features.settings.ui.viewholder
+
+import android.view.View
+import android.widget.CheckBox
+import android.widget.TextView
+import org.yuzu.yuzu_emu.R
+import org.yuzu.yuzu_emu.features.settings.model.view.CheckBoxSetting
+import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem
+import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter
+
+class CheckBoxSettingViewHolder(itemView: View, adapter: SettingsAdapter) :
+ SettingViewHolder(itemView, adapter) {
+ private lateinit var item: CheckBoxSetting
+ private lateinit var textSettingName: TextView
+ private lateinit var textSettingDescription: TextView
+ private lateinit var checkbox: CheckBox
+
+ override fun findViews(root: View) {
+ textSettingName = root.findViewById(R.id.text_setting_name)
+ textSettingDescription = root.findViewById(R.id.text_setting_description)
+ checkbox = root.findViewById(R.id.checkbox)
+ }
+
+ override fun bind(item: SettingsItem) {
+ this.item = item as CheckBoxSetting
+ textSettingName.setText(item.nameId)
+ if (item.descriptionId!! > 0) {
+ textSettingDescription.setText(item.descriptionId)
+ textSettingDescription.visibility = View.VISIBLE
+ } else {
+ textSettingDescription.text = ""
+ textSettingDescription.visibility = View.GONE
+ }
+ checkbox.isChecked = this.item.isChecked
+ }
+
+ override fun onClick(clicked: View) {
+ checkbox.toggle()
+ adapter.onBooleanClick(item, bindingAdapterPosition, checkbox.isChecked)
+ }
+}