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

Disable backing again during transition from bookmark screen. #578

Merged
Changes from 3 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 @@ -20,7 +20,9 @@ import androidx.compose.material3.surfaceColorAtElevation
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.lerp
import androidx.compose.ui.text.TextStyle
Expand Down Expand Up @@ -98,6 +100,8 @@ fun BookmarkTopArea(
fraction,
)

var enabledBackPress by remember { mutableStateOf(true) }

Box(
modifier = modifier
.height(topBarHeight)
Expand All @@ -116,7 +120,8 @@ fun BookmarkTopArea(
contentDescription = null,
modifier = Modifier
.size(24.dp)
.clickable {
.clickable(enabled = enabledBackPress) {
enabledBackPress = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using this approach?
https://stackoverflow.com/a/76386604/4339442

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
I thought that approach was really better, so I'll change it that way!

onBackPressClick()
},
)
Expand Down