Skip to content

Commit

Permalink
fix: app crashes on fragment change (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuylar authored Aug 24, 2023
1 parent 1084b12 commit e12cf9e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LibraryFragment : Fragment() {
): View {
binding = FragmentLibraryBinding.inflate(inflater)
(activity as MainActivity).apply {
this@LibraryFragment.api = api
this@LibraryFragment.api = getApi()
this@LibraryFragment.player = player
}
return binding.root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PlaylistFragment : Fragment() {
id = it.getString("id")!!
}
(activity as MainActivity).apply {
this@PlaylistFragment.api = api
this@PlaylistFragment.api = getApi()
supportActionBar?.title = ""
}
return binding.root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class RecyclerViewFragment : Fragment() {
): View {
binding = FragmentRecyclerviewBinding.inflate(inflater)
(activity as MainActivity).apply {
this@RecyclerViewFragment.api = api
this@RecyclerViewFragment.api = getApi()
this@RecyclerViewFragment.player = player
}
type = arguments?.getString("type")!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SearchFragment : Fragment() {
): View {
binding = FragmentSearchBinding.inflate(inflater)
(activity as MainActivity).apply {
this@SearchFragment.api = api
this@SearchFragment.api = getApi()
this@SearchFragment.player = player
}
query = arguments?.getString("query") ?: "asdf"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class SubscriptionsFragment : Fragment() {
): View {
binding = FragmentSubscriptionsBinding.inflate(inflater)
(activity as MainActivity).apply {
this@SubscriptionsFragment.api = api
this@SubscriptionsFragment.api = getApi()
this@SubscriptionsFragment.player = player
}
return binding.root
Expand Down

0 comments on commit e12cf9e

Please sign in to comment.