diff options
author | Charles Lombardo <clombardo169@gmail.com> | 2023-03-08 02:05:30 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-03 09:05:37 +0200 |
commit | ed83650ee45317ba8faec32ef8e1f6acaedd802f (patch) | |
tree | c03a3610aa13ecf5ab0f060ba52ee49dbbc8179a /src/android | |
parent | android: Convert SliderViewHolder to Kotlin (diff) | |
download | yuzu-ed83650ee45317ba8faec32ef8e1f6acaedd802f.tar yuzu-ed83650ee45317ba8faec32ef8e1f6acaedd802f.tar.gz yuzu-ed83650ee45317ba8faec32ef8e1f6acaedd802f.tar.bz2 yuzu-ed83650ee45317ba8faec32ef8e1f6acaedd802f.tar.lz yuzu-ed83650ee45317ba8faec32ef8e1f6acaedd802f.tar.xz yuzu-ed83650ee45317ba8faec32ef8e1f6acaedd802f.tar.zst yuzu-ed83650ee45317ba8faec32ef8e1f6acaedd802f.zip |
Diffstat (limited to 'src/android')
2 files changed, 35 insertions, 45 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SubmenuViewHolder.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SubmenuViewHolder.java deleted file mode 100644 index 1aca4723d..000000000 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SubmenuViewHolder.java +++ /dev/null @@ -1,45 +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.model.view.SubmenuSetting; -import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter; - -public final class SubmenuViewHolder extends SettingViewHolder { - private SubmenuSetting mItem; - - private TextView mTextSettingName; - private TextView mTextSettingDescription; - - public SubmenuViewHolder(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); - } - - @Override - public void bind(SettingsItem item) { - mItem = (SubmenuSetting) item; - - mTextSettingName.setText(item.getNameId()); - - if (item.getDescriptionId() > 0) { - mTextSettingDescription.setText(item.getDescriptionId()); - mTextSettingDescription.setVisibility(View.VISIBLE); - } else { - mTextSettingDescription.setVisibility(View.GONE); - } - } - - @Override - public void onClick(View clicked) { - getAdapter().onSubmenuClick(mItem); - } -}
\ No newline at end of file diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SubmenuViewHolder.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SubmenuViewHolder.kt new file mode 100644 index 000000000..621de2911 --- /dev/null +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/SubmenuViewHolder.kt @@ -0,0 +1,35 @@ +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.model.view.SubmenuSetting +import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter + +class SubmenuViewHolder(itemView: View, adapter: SettingsAdapter) : + SettingViewHolder(itemView, adapter) { + private lateinit var item: SubmenuSetting + private lateinit var textSettingName: TextView + private lateinit var textSettingDescription: TextView + + override fun findViews(root: View) { + textSettingName = root.findViewById(R.id.text_setting_name) + textSettingDescription = root.findViewById(R.id.text_setting_description) + } + + override fun bind(item: SettingsItem) { + this.item = item as SubmenuSetting + textSettingName.setText(item.nameId) + if (item.descriptionId!! > 0) { + textSettingDescription.setText(item.descriptionId) + textSettingDescription.visibility = View.VISIBLE + } else { + textSettingDescription.visibility = View.GONE + } + } + + override fun onClick(clicked: View) { + adapter.onSubmenuClick(item) + } +} |