Skip to content
Permalink
Browse files

Fix some more potential leaks in Watched + Followed

  • Loading branch information...
chrisbanes committed Nov 7, 2019
1 parent d863604 commit abbe211dd13e819f716732547c8309517101f026
@@ -18,7 +18,6 @@ package app.tivi.home.followed

import android.text.Editable
import android.text.TextWatcher
import android.view.View
import app.tivi.common.epoxy.TotalSpanOverride
import app.tivi.common.layouts.emptyState
import app.tivi.common.layouts.filter
@@ -89,10 +88,8 @@ class FollowedEpoxyController @Inject constructor(
posterImage(item.images.findHighestRatedPoster())
posterTransitionName("show_${item.show.homepage}")
selected(item.show.id in state.selectedShowIds)
callbacks?.also { cb ->
clickListener(View.OnClickListener { cb.onItemClicked(item) })
longClickListener(View.OnLongClickListener { cb.onItemLongClicked(item) })
}
clickListener { _ -> callbacks?.onItemClicked(item) }
longClickListener { _ -> callbacks?.onItemLongClicked(item) ?: false }
} else {
id("item_placeholder_$currentPosition")
}
@@ -18,7 +18,6 @@ package app.tivi.home.watched

import android.text.Editable
import android.text.TextWatcher
import android.view.View
import app.tivi.common.epoxy.TotalSpanOverride
import app.tivi.common.layouts.emptyState
import app.tivi.common.layouts.filter
@@ -92,10 +91,8 @@ class WatchedEpoxyController @Inject constructor(
posterImage(item.images.findHighestRatedPoster())
posterTransitionName("show_${item.show.homepage}")
selected(item.show.id in state.selectedShowIds)
callbacks?.also { cb ->
clickListener(View.OnClickListener { cb.onItemClicked(item) })
longClickListener(View.OnLongClickListener { cb.onItemLongClicked(item) })
}
clickListener { _ -> callbacks?.onItemClicked(item) }
longClickListener { _ -> callbacks?.onItemLongClicked(item) ?: false }
} else {
id("item_placeholder_$currentPosition")
}
@@ -50,7 +50,7 @@ class WatchedFragment : TiviFragmentWithBinding<FragmentWatchedBinding>() {

@Inject lateinit var controller: WatchedEpoxyController

private lateinit var authStateMenuItemBinder: AuthStateMenuItemBinder
private var authStateMenuItemBinder: AuthStateMenuItemBinder? = null

private var currentActionMode: ActionMode? = null

@@ -145,7 +145,7 @@ class WatchedFragment : TiviFragmentWithBinding<FragmentWatchedBinding>() {

binding.state = state

authStateMenuItemBinder.bind(state.authState, state.user)
authStateMenuItemBinder?.bind(state.authState, state.user)

if (state.watchedShows != null) {
// PagingEpoxyController does not like being updated before it has a list

0 comments on commit abbe211

Please sign in to comment.
You can’t perform that action at this time.