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

fix: use correct fragment manager for result callbacks #6067

Merged
merged 1 commit into from
May 20, 2024
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 @@ -170,7 +170,7 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions {
)
}

requireActivity().supportFragmentManager.setFragmentResultListener(
childFragmentManager.setFragmentResultListener(
ChaptersBottomSheet.SEEK_TO_POSITION_REQUEST_KEY,
viewLifecycleOwner
) { _, bundle ->
Expand All @@ -187,7 +187,7 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions {
IntentData.duration to playerService.player?.duration?.div(1000)
)
}
.show(requireActivity().supportFragmentManager)
.show(childFragmentManager)
}

binding.miniPlayerClose.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,14 @@

private fun setupSortAndFilter() {
binding.filterSort.setOnClickListener {
val activityCompat = context as AppCompatActivity
val fragManager = activityCompat
.supportFragmentManager
.apply {
setFragmentResultListener(
FILTER_SORT_REQUEST_KEY,
activityCompat
) { _, resultBundle ->
selectedSortOrder = resultBundle.getInt(IntentData.sortOptions)
hideWatched = resultBundle.getBoolean(IntentData.hideWatched)
showFeed()
}
}
childFragmentManager.setFragmentResultListener(
FILTER_SORT_REQUEST_KEY,
viewLifecycleOwner

Check failure on line 236 in app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Missing trailing comma before ")" Raw Output: app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt:236:35: error: Missing trailing comma before ")" (standard:trailing-comma-on-call-site)
) { _, resultBundle ->
selectedSortOrder = resultBundle.getInt(IntentData.sortOptions)
hideWatched = resultBundle.getBoolean(IntentData.hideWatched)
showFeed()
}

FilterSortBottomSheet()
.apply {
Expand All @@ -252,7 +247,7 @@
IntentData.hideWatched to hideWatched
)
}
.show(fragManager)
.show(childFragmentManager)
}
}

Expand Down
Loading