Skip to content

Commit

Permalink
Seasons: different indicators if some or all are skipped/collected
Browse files Browse the repository at this point in the history
  • Loading branch information
UweTrottmann committed Mar 13, 2024
1 parent ba88df2 commit f563a95
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Version 72
----------
*in development*

* 🔧 Seasons: different indicators if only some or all episodes are skipped or in collection.

#### 72.0.5 🧪
*2024-03-08*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.view.isGone
import androidx.core.view.isVisible
import androidx.core.widget.TextViewCompat
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
Expand Down Expand Up @@ -87,8 +87,10 @@ class SeasonsAdapter(
// Skipped and collected indicator
val skipped = stats.skipped
val collected = stats.collected
binding.imageViewSeasonSkipped.isGone = skipped == 0
binding.imageViewSeasonCollected.isGone = collected == 0
binding.imageViewSeasonSkipped.isVisible = skipped in 1..<max
binding.imageViewSeasonSkippedAll.isVisible = skipped > 0 && skipped == max
binding.imageViewSeasonCollected.isVisible = collected in 1..<max
binding.imageViewSeasonCollectedAll.isVisible = collected > 0 && collected == max

// Status text
val countText = StringBuilder()
Expand Down
24 changes: 22 additions & 2 deletions app/src/main/res/layout/item_season.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@
android:layout_alignParentLeft="true"
android:layout_marginRight="4dp"
android:contentDescription="@null"
app:srcCompat="@drawable/ic_skip_black_24dp" />

<ImageView
android:id="@+id/imageViewSeasonSkippedAll"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_below="@id/progressBarSeason"
android:layout_marginRight="4dp"
android:layout_toRightOf="@id/imageViewSeasonSkipped"
android:contentDescription="@null"
app:srcCompat="@drawable/ic_skipped_24dp" />

<ImageView
Expand All @@ -70,7 +80,17 @@
android:layout_height="16dp"
android:layout_below="@id/progressBarSeason"
android:layout_marginRight="4dp"
android:layout_toRightOf="@id/imageViewSeasonSkipped"
android:layout_toRightOf="@id/imageViewSeasonSkippedAll"
android:contentDescription="@null"
app:srcCompat="@drawable/ic_collect_black_24dp" />

<ImageView
android:id="@+id/imageViewSeasonCollectedAll"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_below="@id/progressBarSeason"
android:layout_marginRight="4dp"
android:layout_toRightOf="@id/imageViewSeasonCollected"
android:contentDescription="@null"
app:srcCompat="@drawable/ic_collected_24dp" />

Expand All @@ -80,7 +100,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/progressBarSeason"
android:layout_toLeftOf="@id/imageViewContextMenu"
android:layout_toRightOf="@id/imageViewSeasonCollected"
android:layout_toRightOf="@id/imageViewSeasonCollectedAll"
android:paddingBottom="@dimen/large_padding"
android:textAppearance="@style/TextAppearance.SeriesGuide.Caption.Narrow"
tools:text="77 remaining - 7 skipped - 7 in collection" />
Expand Down

0 comments on commit f563a95

Please sign in to comment.