Closed Yamaton0827 closed 2 months ago
Detekt check failed. Please run ./gradlew detekt --auto-correct
to fix the issues.
Thank you for this valuable contribution. I believe we need this implementation to comply with the design. The problem is that we need to modify the globalPositioned
each time we change the structure of a composable or add a new composable. This could make our development process difficult. I'm considering whether it might be better not to proceed with this pull request. 🙇
@Yamaton0827 -san @takahirom -san
Sorry to butt in, but this can be fixed with a much smaller change.
Rather than changing globalPositioned
,
It would be better to get the size of the top element and padding it accordingly.
var favoriteFiltersSize by remember { mutableStateOf(0.dp) }
Column(modifier = modifier.fillMaxSize()) {
FavoriteFilters(
allFilterSelected = uiState.isAllFilterSelected,
day1FilterSelected = uiState.isDay1FilterSelected,
day2FilterSelected = uiState.isDay2FilterSelected,
backgroundColor = filterBackgroundColor,
onAllFilterChipClick = onAllFilterChipClick,
onDay1FilterChipClick = onDay1FilterChipClick,
onDay2FilterChipClick = onDay2FilterChipClick,
modifier = Modifier
.fillMaxWidth()
.background(favoriteFiltersBackgroundColor)
.onSizeChanged { size ->
favoriteFiltersSize = size.height.dp
},
)
when (uiState) {
is FavoritesSheetUiState.Empty -> {
EmptyView(
modifier = Modifier.wrapContentSize(Alignment.Center)
.padding(bottom = WindowInsets.statusBars.asPaddingValues().calculateTopPadding() + favoriteFiltersSize)
)
}
It's a little bit off from Figma, but what do you think of this change?
Before | After | Figma |
---|---|---|
I don't mind if you use this code if you like.
By the way, it would be helpful if you could run detekt
and organize the code.
Thank you. That seems better, but I think it's not very good to add processing every time a component is added. However, if we handle it as an inset, I think it's relatively acceptable.
Sorry, I didn't understand what you meant by treating it as an inset. I suggested that this would be fine if no elements will be added to FavoritesScreen in the future.
I think this is a somewhat difficult problem. We also have this issue, and this PR could complicate things further. https://github.com/DroidKaigi/conference-app-2024/issues/520
@takahirom -san, @Yamaton0827 -san I understand. If that's the situation, there's no need to consider my suggestion. Thank you for detailed explanation!
@takahirom Thank you for your review and consideration. The content of the discussion was a little difficult for me, so I will try to understand it from now on.
@naoele Thank you for the suggestion, it was helpful.
This pull request is closed because of a fundamental problem. Thank you for your review.
Issue
Overview (Required)
Links
Screenshot (Optional if screenshot test is present or unrelated to UI)
show layout bounds
mode ONMovie (Optional)