android: Add game thumbnail to EmulationFragment nav drawer (#809)
Some checks failed
citra-build / windows (msys2) (push) Has been cancelled
citra-build / android (push) Has been cancelled
citra-build / ios (push) Has been cancelled
citra-format / clang-format (push) Has been cancelled
citra-transifex / transifex (push) Has been cancelled
citra-build / source (push) Has been cancelled
citra-build / linux (appimage) (push) Has been cancelled
citra-build / linux (fresh) (push) Has been cancelled
citra-build / macos (arm64) (push) Has been cancelled
citra-build / macos (x86_64) (push) Has been cancelled
citra-build / windows (msvc) (push) Has been cancelled
citra-build / macos-universal (push) Has been cancelled

* android: Add game thumbnail to `EmulationFragment` nav drawer

* Updated license header

* EmulationFragment.kt: Corrected formatting

* header_in_game.xml: Changed placeholder text

---------

Co-authored-by: Kleidis <167202775+kleidis@users.noreply.github.com>
This commit is contained in:
OpenSauce 2025-03-30 15:19:55 +01:00 committed by GitHub
parent e6199780a5
commit 5ade69f5f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 11 deletions

View file

@ -1,4 +1,4 @@
// Copyright 2023 Citra Emulator Project
// Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
@ -22,6 +22,7 @@ import android.view.Surface
import android.view.SurfaceHolder
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.PopupMenu
import android.widget.TextView
import android.widget.Toast
@ -232,8 +233,15 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
)
}
binding.inGameMenu.getHeaderView(0).findViewById<TextView>(R.id.text_game_title).text =
game.title
binding.inGameMenu.getHeaderView(0).apply {
val titleView = findViewById<TextView>(R.id.text_game_title)
val iconView = findViewById<ImageView>(R.id.game_icon)
titleView.text = game.title
GameIconUtils.loadGameIcon(requireActivity(), game, iconView)
}
binding.inGameMenu.setNavigationItemSelectedListener {
when (it.itemId) {
R.id.menu_emulation_pause -> {

View file

@ -1,14 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.textview.MaterialTextView
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/text_game_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="24dp"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:textAppearance="?attr/textAppearanceHeadlineMedium"
android:textColor="?attr/colorOnSurface"
android:textAlignment="viewStart"
tools:text="Super Mario 3D Land" />
android:layout_marginEnd="24dp">
<ImageView
android:id="@+id/game_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="16dp"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text_game_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?attr/textAppearanceHeadlineMedium"
android:textColor="?attr/colorOnSurface"
android:textAlignment="viewStart"
tools:text="text_game_title" />
</LinearLayout>