summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorGravatar Charles Lombardo2023-04-02 16:42:59 -0400
committerGravatar bunnei2023-06-03 00:05:48 -0700
commitac417a4ffabea0227572e9900d4b0e6f160087cc (patch)
treee9bbc22ccfad9cc147e0629e2fe3f6c7d8dd938b /src/android
parentandroid: Fix check for ok text in software keyboard (diff)
downloadyuzu-ac417a4ffabea0227572e9900d4b0e6f160087cc.tar.gz
yuzu-ac417a4ffabea0227572e9900d4b0e6f160087cc.tar.xz
yuzu-ac417a4ffabea0227572e9900d4b0e6f160087cc.zip
android: Only show company text view if it has content
Diffstat (limited to 'src/android')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt
index 0295801ad..d4613fa8c 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/GameAdapter.kt
@@ -77,11 +77,6 @@ class GameAdapter(private val activity: AppCompatActivity) : RecyclerView.Adapte
77 } 77 }
78 } 78 }
79 79
80 holder.binding.textGameTitle.text =
81 cursor!!.getString(GameDatabase.GAME_COLUMN_TITLE)
82 .replace("[\\t\\n\\r]+".toRegex(), " ")
83 holder.binding.textGameCaption.text = cursor!!.getString(GameDatabase.GAME_COLUMN_CAPTION)
84
85 // TODO These shouldn't be necessary once the move to a DB-based model is complete. 80 // TODO These shouldn't be necessary once the move to a DB-based model is complete.
86 val game = Game( 81 val game = Game(
87 cursor!!.getString(GameDatabase.GAME_COLUMN_TITLE), 82 cursor!!.getString(GameDatabase.GAME_COLUMN_TITLE),
@@ -92,6 +87,14 @@ class GameAdapter(private val activity: AppCompatActivity) : RecyclerView.Adapte
92 cursor!!.getString(GameDatabase.GAME_COLUMN_CAPTION) 87 cursor!!.getString(GameDatabase.GAME_COLUMN_CAPTION)
93 ) 88 )
94 holder.game = game 89 holder.game = game
90
91 holder.binding.textGameTitle.text = game.title.replace("[\\t\\n\\r]+".toRegex(), " ")
92 holder.binding.textGameCaption.text = game.company
93
94 if (game.company.isEmpty()) {
95 holder.binding.textGameCaption.visibility = View.GONE
96 }
97
95 val backgroundColorId = 98 val backgroundColorId =
96 if (isValidGame(holder.game.path)) R.attr.colorSurface else R.attr.colorErrorContainer 99 if (isValidGame(holder.game.path)) R.attr.colorSurface else R.attr.colorErrorContainer
97 val itemView = holder.itemView 100 val itemView = holder.itemView