Skip to content

Commit

Permalink
🔧 Because the bug cannot be fixed, the following PR content will be r…
Browse files Browse the repository at this point in the history
…everted.

#919
  • Loading branch information
Corvus400 committed Sep 6, 2024
1 parent 0148d94 commit 8d189ac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ fun TimetableGrid(
val animatedScope = LocalAnimatedVisibilityScope.current

Row(
modifier = modifier
modifier = Modifier
.testTag(TimetableGridTestTag)
.padding(
top = contentPadding.calculateTopPadding(),
Expand Down Expand Up @@ -171,6 +171,7 @@ fun TimetableGrid(
timetableState = timetableState,
timeLine = timeLine,
selectedDay = selectedDay,
modifier = modifier,
contentPadding = PaddingValues(
top = 16.dp + contentPadding.calculateTopPadding(),
bottom = 16.dp + 80.dp + contentPadding.calculateBottomPadding(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ internal fun TimetableList(

LazyColumn(
modifier = modifier.testTag(TimetableListTestTag)
.offset {
IntOffset(x = 0, y = nestedScrollStateHolder.uiState.dayTabOffsetY.toInt())
}
.nestedScroll(nestedScrollConnection),
state = scrollState,
verticalArrangement = Arrangement.spacedBy(32.dp),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.droidkaigi.confsched.sessions.section

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.calculateEndPadding
import androidx.compose.foundation.layout.calculateStartPadding
Expand All @@ -20,9 +20,7 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.dp
Expand All @@ -31,7 +29,6 @@ import io.github.droidkaigi.confsched.model.DroidKaigi2024Day
import io.github.droidkaigi.confsched.model.TimeLine
import io.github.droidkaigi.confsched.model.TimetableItem
import io.github.droidkaigi.confsched.sessions.component.TimetableDayTab
import io.github.droidkaigi.confsched.sessions.component.TimetableNestedScrollStateHolder
import io.github.droidkaigi.confsched.sessions.component.rememberTimetableNestedScrollStateHolder
import io.github.droidkaigi.confsched.sessions.section.TimetableUiState.Empty
import io.github.droidkaigi.confsched.sessions.section.TimetableUiState.GridTimetable
Expand Down Expand Up @@ -74,8 +71,9 @@ fun Timetable(
Surface(
modifier = modifier.padding(contentPadding.calculateTopPadding()),
) {
Box(
modifier = Modifier.fillMaxSize(),
Column(
modifier = Modifier
.fillMaxSize(),
) {
TimetableDayTab(
selectedDay = selectedDay,
Expand All @@ -102,7 +100,9 @@ fun Timetable(
scrollState = scrollStates.getValue(selectedDay),
onTimetableItemClick = onTimetableItemClick,
onBookmarkClick = onFavoriteClick,
modifier = timetableModifier(nestedScrollStateHolder),
modifier = Modifier
.fillMaxSize()
.weight(1f),
contentPadding = PaddingValues(
bottom = contentPadding.calculateBottomPadding(),
start = contentPadding.calculateStartPadding(layoutDirection),
Expand All @@ -119,7 +119,9 @@ fun Timetable(
timeLine = uiState.timeLine,
selectedDay = selectedDay,
onTimetableItemClick = onTimetableItemClick,
modifier = timetableModifier(nestedScrollStateHolder),
modifier = Modifier
.fillMaxSize()
.weight(1f),
contentPadding = PaddingValues(
bottom = contentPadding.calculateBottomPadding(),
start = contentPadding.calculateStartPadding(layoutDirection),
Expand Down Expand Up @@ -158,19 +160,3 @@ private fun rememberGridTimetableStates(): Map<DroidKaigi2024Day, TimetableState
}
return remember { timetableStateMap }
}

@Composable
private fun timetableModifier(
nestedScrollStateHolder: TimetableNestedScrollStateHolder,
): Modifier {
val density = LocalDensity.current

return Modifier
.padding(
top = with(density) {
(nestedScrollStateHolder.uiState.scrollConnectionMinOffset + nestedScrollStateHolder.uiState.dayTabOffsetY).toDp()
},
)
.fillMaxSize()
.background(Color.Transparent)
}

0 comments on commit 8d189ac

Please sign in to comment.