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

Adding bottom padding to Page Indicator to avoid phone's frame hide it #1140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
@@ -1,16 +1,19 @@
package eu.kanade.presentation.reader

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import eu.kanade.presentation.theme.TachiyomiPreviewTheme

Expand All @@ -35,6 +38,7 @@ fun PageIndicatorText(
)

Box(
modifier = Modifier.padding(bottom = 12.dp),
Copy link
Member

Choose a reason for hiding this comment

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

This is not the way. You need to apply insets as padding instead of some arbitrary value. THo I've tried doing it but was unsuccessful.

Copy link
Author

Choose a reason for hiding this comment

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

I'm also having issues with WindowInsets. I guess it's because we're hiding the bottom buttons of the phone, and this causes it not to behave as usual.

But I'll try a few more ways to work around this without using a fixed value for the padding.

Copy link
Author

Choose a reason for hiding this comment

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

I couldn't come to a conclusion about which WindowInsets to use. We have safeGestures and safeContent that work, but I'm not sure if they are the most appropriate for this case.

We also have navigationBarsIgnoringVisibility, which seems the most correct in this situation in my view, and it works very well when the phone is using the Navigation Bar with Swipe Gestures. However, when using the Navigation Bar with buttons, the padding becomes really large.

Can you help me decide which direction to take?

contentAlignment = Alignment.Center,
) {
Text(
Expand Down