mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
refactor: clean up all binding references (#6962)
This commit is contained in:
parent
31ec3bb3c4
commit
5bafa1209a
@ -106,4 +106,9 @@ class SubmitDeArrowDialog: DialogFragment() {
|
|||||||
|
|
||||||
dialog?.dismiss()
|
dialog?.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
super.onDestroyView()
|
||||||
|
_binding = null
|
||||||
|
}
|
||||||
}
|
}
|
@ -2,9 +2,7 @@ package com.github.libretube.ui.fragments
|
|||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.navigation.fragment.findNavController
|
import androidx.navigation.fragment.findNavController
|
||||||
import com.github.libretube.R
|
import com.github.libretube.R
|
||||||
@ -14,22 +12,12 @@ import com.github.libretube.helpers.NetworkHelper
|
|||||||
import com.github.libretube.ui.activities.SettingsActivity
|
import com.github.libretube.ui.activities.SettingsActivity
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
|
|
||||||
class NoInternetFragment: Fragment() {
|
class NoInternetFragment: Fragment(R.layout.fragment_nointernet) {
|
||||||
private var _binding: FragmentNointernetBinding? = null
|
|
||||||
private val binding get() = _binding!!
|
|
||||||
|
|
||||||
override fun onCreateView(
|
|
||||||
inflater: LayoutInflater,
|
|
||||||
container: ViewGroup?,
|
|
||||||
savedInstanceState: Bundle?
|
|
||||||
): View {
|
|
||||||
_binding = FragmentNointernetBinding.inflate(layoutInflater)
|
|
||||||
return binding.root
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
val binding = FragmentNointernetBinding.bind(view)
|
||||||
binding.retryButton.setOnClickListener {
|
binding.retryButton.setOnClickListener {
|
||||||
if (NetworkHelper.isNetworkAvailable(requireContext())) {
|
if (NetworkHelper.isNetworkAvailable(requireContext())) {
|
||||||
NavigationHelper.restartMainActivity(requireContext())
|
NavigationHelper.restartMainActivity(requireContext())
|
||||||
|
@ -1538,4 +1538,9 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
fun onKeyUp(keyCode: Int): Boolean {
|
fun onKeyUp(keyCode: Int): Boolean {
|
||||||
return _binding?.player?.onKeyBoardAction(keyCode) ?: false
|
return _binding?.player?.onKeyBoardAction(keyCode) ?: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
super.onDestroyView()
|
||||||
|
_binding = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,6 +207,11 @@ class PlayingQueueSheet : ExpandedBottomSheet() {
|
|||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
super.onDestroyView()
|
||||||
|
_binding = null
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val PLAYING_QUEUE_REQUEST_KEY = "playing_queue_request_key"
|
const val PLAYING_QUEUE_REQUEST_KEY = "playing_queue_request_key"
|
||||||
}
|
}
|
||||||
|
@ -70,4 +70,9 @@ class SleepTimerSheet : ExpandedBottomSheet() {
|
|||||||
updateTimeLeftText()
|
updateTimeLeftText()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
super.onDestroyView()
|
||||||
|
_binding = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user