Skip to content

Commit

Permalink
minor bugfix subscription title display
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Feb 25, 2024
1 parent 993da21 commit f903a57
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
4 changes: 2 additions & 2 deletions app/proguard.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down
21 changes: 5 additions & 16 deletions app/src/main/res/layout/subscription_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -45,46 +45,35 @@
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"
android:layout_width="match_parent"
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"
android:layout_width="match_parent"
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"
Expand Down

0 comments on commit f903a57

Please sign in to comment.