From f903a5792025f61e1002ae43cfecf1b54e5563d6 Mon Sep 17 00:00:00 2001 From: Xilin Jia <6257601+XilinJia@users.noreply.github.com> Date: Sun, 25 Feb 2024 22:29:02 +0100 Subject: [PATCH] minor bugfix subscription title display --- app/proguard.cfg | 4 ++-- .../podcini/preferences/UserPreferences.kt | 3 ++- .../adapter/SubscriptionsRecyclerAdapter.kt | 11 +++++----- app/src/main/res/layout/subscription_item.xml | 21 +++++-------------- 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/app/proguard.cfg b/app/proguard.cfg index c0d07189..6ab5e4a2 100644 --- a/app/proguard.cfg +++ b/app/proguard.cfg @@ -11,8 +11,8 @@ # Without this, methods only used in tests are removed and break tests. -keep class ac.mdiq.podcini** -keepclassmembers class ac.mdiq.podcini** {*;} --keep class de.test.podcini** --keepclassmembers class de.test.podcini** {*;} +# -keep class de.test.podcini** +# -keepclassmembers class de.test.podcini** {*;} # Keep methods used in tests. # This is only needed when running tests with proguard enabled. diff --git a/app/src/main/java/ac/mdiq/podcini/preferences/UserPreferences.kt b/app/src/main/java/ac/mdiq/podcini/preferences/UserPreferences.kt index a7b331c8..2a90b7b4 100644 --- a/app/src/main/java/ac/mdiq/podcini/preferences/UserPreferences.kt +++ b/app/src/main/java/ac/mdiq/podcini/preferences/UserPreferences.kt @@ -861,7 +861,8 @@ object UserPreferences { @JvmStatic fun shouldShowSubscriptionTitle(): Boolean { - return prefs.getBoolean(PREF_SUBSCRIPTION_TITLE, true) + return true +// return prefs.getBoolean(PREF_SUBSCRIPTION_TITLE, true) } @JvmStatic diff --git a/app/src/main/java/ac/mdiq/podcini/ui/adapter/SubscriptionsRecyclerAdapter.kt b/app/src/main/java/ac/mdiq/podcini/ui/adapter/SubscriptionsRecyclerAdapter.kt index f54315c9..742bb83c 100644 --- a/app/src/main/java/ac/mdiq/podcini/ui/adapter/SubscriptionsRecyclerAdapter.kt +++ b/app/src/main/java/ac/mdiq/podcini/ui/adapter/SubscriptionsRecyclerAdapter.kt @@ -33,7 +33,6 @@ open class SubscriptionsRecyclerAdapter(mainActivity: MainActivity) : private var listItems: List private var selectedItem: NavDrawerData.DrawerItem? = null private var longPressedPosition: Int = 0 // used to init actionMode - private var columnCount = 1 init { this.listItems = ArrayList() @@ -49,9 +48,8 @@ open class SubscriptionsRecyclerAdapter(mainActivity: MainActivity) : } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SubscriptionViewHolder { - val itemView: View = - LayoutInflater.from(mainActivityRef.get()).inflate(R.layout.subscription_item, parent, false) - itemView.findViewById(R.id.titleLabel).visibility = if (viewType == COVER_WITH_TITLE) View.VISIBLE else View.GONE + val itemView: View = LayoutInflater.from(mainActivityRef.get()).inflate(R.layout.subscription_item, parent, false) +// itemView.findViewById(R.id.titleLabel).visibility = if (viewType == COVER_WITH_TITLE) View.VISIBLE else View.GONE return SubscriptionViewHolder(itemView) } @@ -178,7 +176,8 @@ open class SubscriptionsRecyclerAdapter(mainActivity: MainActivity) : } override fun getItemViewType(position: Int): Int { - return if (UserPreferences.shouldShowSubscriptionTitle()) COVER_WITH_TITLE else 0 + return 0 +// return if (UserPreferences.shouldShowSubscriptionTitle()) COVER_WITH_TITLE else 0 } inner class SubscriptionViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { @@ -247,7 +246,7 @@ open class SubscriptionsRecyclerAdapter(mainActivity: MainActivity) : } companion object { - private const val COVER_WITH_TITLE = 1 +// private const val COVER_WITH_TITLE = 1 fun convertDpToPixel(context: Context, dp: Float): Float { return dp * context.resources.displayMetrics.density diff --git a/app/src/main/res/layout/subscription_item.xml b/app/src/main/res/layout/subscription_item.xml index f3f2d37f..386ea5f2 100644 --- a/app/src/main/res/layout/subscription_item.xml +++ b/app/src/main/res/layout/subscription_item.xml @@ -7,7 +7,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="4dp" - tools:layout_width="150dp"> + tools:layout_width="400dp"> + android:text="Title" /> + android:text="Author" /> - + android:text="number episodes" /> - - - - - +