Skip to content

Commit

Permalink
remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Aug 19, 2024
1 parent 2e213a6 commit 167cadd
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,6 @@ val Fragment.childFragmentManagerOrNull: FragmentManager? get() =

val Fragment.viewLifecycleScope get() = viewLifecycleOwner.lifecycleScope

fun Fragment.setUpToolbarTitleAndIcon(toolbar: Toolbar) {
if (this is HasTitle) {
toolbar.title = title
toolbar.subtitle = subtitle
}

val typedArray =
toolbar.context.obtainStyledAttributes(intArrayOf(androidx.appcompat.R.attr.homeAsUpIndicator))
val attributeResourceId = typedArray.getResourceId(0, 0)
val backIcon = toolbar.context.getDrawable(attributeResourceId)
typedArray.recycle()

toolbar.setNavigationOnClickListener {
requireActivity().onBackPressedDispatcher.onBackPressed()
}

toolbar.navigationIcon = backIcon
}

fun <T> Fragment.observe(flow: SharedFlow<T>, collector: FlowCollector<T>) {
viewLifecycleOwner.lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
Expand Down

0 comments on commit 167cadd

Please sign in to comment.