Skip to content

Commit

Permalink
feat(UI): Use same Episode holder size (#1180)
Browse files Browse the repository at this point in the history
  • Loading branch information
KingLucius authored Jul 5, 2024
1 parent 9b1ac5f commit 145c42f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
19 changes: 10 additions & 9 deletions app/src/main/res/layout/result_episode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 145c42f

Please sign in to comment.