Skip to content

Commit

Permalink
added onBackPressed to arrow in topbar
Browse files Browse the repository at this point in the history
  • Loading branch information
arkibax committed Feb 10, 2024
1 parent b628148 commit f676824
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.quranapp.android.ui.components.common

import androidx.activity.OnBackPressedCallback
import androidx.activity.compose.LocalOnBackPressedDispatcherOwner
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
Expand Down Expand Up @@ -43,6 +44,7 @@ fun BoldHeader(
.height(dimensionResource(id = R.dimen.dmnAppBarHeight)),
verticalAlignment = Alignment.CenterVertically
) {
val onBackPressedDispatcher = LocalOnBackPressedDispatcherOwner.current?.onBackPressedDispatcher
Image(
painter = painterResource(id = R.drawable.dr_icon_arrow_left),
contentDescription = stringResource(id = R.string.strLabelBack),
Expand All @@ -53,12 +55,7 @@ fun BoldHeader(
.rotate(integerResource(id = R.integer.intActionBtnRotation).toFloat())
.clip(CircleShape)
.clickable {
object : OnBackPressedCallback(true){
override fun handleOnBackPressed() {

}

}
onBackPressedDispatcher?.onBackPressed()
}
)
Text(
Expand Down

0 comments on commit f676824

Please sign in to comment.