Skip to content

Commit

Permalink
fix: cast items recycler (finally) (#564)
Browse files Browse the repository at this point in the history
* turn cast items visible(tools)

* prevent cast gesture listener from permanent RIP in one lifecycle
  • Loading branch information
IndusAryan committed Aug 18, 2023
1 parent 8f6e8a8 commit e95dc1d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,19 +212,17 @@ open class ResultFragmentPhone : FullScreenPlayer() {
loadTrailer()
}

override fun onDestroy() {
super.onDestroy()
PanelsChildGestureRegionObserver.Provider.get().apply {
resultBinding?.resultCastItems?.let {
unregister(it)
}
removeGestureRegionsUpdateListener(gestureRegionsListener)
}
}

override fun onDestroyView() {

//somehow this still leaks and I dont know why????
// todo look at https://github.com/discord/OverlappingPanels/blob/70b4a7cf43c6771873b1e091029d332896d41a1a/sample_app/src/main/java/com/discord/sampleapp/MainActivity.kt
PanelsChildGestureRegionObserver.Provider.get().let { obs ->
resultBinding?.resultCastItems?.let {
obs.unregister(it)
}

obs.removeGestureRegionsUpdateListener(gestureRegionsListener)
}

updateUIEvent -= ::updateUI
binding = null
Expand Down Expand Up @@ -1127,4 +1125,4 @@ open class ResultFragmentPhone : FullScreenPlayer() {
}
}
}
}
}
4 changes: 2 additions & 2 deletions app/src/main/res/layout/fragment_result.xml
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="2"
tools:listitem="@layout/cast_item"
tools:visibility="gone" />
tools:visibility="visible" />

<TextView
android:id="@+id/result_vpn"
Expand Down Expand Up @@ -905,4 +905,4 @@
android:contentDescription="@string/search_poster_descript"/>
</androidx.cardview.widget.CardView>-->

</FrameLayout>
</FrameLayout>

0 comments on commit e95dc1d

Please sign in to comment.