Skip to content

Commit

Permalink
Merge pull request #1183 from joreilly/ui_updates
Browse files Browse the repository at this point in the history
ui updates
  • Loading branch information
joreilly authored Mar 9, 2024
2 parents 3c966b1 + a08f39b commit 63106b6
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fun ConfettiHeaderAndroid(
tonalElevation
},
modifier = modifier
.fillMaxWidth().padding(vertical = 8.dp),
.fillMaxWidth()
) {
Column {
Divider()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ object Sessionize {
config = DConfig(
id = ConferenceId.DevFestIreland2023.id,
name = "DevFest Ireland 2023",
timeZone = "Europe/Dublin"
timeZone = "Europe/Dublin",
themeColor = "0xFF009A44"
),
venue = DVenue(
id = "main",
Expand Down Expand Up @@ -265,6 +266,7 @@ object Sessionize {
LocalDate(2023, 9, 14),
LocalDate(2023, 9, 15)
),
themeColor = "0xFFFFBE29"
),
venue = DVenue(
id = "main",
Expand Down Expand Up @@ -364,6 +366,7 @@ object Sessionize {
id = ConferenceId.DevFestStockholm2023.id,
name = "DevFest Stockholm 2023",
timeZone = "Europe/Stockholm",
themeColor = "0xFFFECC02"
),
venue = DVenue(
id = "main",
Expand All @@ -387,7 +390,7 @@ object Sessionize {
id = ConferenceId.DevFestSriLanka2023.id,
name = "DevFest Sri Lanka 2023",
timeZone = "Asia/Colombo",
themeColor = "0xFF000080"
themeColor = "0xFFFFBE29"
),
venue = DVenue(
id = "main",
Expand Down Expand Up @@ -433,7 +436,7 @@ object Sessionize {
id = ConferenceId.SheDevWarsaw2024.id,
name = "SHEDEV Warsaw 2024",
timeZone = "Europe/Warsaw",
themeColor = "0xFF800000"
themeColor = "0xFF512DA8"
),
venue = DVenue(
id = "main",
Expand Down
4 changes: 2 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ default_platform :android

platform :android do

androidVersionNum = 225
wearVersionNum = 324
androidVersionNum = 228
wearVersionNum = 325

before_all do
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ import androidx.compose.material3.Card
import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MediumTopAppBar
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import conferenceDayMonthFormat
import dev.johnoreilly.confetti.GetConferencesQuery
import kotlinx.datetime.LocalDate
Expand All @@ -32,25 +36,26 @@ import kotlinx.datetime.LocalDate
fun ConferenceListView(conferenceListByYear: Map<Int, List<GetConferencesQuery.Conference>>, navigateToConference: (GetConferencesQuery.Conference) -> Unit) {
Scaffold(
topBar = {
CenterAlignedTopAppBar(
title = {
Text(
modifier = Modifier.padding(horizontal = 32.dp),
maxLines = 2,
textAlign = TextAlign.Center,
text = "Confetti",
style = MaterialTheme.typography.titleLarge
)
}
)
Surface(tonalElevation = 0.dp) {
MediumTopAppBar(
title = {
Text(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 32.dp),
maxLines = 2,
textAlign = TextAlign.Center,
text = "Confetti",
fontSize = 32.sp,
)
}
)
}
}) {
LazyColumn(Modifier.padding(it)) {
conferenceListByYear.forEach { (year, conferenceList) ->
stickyHeader {
Text(text = year.toString(),
modifier = Modifier.fillMaxWidth(),
textAlign = TextAlign.Center,
style = MaterialTheme.typography.titleLarge)
YearHeader(year.toString())
}

items(conferenceList) { conference ->
Expand All @@ -63,19 +68,24 @@ fun ConferenceListView(conferenceListByYear: Map<Int, List<GetConferencesQuery.C


@Composable
fun ConferenceCard(conference: GetConferencesQuery.Conference, navigateToConference: (GetConferencesQuery.Conference) -> Unit) {
fun ConferenceCard(
conference: GetConferencesQuery.Conference,
navigateToConference: (GetConferencesQuery.Conference) -> Unit
) {
ConferenceMaterialTheme(conference.themeColor) {
Card(modifier = Modifier
.clip(shape = RoundedCornerShape(8.dp))
.clickable(onClick = {
navigateToConference(conference)
})
.padding(8.dp)
.fillMaxWidth()
Card(
modifier = Modifier
.clip(shape = RoundedCornerShape(8.dp))
.clickable(onClick = {
navigateToConference(conference)
})
.padding(8.dp)
.fillMaxWidth()
) {
Column(Modifier.padding(16.dp)) {
Column(Modifier.fillMaxWidth().padding(16.dp),
horizontalAlignment = Alignment.CenterHorizontally) {
Text(conference.name, style = MaterialTheme.typography.titleMedium)
Text(getConferenceDatesString(conference.days), style = MaterialTheme.typography.titleSmall)
Text(getConferenceDatesString(conference.days), style = MaterialTheme.typography.bodyLarge)
}
}
}
Expand All @@ -92,3 +102,20 @@ private fun getConferenceDatesString(days: List<LocalDate>): String {
}
return conferenceDatesString
}

@Composable
fun YearHeader(
text: String,
modifier: Modifier = Modifier,
) {
Surface(
color = MaterialTheme.colorScheme.surface,
modifier = modifier.fillMaxWidth(),
) {
Text(
text = text,
textAlign = TextAlign.Center,
style = MaterialTheme.typography.titleLarge
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.graphics.Color
import com.materialkolor.PaletteStyle
import com.materialkolor.rememberDynamicColorScheme
import dev.johnoreilly.confetti.AppSettings
import org.koin.compose.koinInject
Expand All @@ -22,7 +23,7 @@ fun ConferenceMaterialTheme(
) {
val appSettings = koinInject<AppSettings>()
val darkThemeConfigString by appSettings.settings.getStringFlow("darkThemeConfigKey", DarkThemeConfig.FOLLOW_SYSTEM.toString())
.collectAsState("FOLLOW_SYSTEM")
.collectAsState(DarkThemeConfig.FOLLOW_SYSTEM.toString())
val darkThemeConfig = DarkThemeConfig.valueOf(darkThemeConfigString)
val shouldUseDarkTheme = shouldUseDarkTheme(darkThemeConfig)

Expand Down

0 comments on commit 63106b6

Please sign in to comment.