summaryrefslogtreecommitdiffstats
path: root/src/android/app
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-03-08 02:04:42 +0100
committerbunnei <bunneidev@gmail.com>2023-06-03 09:05:37 +0200
commitc42eb92557f842a2944d4d248d89d7143e2788c7 (patch)
tree6de5bc844b1b1faa63491857ed0577ac2f59efe5 /src/android/app
parentandroid: Convert HeaderViewHolder to Kotlin (diff)
downloadyuzu-c42eb92557f842a2944d4d248d89d7143e2788c7.tar
yuzu-c42eb92557f842a2944d4d248d89d7143e2788c7.tar.gz
yuzu-c42eb92557f842a2944d4d248d89d7143e2788c7.tar.bz2
yuzu-c42eb92557f842a2944d4d248d89d7143e2788c7.tar.lz
yuzu-c42eb92557f842a2944d4d248d89d7143e2788c7.tar.xz
yuzu-c42eb92557f842a2944d4d248d89d7143e2788c7.tar.zst
yuzu-c42eb92557f842a2944d4d248d89d7143e2788c7.zip
Diffstat (limited to 'src/android/app')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SettingViewHolder.java49
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SettingViewHolder.kt38
2 files changed, 38 insertions, 49 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SettingViewHolder.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SettingViewHolder.java
deleted file mode 100644
index 268b7c386..000000000
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SettingViewHolder.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.yuzu.yuzu_emu.features.settings.ui.viewholder;
-
-import android.view.View;
-
-import androidx.recyclerview.widget.RecyclerView;
-
-import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem;
-import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter;
-
-public abstract class SettingViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
- private SettingsAdapter mAdapter;
-
- public SettingViewHolder(View itemView, SettingsAdapter adapter) {
- super(itemView);
-
- mAdapter = adapter;
-
- itemView.setOnClickListener(this);
-
- findViews(itemView);
- }
-
- protected SettingsAdapter getAdapter() {
- return mAdapter;
- }
-
- /**
- * Gets handles to all this ViewHolder's child views using their XML-defined identifiers.
- *
- * @param root The newly inflated top-level view.
- */
- protected abstract void findViews(View root);
-
- /**
- * Called by the adapter to set this ViewHolder's child views to display the list item
- * it must now represent.
- *
- * @param item The list item that should be represented by this ViewHolder.
- */
- public abstract void bind(SettingsItem item);
-
- /**
- * Called when this ViewHolder's view is clicked on. Implementations should usually pass
- * this event up to the adapter.
- *
- * @param clicked The view that was clicked on.
- */
- public abstract void onClick(View clicked);
-}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SettingViewHolder.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SettingViewHolder.kt
new file mode 100644
index 000000000..f09b7087b
--- /dev/null
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SettingViewHolder.kt
@@ -0,0 +1,38 @@
+package org.yuzu.yuzu_emu.features.settings.ui.viewholder
+
+import android.view.View
+import androidx.recyclerview.widget.RecyclerView
+import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem
+import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter
+
+abstract class SettingViewHolder(itemView: View, protected val adapter: SettingsAdapter) :
+ RecyclerView.ViewHolder(itemView), View.OnClickListener {
+
+ init {
+ itemView.setOnClickListener(this)
+ findViews(itemView)
+ }
+
+ /**
+ * Gets handles to all this ViewHolder's child views using their XML-defined identifiers.
+ *
+ * @param root The newly inflated top-level view.
+ */
+ protected abstract fun findViews(root: View)
+
+ /**
+ * Called by the adapter to set this ViewHolder's child views to display the list item
+ * it must now represent.
+ *
+ * @param item The list item that should be represented by this ViewHolder.
+ */
+ abstract fun bind(item: SettingsItem)
+
+ /**
+ * Called when this ViewHolder's view is clicked on. Implementations should usually pass
+ * this event up to the adapter.
+ *
+ * @param clicked The view that was clicked on.
+ */
+ abstract override fun onClick(clicked: View)
+}