Skip to content

Commit

Permalink
Merge pull request DroidKaigi#499 from yumayuma708/feature/update/tim…
Browse files Browse the repository at this point in the history
…etable-ui-type-button

Updated the timetableUiType button on the TimetableScreen to match the Figma design.
  • Loading branch information
takahirom authored Aug 16, 2024
2 parents c5e17e0 + 0063012 commit e066410
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:pathData="M200,440q-33,0 -56.5,-23.5T120,360v-160q0,-33 23.5,-56.5T200,120h160q33,0 56.5,23.5T440,200v160q0,33 -23.5,56.5T360,440L200,440ZM200,840q-33,0 -56.5,-23.5T120,760v-160q0,-33 23.5,-56.5T200,520h160q33,0 56.5,23.5T440,600v160q0,33 -23.5,56.5T360,840L200,840ZM600,440q-33,0 -56.5,-23.5T520,360v-160q0,-33 23.5,-56.5T600,120h160q33,0 56.5,23.5T840,200v160q0,33 -23.5,56.5T760,440L600,440ZM600,840q-33,0 -56.5,-23.5T520,760v-160q0,-33 23.5,-56.5T600,520h160q33,0 56.5,23.5T840,600v160q0,33 -23.5,56.5T760,840L600,840ZM200,360h160v-160L200,200v160ZM600,360h160v-160L600,200v160ZM600,760h160v-160L600,600v160ZM200,760h160v-160L200,600v160ZM600,360ZM600,600ZM360,600ZM360,360Z"
android:fillColor="#E3E2E2"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:pathData="M280,680h160q17,0 28.5,-11.5T480,640q0,-17 -11.5,-28.5T440,600L280,600q-17,0 -28.5,11.5T240,640q0,17 11.5,28.5T280,680ZM400,520h160q17,0 28.5,-11.5T600,480q0,-17 -11.5,-28.5T560,440L400,440q-17,0 -28.5,11.5T360,480q0,17 11.5,28.5T400,520ZM520,360h160q17,0 28.5,-11.5T720,320q0,-17 -11.5,-28.5T680,280L520,280q-17,0 -28.5,11.5T480,320q0,17 11.5,28.5T520,360ZM200,840q-33,0 -56.5,-23.5T120,760v-560q0,-33 23.5,-56.5T200,120h560q33,0 56.5,23.5T840,200v560q0,33 -23.5,56.5T760,840L200,840ZM200,760h560v-560L200,200v560ZM200,200v560,-560Z"
android:fillColor="#E3E2E2"/>
</vector>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.droidkaigi.confsched.sessions

import androidx.compose.animation.Crossfade
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
Expand All @@ -14,9 +15,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.GridView
import androidx.compose.material.icons.filled.Search
import androidx.compose.material.icons.filled.ViewTimeline
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.Scaffold
Expand All @@ -39,6 +38,8 @@ import androidx.navigation.NavController
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import conference_app_2024.feature.sessions.generated.resources.ic_grid_view
import conference_app_2024.feature.sessions.generated.resources.ic_view_timeline
import conference_app_2024.feature.sessions.generated.resources.timetable
import io.github.droidkaigi.confsched.compose.EventEmitter
import io.github.droidkaigi.confsched.compose.rememberEventEmitter
Expand All @@ -57,6 +58,7 @@ import io.github.droidkaigi.confsched.ui.UserMessageStateHolderImpl
import io.github.droidkaigi.confsched.ui.compositionlocal.FakeClock
import io.github.droidkaigi.confsched.ui.compositionlocal.LocalClock
import kotlinx.collections.immutable.toPersistentMap
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.resources.stringResource
import org.jetbrains.compose.ui.tooling.preview.Preview

Expand Down Expand Up @@ -168,12 +170,13 @@ private fun TimetableScreen(
},
)
Crossfade(targetState = uiState.timetableUiType) { timetableUiType ->
Icon(
imageVector = if (timetableUiType == Grid) {
Icons.Default.ViewTimeline
} else {
Icons.Default.GridView
},
val iconRes = if (timetableUiType == Grid) {
SessionsRes.drawable.ic_view_timeline
} else {
SessionsRes.drawable.ic_grid_view
}
Image(
painter = painterResource(iconRes),
contentDescription = null,
modifier = Modifier.padding(8.dp).clickable {
onTimetableUiChangeClick()
Expand Down

0 comments on commit e066410

Please sign in to comment.