mirror of
https://github.com/azahar-emu/azahar
synced 2025-11-06 23:19:57 +01:00
android: Add game thumbnail to EmulationFragment nav drawer (#809)
* 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:
parent
e6199780a5
commit
5ade69f5f4
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2023 Citra Emulator Project
|
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
@ -22,6 +22,7 @@ import android.view.Surface
|
|||||||
import android.view.SurfaceHolder
|
import android.view.SurfaceHolder
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.widget.ImageView
|
||||||
import android.widget.PopupMenu
|
import android.widget.PopupMenu
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import android.widget.Toast
|
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 =
|
binding.inGameMenu.getHeaderView(0).apply {
|
||||||
game.title
|
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 {
|
binding.inGameMenu.setNavigationItemSelectedListener {
|
||||||
when (it.itemId) {
|
when (it.itemId) {
|
||||||
R.id.menu_emulation_pause -> {
|
R.id.menu_emulation_pause -> {
|
||||||
|
|||||||
@ -1,14 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.google.android.material.textview.MaterialTextView
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/text_game_title"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
android:layout_marginStart="24dp"
|
android:layout_marginStart="24dp"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp">
|
||||||
android:textAppearance="?attr/textAppearanceHeadlineMedium"
|
|
||||||
android:textColor="?attr/colorOnSurface"
|
<ImageView
|
||||||
android:textAlignment="viewStart"
|
android:id="@+id/game_icon"
|
||||||
tools:text="Super Mario 3D Land" />
|
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>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user