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

[Enhancement] Enabling floating Info bar #390

Conversation

lucasvillaverde
Copy link
Contributor

@lucasvillaverde lucasvillaverde commented Jul 14, 2024

Summary

Enabling floating Info bar to avoid list auto scrolling to the top

Solves #391

How It Was Tested

Manually tested according to the videos.

  1. Tap to edit a badge;
  2. Input an invalid data;
  3. Check if the infobar is shown at the bottom of the screen.

Screenshot/Gif

Before After
TEST_WEATHER.webm
FLOATING.INFOBAR.mp4
Screenshot Name

@lucasvillaverde lucasvillaverde changed the title [Enhancement] Enabling floating Info bar to avoid list auto scrolling to the top [Enhancement] Enabling floating Info bar Jul 14, 2024
@lucasvillaverde lucasvillaverde marked this pull request as ready for review July 14, 2024 14:32
Comment on lines +99 to +110
@Composable
private fun ZePagesLazyList(
paddingValues: PaddingValues,
lazyListState: LazyListState,
slots: Map<ZeSlot, ZeConfiguration>,
sendPageToBadgeAndDisplay: (ZeSlot) -> Unit,
slotToBitmap: (ZeSlot) -> Bitmap,
customizeSponsorSlot: (ZeSlot) -> Unit,
customizeSlot: (ZeSlot) -> Unit,
resetSlot: (ZeSlot) -> Unit,
modifier: Modifier = Modifier,
) {
Copy link
Contributor Author

@lucasvillaverde lucasvillaverde Jul 14, 2024

Choose a reason for hiding this comment

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

Extracting the list in a separate method, this will allow us to enable the preview functionality in the future without depending on the VM


if (message.isNotEmpty()) {
InfoBar(
modifier = Modifier.align(Alignment.BottomCenter),
Copy link
Contributor Author

@lucasvillaverde lucasvillaverde Jul 14, 2024

Choose a reason for hiding this comment

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

To change the InfoBar position, just change the Alignment on this line. e.g. if you want to put it at the top the aligment would be Aligment.TopCenter

Copy link
Member

@mariobodemann mariobodemann left a comment

Choose a reason for hiding this comment

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

Looks great, thanks.

@mariobodemann mariobodemann added this pull request to the merge queue Jul 15, 2024
Merged via the queue into gdg-berlin-android:main with commit c9ebacc Jul 15, 2024
6 checks passed
@lucasvillaverde lucasvillaverde deleted the lvillaverde/floating-info-bar branch July 15, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants