fix: cast items recycler (finally) (#564)

* turn cast items visible(tools)

* prevent cast gesture listener from permanent RIP in one lifecycle
This commit is contained in:
IndusAryan 2023-08-18 21:16:03 +05:30 committed by GitHub
parent 8f6e8a8e99
commit e95dc1db2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 13 deletions

View file

@ -212,19 +212,17 @@ open class ResultFragmentPhone : FullScreenPlayer() {
loadTrailer() loadTrailer()
} }
override fun onDestroy() {
super.onDestroy()
PanelsChildGestureRegionObserver.Provider.get().apply {
resultBinding?.resultCastItems?.let {
unregister(it)
}
removeGestureRegionsUpdateListener(gestureRegionsListener)
}
}
override fun onDestroyView() { override fun onDestroyView() {
//somehow this still leaks and I dont know why???? //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 // 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 updateUIEvent -= ::updateUI
binding = null binding = null

View file

@ -476,7 +476,7 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="2" tools:itemCount="2"
tools:listitem="@layout/cast_item" tools:listitem="@layout/cast_item"
tools:visibility="gone" /> tools:visibility="visible" />
<TextView <TextView
android:id="@+id/result_vpn" android:id="@+id/result_vpn"