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?,
|
container: ViewGroup?,
|
||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?
|
||||||
): View {
|
): View {
|
||||||
_binding = FragmentPlayerBinding.inflate(layoutInflater)
|
_binding = FragmentPlayerBinding.inflate(inflater)
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
* somehow the bottom bar is invisible on low screen resolutions, this fixes it
|
* somehow the bottom bar is invisible on low screen resolutions, this fixes it
|
||||||
*/
|
*/
|
||||||
private fun showBottomBar() {
|
private fun showBottomBar() {
|
||||||
if (isAdded && !binding.player.isPlayerLocked) {
|
if (_binding?.player?.isPlayerLocked == false) {
|
||||||
playerBinding.bottomBar.isVisible = true
|
playerBinding.bottomBar.isVisible = true
|
||||||
}
|
}
|
||||||
handler.postDelayed(this::showBottomBar, 100)
|
handler.postDelayed(this::showBottomBar, 100)
|
||||||
|
@ -45,7 +45,7 @@ class SearchResultFragment : Fragment() {
|
|||||||
container: ViewGroup?,
|
container: ViewGroup?,
|
||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?
|
||||||
): View {
|
): View {
|
||||||
_binding = FragmentSearchResultBinding.inflate(layoutInflater)
|
_binding = FragmentSearchResultBinding.inflate(inflater)
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ class SearchResultFragment : Fragment() {
|
|||||||
fetchSearch()
|
fetchSearch()
|
||||||
|
|
||||||
binding.searchRecycler.viewTreeObserver.addOnScrollChangedListener {
|
binding.searchRecycler.viewTreeObserver.addOnScrollChangedListener {
|
||||||
if (isAdded && !binding.searchRecycler.canScrollVertically(1) &&
|
if (_binding?.searchRecycler?.canScrollVertically(1) == false &&
|
||||||
nextPage != null
|
nextPage != null
|
||||||
) {
|
) {
|
||||||
fetchNextSearchItems()
|
fetchNextSearchItems()
|
||||||
@ -144,9 +144,8 @@ class SearchResultFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroyView() {
|
||||||
super.onDestroy()
|
super.onDestroyView()
|
||||||
|
|
||||||
_binding = null
|
_binding = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user