Skip to content

Commit a23af00

Browse files
authored
Merge pull request #479 from JetBrains/design-fixes
Various design fixes
2 parents ad88cc2 + 3d5246b commit a23af00

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

shared/src/commonMain/composeResources/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ We will process your data in accordance with the App Privacy Notice. You can adj
124124
<item quantity="other">%1$d sessions found</item>
125125
</plurals>
126126

127-
<string name="session_title">Schedule</string>
127+
<string name="session_title">Session</string>
128128
<string name="session_your_feedback">Your feedback</string>
129129
<string name="session_screen_error">The details of this session are not available at the moment.</string>
130130
<string name="session_watch_video">Watch the recording</string>

shared/src/commonMain/kotlin/org/jetbrains/kotlinconf/screens/DeveloperMenuScreen.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.fillMaxSize
1313
import androidx.compose.foundation.layout.fillMaxWidth
1414
import androidx.compose.foundation.layout.height
1515
import androidx.compose.foundation.layout.padding
16+
import androidx.compose.foundation.layout.sizeIn
1617
import androidx.compose.foundation.layout.width
1718
import androidx.compose.foundation.layout.widthIn
1819
import androidx.compose.foundation.rememberScrollState
@@ -206,7 +207,9 @@ fun DeveloperMenuScreen(
206207
Image(
207208
painter = painterResource(Res.drawable.kodee_frightened),
208209
contentDescription = null,
209-
modifier = Modifier.align(Alignment.CenterHorizontally).padding(bottom = 12.dp)
210+
modifier = Modifier.align(Alignment.CenterHorizontally)
211+
.padding(bottom = 12.dp)
212+
.sizeIn(maxWidth = 300.dp, maxHeight = 300.dp)
210213
)
211214
Spacer(Modifier.height(24.dp))
212215
Text(

shared/src/commonMain/kotlin/org/jetbrains/kotlinconf/screens/ScheduleScreen.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ import androidx.compose.foundation.layout.Box
88
import androidx.compose.foundation.layout.Column
99
import androidx.compose.foundation.layout.PaddingValues
1010
import androidx.compose.foundation.layout.RowScope
11+
import androidx.compose.foundation.layout.Spacer
1112
import androidx.compose.foundation.layout.fillMaxSize
1213
import androidx.compose.foundation.layout.fillMaxWidth
14+
import androidx.compose.foundation.layout.height
1315
import androidx.compose.foundation.layout.padding
1416
import androidx.compose.foundation.lazy.LazyColumn
1517
import androidx.compose.foundation.lazy.LazyListState
@@ -441,6 +443,7 @@ private fun ScheduleList(
441443
scheduleItems,
442444
key = {
443445
when (it) {
446+
is DaySeparatorItem -> it.id
444447
is DayHeaderItem -> it.value.date.toString()
445448
is ServiceEventGroupItem -> it.value.map { it.id.id }
446449
is ServiceEventItem -> it.value.id.id
@@ -453,6 +456,10 @@ private fun ScheduleList(
453456
) { item ->
454457
Box(Modifier.animateItem()) {
455458
when (item) {
459+
is DaySeparatorItem -> {
460+
Spacer(modifier = Modifier.height(48.dp))
461+
}
462+
456463
is DayHeaderItem -> {
457464
val date = item.value.date
458465
val dayValues = DayValues.map[date]
@@ -463,7 +470,7 @@ private fun ScheduleList(
463470
line2 = dayValues?.line2 ?: "",
464471
modifier = Modifier
465472
.fillMaxWidth()
466-
.padding(top = 8.dp)
473+
.padding(vertical = 16.dp)
467474
.semantics { heading() }
468475
)
469476
}
@@ -475,9 +482,7 @@ private fun ScheduleList(
475482
modifier = Modifier
476483
.padding(horizontal = 12.dp)
477484
.padding(top = 24.dp, bottom = 8.dp)
478-
.semantics {
479-
heading()
480-
}
485+
.semantics { heading() }
481486
)
482487
}
483488

shared/src/commonMain/kotlin/org/jetbrains/kotlinconf/screens/ScheduleViewModel.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import org.jetbrains.kotlinconf.Day
1818
import org.jetbrains.kotlinconf.Score
1919
import org.jetbrains.kotlinconf.SessionCardView
2020
import org.jetbrains.kotlinconf.SessionId
21+
import org.jetbrains.kotlinconf.SessionState
2122
import org.jetbrains.kotlinconf.TagValues
2223
import org.jetbrains.kotlinconf.TimeProvider
2324
import org.jetbrains.kotlinconf.TimeSlot
@@ -30,6 +31,8 @@ import org.jetbrains.kotlinconf.utils.removeDiacritics
3031

3132
sealed interface ScheduleListItem
3233

34+
data class DaySeparatorItem(val id: String) : ScheduleListItem
35+
3336
data class DayHeaderItem(val value: Day) : ScheduleListItem
3437

3538
data class TimeSlotTitleItem(val value: TimeSlot) : ScheduleListItem
@@ -176,7 +179,7 @@ class ScheduleViewModel(
176179
days: List<Day>,
177180
searchQuery: String,
178181
selectedTags: List<String>,
179-
): List<ScheduleListItem> = buildList {
182+
): List<SessionItem> = buildList {
180183
for (day in days) {
181184
for (timeSlot in day.timeSlots) {
182185
for (session in timeSlot.sessions) {
@@ -199,7 +202,7 @@ class ScheduleViewModel(
199202
}
200203
}
201204
}
202-
}
205+
}.sortedBy { it.value.state == SessionState.Past }
203206

204207
private fun buildNonSearchItems(
205208
days: List<Day>,
@@ -211,7 +214,10 @@ class ScheduleViewModel(
211214
var seenPastSlot = false
212215

213216
val items = buildList {
214-
days.forEach { day ->
217+
days.forEachIndexed { index, day ->
218+
if (index > 0) {
219+
add(DaySeparatorItem("day-separator-$index"))
220+
}
215221
add(DayHeaderItem(day))
216222

217223
day.timeSlots.forEachIndexed { index, timeSlot ->

0 commit comments

Comments
 (0)