Skip to content

Commit

Permalink
Merge pull request #277 from WonJoongLee/isaac/issue-207
Browse files Browse the repository at this point in the history
Change time table icon by state
  • Loading branch information
takahirom authored Aug 11, 2024
2 parents 7a8480e + b4032a1 commit 9e0161d
Showing 1 changed file with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.droidkaigi.confsched.sessions

import androidx.compose.animation.Crossfade
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
Expand All @@ -13,8 +14,9 @@ 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.Grid3x3
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 Down Expand Up @@ -45,6 +47,7 @@ import io.github.droidkaigi.confsched.model.DroidKaigi2024Day
import io.github.droidkaigi.confsched.model.Timetable
import io.github.droidkaigi.confsched.model.TimetableItem
import io.github.droidkaigi.confsched.model.TimetableUiType
import io.github.droidkaigi.confsched.model.TimetableUiType.Grid
import io.github.droidkaigi.confsched.sessions.section.TimetableListUiState
import io.github.droidkaigi.confsched.sessions.section.TimetableSheet
import io.github.droidkaigi.confsched.sessions.section.TimetableSheetUiState
Expand Down Expand Up @@ -158,13 +161,19 @@ private fun TimetableScreen(
modifier = Modifier.padding(8.dp).clickable {
},
)
Icon(
imageVector = Icons.Default.Grid3x3,
contentDescription = null,
modifier = Modifier.padding(8.dp).clickable {
onTimetableUiChangeClick()
}.testTag(TimetableUiTypeChangeButtonTestTag),
)
Crossfade(targetState = uiState.timetableUiType) { timetableUiType ->
Icon(
imageVector = if (timetableUiType == Grid) {
Icons.Default.ViewTimeline
} else {
Icons.Default.GridView
},
contentDescription = null,
modifier = Modifier.padding(8.dp).clickable {
onTimetableUiChangeClick()
}.testTag(TimetableUiTypeChangeButtonTestTag),
)
}
}
},
)
Expand Down

0 comments on commit 9e0161d

Please sign in to comment.