Repository: Automattic/pocket-casts-android
File: modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/view/podcast/UserEpisodeViewHolder.kt (Kotlin)

Code before:
        binding.checkbox.setOnClickListener {
            binding.episodeRow.performClick()
        }
        binding.checkbox.setOnCheckedChangeListener { _, isChecked ->
            bindSelectedRow(isChecked)
        }
        swipeLayout.addOnSwipeActionListener { action -> onSwipeAction(episode, action) }
    }

    fun bind(
        episode: UserEpisode,
        @ColorInt tint: Int,
        isMultiSelectEnabled: Boolean,
        isSelected: Boolean,
        useEpisodeArtwork: Boolean,
        streamByDefault: Boolean,
        animateMultiSelection: Boolean,
    ) {
        val wasMultiSelecting = this.isMultiSelectEnabled
        val previousUuid = boundEpisode?.uuid
        setupInitialState(episode, tint, isMultiSelectEnabled, streamByDefault)

        if (previousUuid != episode.uuid || !isObservingRowData) {
            observeRowData()
        }
        observeFileStatus()
        bindArtwork(useEpisodeArtwork)
        bindPlaybackButton()
        bindTitle()
        bindDate()
        bindContentDescription()
        bindColors()
        bindSwipeActions()
        bindSelectedRow(isSelected)
        if (wasMultiSelecting != isMultiSelectEnabled) {
            bindMultiSelection(animateMultiSelection)
        }
    }

    private fun setupInitialState(episode: UserEpisode, tint: Int?, isMultiSelectEnabled: Boolean, streamByDefault: Boolean) {
        if (episode.uuid != this.boundEpisode?.uuid) {
            swipeLayout.clearTranslation()
        }
        this.boundEpisode = episode
        this.streamByDefault = streamByDefault
        if (tint != null) {
            this.tint = tint
        }

        if (this.isMultiSelectEnabled != isMultiSelectEnabled) {
            this.isMultiSelectEnabled = isMultiSelectEnabled

Review comment (suggestion):
The issue happens when the episode is updated to have the status changed from uploading to uploaded. If it's excluded from the `bind`, then the row status condition never sees the new episode status.

Code after:
        binding.playButton.listener = playButtonListener
        binding.checkbox.setOnClickListener {
            binding.episodeRow.performClick()
        }
        binding.checkbox.setOnCheckedChangeListener { _, isChecked ->
            bindSelectedRow(isChecked)
        }
        swipeLayout.addOnSwipeActionListener { action -> onSwipeAction(episode, action) }
    }

    fun bind(
        episode: UserEpisode,
        @ColorInt tint: Int,
        isMultiSelectEnabled: Boolean,
        isSelected: Boolean,
        useEpisodeArtwork: Boolean,
        streamByDefault: Boolean,
        animateMultiSelection: Boolean,
    ) {
        val wasMultiSelecting = this.isMultiSelectEnabled
        val previousUuid = boundEpisode?.uuid
        setupInitialState(episode, tint, isMultiSelectEnabled, streamByDefault)

        if (previousUuid != episode.uuid || !isObservingRowData) {
            observeRowData()
        }
        bindFileStatus()
        bindArtwork(useEpisodeArtwork)
        bindPlaybackButton()
        bindTitle()
        bindDate()
        bindContentDescription()
        bindColors()
        bindSwipeActions()
        bindSelectedRow(isSelected)
        if (wasMultiSelecting != isMultiSelectEnabled) {
            bindMultiSelection(animateMultiSelection)
        }
    }

    private fun setupInitialState(episode: UserEpisode, tint: Int?, isMultiSelectEnabled: Boolean, streamByDefault: Boolean) {
        if (episode.uuid != this.boundEpisode?.uuid) {
            swipeLayout.clearTranslation()
        }
        this.boundEpisode = episode
        this.streamByDefault = streamByDefault
        if (tint != null) {
            this.tint = tint
        }

        if (this.isMultiSelectEnabled != isMultiSelectEnabled) {