minor bugfix subscription title display

This commit is contained in:
Xilin Jia 2024-02-25 22:29:02 +01:00
parent 993da21461
commit f903a57920
4 changed files with 14 additions and 25 deletions

View File

@ -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.

View File

@ -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

View File

@ -33,7 +33,6 @@ open class SubscriptionsRecyclerAdapter(mainActivity: MainActivity) :
private var listItems: List<NavDrawerData.DrawerItem>
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<View>(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<View>(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

View File

@ -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">
<androidx.cardview.widget.CardView
android:id="@+id/outerContainer"
@ -45,8 +45,7 @@
android:textStyle="bold"
android:textColor="?android:attr/textColorPrimary"
android:lines="1"
android:importantForAccessibility="no"
tools:text="@sample/episodes.json/data/title" />
android:text="Title" />
<TextView
android:id="@+id/producerLabel"
@ -54,8 +53,7 @@
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:lines="1"
android:importantForAccessibility="no"
tools:text="@sample/episodes.json/data/title" />
android:text="Author" />
<TextView
android:id="@+id/countLabel"
@ -63,28 +61,19 @@
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"
android:lines="1"
android:importantForAccessibility="no"
tools:text="@sample/episodes.json/data/title" />
android:text="number episodes" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/errorIcon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentEnd="true"
android:layout_margin="8dp"
android:visibility="gone"
android:contentDescription="@string/refresh_failed_msg"
app:srcCompat="@drawable/ic_error"
tools:visibility="visible" />
</RelativeLayout>
</LinearLayout>
<FrameLayout
android:id="@+id/selectContainer"