Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up all binding references #6962

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,9 @@ class SubmitDeArrowDialog: DialogFragment() {

dialog?.dismiss()
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ package com.github.libretube.ui.fragments

import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.github.libretube.R
Expand All @@ -14,22 +12,12 @@ import com.github.libretube.helpers.NetworkHelper
import com.github.libretube.ui.activities.SettingsActivity
import com.google.android.material.snackbar.Snackbar

class NoInternetFragment: Fragment() {
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
}
class NoInternetFragment: Fragment(R.layout.fragment_nointernet) {

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

val binding = FragmentNointernetBinding.bind(view)
binding.retryButton.setOnClickListener {
if (NetworkHelper.isNetworkAvailable(requireContext())) {
NavigationHelper.restartMainActivity(requireContext())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1538,4 +1538,9 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
fun onKeyUp(keyCode: Int): Boolean {
return _binding?.player?.onKeyBoardAction(keyCode) ?: false
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ class PlayingQueueSheet : ExpandedBottomSheet() {
.show()
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}

companion object {
const val PLAYING_QUEUE_REQUEST_KEY = "playing_queue_request_key"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,9 @@ class SleepTimerSheet : ExpandedBottomSheet() {
updateTimeLeftText()
}
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}
Loading