mirror of
https://github.com/PabloMK7/citra.git
synced 2025-07-23 12:56:51 +00:00
Update Header Setting to allow for a description under tht title
This commit is contained in:
parent
f1b328920c
commit
6335cb6155
3 changed files with 29 additions and 6 deletions
src/android/app/src/main
java/org/citra/citra_emu/features/settings
res/layout
|
@ -4,6 +4,6 @@
|
||||||
|
|
||||||
package org.citra.citra_emu.features.settings.model.view
|
package org.citra.citra_emu.features.settings.model.view
|
||||||
|
|
||||||
class HeaderSetting(titleId: Int) : SettingsItem(null, titleId, 0) {
|
class HeaderSetting(titleId: Int,descId: Int = 0) : SettingsItem(null, titleId, descId) {
|
||||||
override val type = TYPE_HEADER
|
override val type = TYPE_HEADER
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,12 @@ class HeaderViewHolder(val binding: ListItemSettingsHeaderBinding, adapter: Sett
|
||||||
|
|
||||||
override fun bind(item: SettingsItem) {
|
override fun bind(item: SettingsItem) {
|
||||||
binding.textHeaderName.setText(item.nameId)
|
binding.textHeaderName.setText(item.nameId)
|
||||||
|
if (item.descriptionId != 0) {
|
||||||
|
binding.textHeaderDescription.visibility = View.VISIBLE
|
||||||
|
binding.textHeaderDescription.setText(item.descriptionId)
|
||||||
|
}else {
|
||||||
|
binding.textHeaderDescription.visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClick(clicked: View) {
|
override fun onClick(clicked: View) {
|
||||||
|
|
|
@ -1,16 +1,33 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:focusable="false"
|
||||||
|
android:clickable="false"
|
||||||
|
android:paddingVertical="16dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
|
||||||
android:id="@+id/text_header_name"
|
android:id="@+id/text_header_name"
|
||||||
style="@style/TextAppearance.Material3.TitleSmall"
|
style="@style/TextAppearance.Material3.TitleSmall"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="start|center_vertical"
|
android:layout_gravity="start|center_vertical"
|
||||||
android:paddingHorizontal="@dimen/spacing_large"
|
|
||||||
android:paddingVertical="16dp"
|
|
||||||
android:focusable="false"
|
|
||||||
android:clickable="false"
|
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
android:textColor="?attr/colorPrimary"
|
android:textColor="?attr/colorPrimary"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:text="CPU Settings" />
|
tools:text="CPU Settings" />
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:id="@+id/text_header_description"
|
||||||
|
style="@style/TextAppearance.Material3.BodySmall"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/spacing_small"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
tools:text="@string/app_disclaimer" />
|
||||||
|
</LinearLayout>
|
Loading…
Add table
Add a link
Reference in a new issue