From 8b800e58f67c8aeb96c02086439c3e435054c0a7 Mon Sep 17 00:00:00 2001 From: David Griswold Date: Fri, 27 Sep 2024 11:57:14 +0100 Subject: [PATCH] Update Header Setting to allow for a description under the title Co-authored-by: OpenSauce04 --- .../settings/model/view/HeaderSetting.kt | 4 +-- .../ui/viewholder/HeaderViewHolder.kt | 8 +++++- .../res/layout/list_item_settings_header.xml | 27 +++++++++++++++---- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/android/app/src/main/java/io/github/lime3ds/android/features/settings/model/view/HeaderSetting.kt b/src/android/app/src/main/java/io/github/lime3ds/android/features/settings/model/view/HeaderSetting.kt index c83bfe503..1c1debf77 100644 --- a/src/android/app/src/main/java/io/github/lime3ds/android/features/settings/model/view/HeaderSetting.kt +++ b/src/android/app/src/main/java/io/github/lime3ds/android/features/settings/model/view/HeaderSetting.kt @@ -1,9 +1,9 @@ -// Copyright 2023 Citra Emulator Project +// Copyright Citra Emulator Project / Lime3DS Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. package io.github.lime3ds.android.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 } diff --git a/src/android/app/src/main/java/io/github/lime3ds/android/features/settings/ui/viewholder/HeaderViewHolder.kt b/src/android/app/src/main/java/io/github/lime3ds/android/features/settings/ui/viewholder/HeaderViewHolder.kt index 0acae3022..17637c738 100644 --- a/src/android/app/src/main/java/io/github/lime3ds/android/features/settings/ui/viewholder/HeaderViewHolder.kt +++ b/src/android/app/src/main/java/io/github/lime3ds/android/features/settings/ui/viewholder/HeaderViewHolder.kt @@ -1,4 +1,4 @@ -// Copyright 2023 Citra Emulator Project +// Copyright Citra Emulator Project / Lime3DS Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -18,6 +18,12 @@ class HeaderViewHolder(val binding: ListItemSettingsHeaderBinding, adapter: Sett override fun bind(item: SettingsItem) { 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) { diff --git a/src/android/app/src/main/res/layout/list_item_settings_header.xml b/src/android/app/src/main/res/layout/list_item_settings_header.xml index e072d3254..e8f19b311 100644 --- a/src/android/app/src/main/res/layout/list_item_settings_header.xml +++ b/src/android/app/src/main/res/layout/list_item_settings_header.xml @@ -1,16 +1,33 @@ - + + + + \ No newline at end of file