From d472f4158049869a250939fbcaa69baf4630ed0a Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Tue, 7 Mar 2023 20:04:30 -0500 Subject: [PATCH] android: Convert HeaderViewHolder to Kotlin --- .../ui/viewholder/HeaderViewHolder.java | 32 ------------------- .../ui/viewholder/HeaderViewHolder.kt | 28 ++++++++++++++++ 2 files changed, 28 insertions(+), 32 deletions(-) delete mode 100644 src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/HeaderViewHolder.java create mode 100644 src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/HeaderViewHolder.kt diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/HeaderViewHolder.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/HeaderViewHolder.java deleted file mode 100644 index afe021149..000000000 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/HeaderViewHolder.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.yuzu.yuzu_emu.features.settings.ui.viewholder; - -import android.view.View; -import android.widget.TextView; - -import org.yuzu.yuzu_emu.R; -import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem; -import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter; - -public final class HeaderViewHolder extends SettingViewHolder { - private TextView mHeaderName; - - public HeaderViewHolder(View itemView, SettingsAdapter adapter) { - super(itemView, adapter); - itemView.setOnClickListener(null); - } - - @Override - protected void findViews(View root) { - mHeaderName = root.findViewById(R.id.text_header_name); - } - - @Override - public void bind(SettingsItem item) { - mHeaderName.setText(item.getNameId()); - } - - @Override - public void onClick(View clicked) { - // no-op - } -} \ No newline at end of file diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/HeaderViewHolder.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/HeaderViewHolder.kt new file mode 100644 index 000000000..8c0f57d63 --- /dev/null +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/HeaderViewHolder.kt @@ -0,0 +1,28 @@ +package org.yuzu.yuzu_emu.features.settings.ui.viewholder + +import android.view.View +import android.widget.TextView +import org.yuzu.yuzu_emu.R +import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem +import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter + +class HeaderViewHolder(itemView: View, adapter: SettingsAdapter) : + SettingViewHolder(itemView, adapter) { + private lateinit var headerName: TextView + + init { + itemView.setOnClickListener(null) + } + + override fun findViews(root: View) { + headerName = root.findViewById(R.id.text_header_name) + } + + override fun bind(item: SettingsItem) { + headerName.setText(item.nameId) + } + + override fun onClick(clicked: View) { + // no-op + } +}