feat(UI): Use same Episode holder size (#1180)

This commit is contained in:
KingLucius 2024-07-05 19:10:58 +03:00 committed by GitHub
parent 9b1ac5fc28
commit 145c42f1c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 13 deletions

View file

@ -57,8 +57,7 @@ const val ACTION_PLAY_EPISODE_IN_MPV = 17
const val ACTION_MARK_AS_WATCHED = 18
const val ACTION_FCAST = 19
const val TV_EP_SIZE_LARGE = 400
const val TV_EP_SIZE_SMALL = 300
const val TV_EP_SIZE = 400
data class EpisodeClickEvent(val action: Int, val data: ResultEpisode)
class EpisodeAdapter(
@ -181,7 +180,7 @@ class EpisodeAdapter(
fun bind(card: ResultEpisode) {
localCard = card
val setWidth =
if (isLayout(TV or EMULATOR)) TV_EP_SIZE_LARGE.toPx else ViewGroup.LayoutParams.MATCH_PARENT
if (isLayout(TV or EMULATOR)) TV_EP_SIZE.toPx else ViewGroup.LayoutParams.MATCH_PARENT
binding.episodeLinHolder.layoutParams.width = setWidth
binding.episodeHolderLarge.layoutParams.width = setWidth
@ -336,7 +335,7 @@ class EpisodeAdapter(
fun bind(card: ResultEpisode) {
binding.episodeHolder.layoutParams.apply {
width =
if (isLayout(TV or EMULATOR)) TV_EP_SIZE_SMALL.toPx else ViewGroup.LayoutParams.MATCH_PARENT
if (isLayout(TV or EMULATOR)) TV_EP_SIZE.toPx else ViewGroup.LayoutParams.MATCH_PARENT
}
binding.apply {

View file

@ -90,14 +90,15 @@
android:textColor="?attr/textColor"
tools:text="Episode 1" />
</LinearLayout>
<com.lagradost.cloudstream3.ui.download.button.PieFetchButton
android:id="@+id/download_button"
android:layout_width="@dimen/download_size"
android:layout_height="@dimen/download_size"
android:layout_gravity="center_vertical|end"
android:layout_marginStart="-50dp"
android:background="?selectableItemBackgroundBorderless"
android:padding="10dp" />
<com.lagradost.cloudstream3.ui.download.button.PieFetchButton
android:id="@+id/download_button"
android:layout_width="@dimen/download_size"
android:layout_height="@dimen/download_size"
android:layout_gravity="center_vertical|end"
android:layout_marginStart="-60dp"
android:background="?selectableItemBackgroundBorderless"
android:padding="10dp" />
</LinearLayout>
</androidx.cardview.widget.CardView>