mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
Merge pull request #3475 from Isira-Seneviratne/Use_nullable_binding
Reuse existing nullable binding variables.
This commit is contained in:
commit
f1b924e69e
@ -243,7 +243,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = FragmentPlayerBinding.inflate(layoutInflater)
|
||||
_binding = FragmentPlayerBinding.inflate(inflater)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
||||
* somehow the bottom bar is invisible on low screen resolutions, this fixes it
|
||||
*/
|
||||
private fun showBottomBar() {
|
||||
if (isAdded && !binding.player.isPlayerLocked) {
|
||||
if (_binding?.player?.isPlayerLocked == false) {
|
||||
playerBinding.bottomBar.isVisible = true
|
||||
}
|
||||
handler.postDelayed(this::showBottomBar, 100)
|
||||
|
@ -45,7 +45,7 @@ class SearchResultFragment : Fragment() {
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = FragmentSearchResultBinding.inflate(layoutInflater)
|
||||
_binding = FragmentSearchResultBinding.inflate(inflater)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ class SearchResultFragment : Fragment() {
|
||||
fetchSearch()
|
||||
|
||||
binding.searchRecycler.viewTreeObserver.addOnScrollChangedListener {
|
||||
if (isAdded && !binding.searchRecycler.canScrollVertically(1) &&
|
||||
if (_binding?.searchRecycler?.canScrollVertically(1) == false &&
|
||||
nextPage != null
|
||||
) {
|
||||
fetchNextSearchItems()
|
||||
@ -144,9 +144,8 @@ class SearchResultFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user