summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorGravatar Charles Lombardo2023-03-11 00:39:53 -0500
committerGravatar bunnei2023-06-03 00:05:41 -0700
commit7a0d7bb3f309dd8f3f6cdb2fd9b9924275213193 (patch)
treedcdad5874e46154e1dc365a6a1cddaaca2f0613b /src/android
parentandroid: Remove ThemeUtil (diff)
downloadyuzu-7a0d7bb3f309dd8f3f6cdb2fd9b9924275213193.tar.gz
yuzu-7a0d7bb3f309dd8f3f6cdb2fd9b9924275213193.tar.xz
yuzu-7a0d7bb3f309dd8f3f6cdb2fd9b9924275213193.zip
android: Convert GameViewHolder to Kotlin
Diffstat (limited to 'src/android')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/viewholders/GameViewHolder.java44
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/viewholders/GameViewHolder.kt32
2 files changed, 32 insertions, 44 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/viewholders/GameViewHolder.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/viewholders/GameViewHolder.java
deleted file mode 100644
index 41b8c6a27..000000000
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/viewholders/GameViewHolder.java
+++ /dev/null
@@ -1,44 +0,0 @@
1package org.yuzu.yuzu_emu.viewholders;
2
3import android.view.View;
4import android.widget.ImageView;
5import android.widget.TextView;
6
7import androidx.recyclerview.widget.RecyclerView;
8
9import org.yuzu.yuzu_emu.R;
10
11/**
12 * A simple class that stores references to views so that the GameAdapter doesn't need to
13 * keep calling findViewById(), which is expensive.
14 */
15public class GameViewHolder extends RecyclerView.ViewHolder {
16 private View itemView;
17 public ImageView imageIcon;
18 public TextView textGameTitle;
19 public TextView textGameCaption;
20
21 public String gameId;
22
23 // TODO Not need any of this stuff. Currently only the properties dialog needs it.
24 public String path;
25 public String title;
26 public String description;
27 public String regions;
28 public String company;
29
30 public GameViewHolder(View itemView) {
31 super(itemView);
32
33 this.itemView = itemView;
34 itemView.setTag(this);
35
36 imageIcon = itemView.findViewById(R.id.image_game_screen);
37 textGameTitle = itemView.findViewById(R.id.text_game_title);
38 textGameCaption = itemView.findViewById(R.id.text_game_caption);
39 }
40
41 public View getItemView() {
42 return itemView;
43 }
44}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/viewholders/GameViewHolder.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/viewholders/GameViewHolder.kt
new file mode 100644
index 000000000..e7319107e
--- /dev/null
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/viewholders/GameViewHolder.kt
@@ -0,0 +1,32 @@
1package org.yuzu.yuzu_emu.viewholders
2
3import android.view.View
4import android.widget.ImageView
5import android.widget.TextView
6import androidx.recyclerview.widget.RecyclerView
7import org.yuzu.yuzu_emu.R
8
9/**
10 * A simple class that stores references to views so that the GameAdapter doesn't need to
11 * keep calling findViewById(), which is expensive.
12 */
13class GameViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
14 var imageIcon: ImageView
15 var textGameTitle: TextView
16 var textGameCaption: TextView
17 var gameId: String? = null
18
19 // TODO Not need any of this stuff. Currently only the properties dialog needs it.
20 var path: String? = null
21 var title: String? = null
22 var description: String? = null
23 var regions: String? = null
24 var company: String? = null
25
26 init {
27 itemView.tag = this
28 imageIcon = itemView.findViewById(R.id.image_game_screen)
29 textGameTitle = itemView.findViewById(R.id.text_game_title)
30 textGameCaption = itemView.findViewById(R.id.text_game_caption)
31 }
32}