Skip to content

Commit

Permalink
Rename TimetableTopArea from TimetableTopAppBar
Browse files Browse the repository at this point in the history
  • Loading branch information
takahirom committed Jul 1, 2023
1 parent fb33f77 commit b7f29fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import androidx.compose.ui.platform.testTag
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import io.github.droidkaigi.confsched2023.model.TimetableItem
import io.github.droidkaigi.confsched2023.sessions.component.TimetableTopAppBar
import io.github.droidkaigi.confsched2023.sessions.component.TimetableTopArea
import io.github.droidkaigi.confsched2023.sessions.component.rememberTimetableScreenScrollState
import io.github.droidkaigi.confsched2023.sessions.section.TimetableSheet
import io.github.droidkaigi.confsched2023.sessions.section.TimetableSheetUiState
Expand Down Expand Up @@ -73,7 +73,7 @@ private fun TimetableScreen(
)
},
topBar = {
TimetableTopAppBar(state, onTimetableUiChangeClick)
TimetableTopArea(state, onTimetableUiChangeClick)
},
containerColor = MaterialTheme.colorScheme.surfaceVariant,
contentWindowInsets = WindowInsets(0.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const val TimetableUiTypeChangeButtonTestTag = "TimetableUiTypeChangeButton"

@Composable
@OptIn(ExperimentalMaterial3Api::class)
fun TimetableTopAppBar(state: TimetableScreenScrollState, onTimetableUiChangeClick: () -> Unit) {
fun TimetableTopArea(state: TimetableScreenScrollState, onTimetableUiChangeClick: () -> Unit) {
Column {
// TODO: Implement TopAppBar design
TopAppBar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ fun TimetableGrid(
val linePxSize = with(timetableState.density) { TimetableSizes.lineStrokeSize.toPx() }
val layoutDirection = LocalLayoutDirection.current

val currentTimeLineColor = MaterialTheme.colorScheme.primary
val currentTimeCircleRadius =
with(timetableState.density) { TimetableSizes.currentTimeCircleRadius.toPx() }
LazyLayout(
modifier = modifier
.padding(
Expand Down Expand Up @@ -437,25 +434,6 @@ class ScreenScrollState(
}
}

suspend fun flingYIfPossible() = coroutineScope {
val velocity = velocityTracker.calculateVelocity()
launch {
_scrollY.animateDecay(
velocity.y / 2f,
exponentialDecay(),
)
}
}

suspend fun flingXIfPossible() = coroutineScope {
val velocity = velocityTracker.calculateVelocity()
launch {
_scrollX.animateDecay(
velocity.x / 2f,
exponentialDecay(),
)
}
}

fun updateBounds(maxX: Float, maxY: Float) {
_scrollX.updateBounds(maxX, 0f)
Expand Down

0 comments on commit b7f29fd

Please sign in to comment.