-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into renovate/org.openapi.generator-7.x
- Loading branch information
Showing
10 changed files
with
494 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
conferences-app/src/androidDebug/kotlin/io/ashdavies/party/events/EventsDetail.preview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.ashdavies.party.events | ||
|
||
import androidx.compose.runtime.Composable | ||
import io.ashdavies.party.tooling.MaterialPreviewTheme | ||
import io.ashdavies.party.tooling.PreviewDayNight | ||
|
||
@Composable | ||
@PreviewDayNight | ||
internal fun EventsDetailPreview() { | ||
MaterialPreviewTheme { | ||
EventsDetail(DroidconBerlin) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 14 additions & 27 deletions
41
conferences-app/src/androidDebug/kotlin/io/ashdavies/party/gallery/GalleryScreen.preview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
conferences-app/src/androidDebug/kotlin/io/ashdavies/party/tooling/MaterialPreviewTheme.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.ashdavies.party.tooling | ||
|
||
import androidx.compose.foundation.isSystemInDarkTheme | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Surface | ||
import androidx.compose.material3.darkColorScheme | ||
import androidx.compose.material3.lightColorScheme | ||
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi | ||
import androidx.compose.material3.windowsizeclass.WindowSizeClass | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.CompositionLocalProvider | ||
import androidx.compose.ui.unit.DpSize | ||
import androidx.compose.ui.unit.dp | ||
import io.ashdavies.party.material.LocalWindowSizeClass | ||
|
||
@Composable | ||
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class) | ||
internal fun MaterialPreviewTheme( | ||
size: DpSize = DpSize(1280.dp, 720.dp), | ||
content: @Composable () -> Unit, | ||
) { | ||
MaterialTheme(if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()) { | ||
CompositionLocalProvider( | ||
value = LocalWindowSizeClass provides WindowSizeClass.calculateFromSize(size), | ||
content = { Surface(content = content) }, | ||
) | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
conferences-app/src/commonMain/kotlin/io/ashdavies/party/events/EventsDetail.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package io.ashdavies.party.events | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.outlined.Event | ||
import androidx.compose.material.icons.outlined.MyLocation | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.dp | ||
import coil3.compose.AsyncImage | ||
|
||
@Composable | ||
internal fun EventsDetail( | ||
event: Event, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Column(modifier) { | ||
AsyncImage( | ||
model = event.imageUrl, | ||
contentDescription = null, | ||
modifier = Modifier | ||
.background(Color.DarkGray) | ||
.fillMaxWidth() | ||
.height(300.dp), | ||
placeholder = null, | ||
) | ||
|
||
Row( | ||
modifier = Modifier.padding(top = 8.dp), | ||
verticalAlignment = Alignment.CenterVertically, | ||
) { | ||
Icon( | ||
imageVector = Icons.Outlined.Event, | ||
contentDescription = null, | ||
modifier = Modifier.padding(16.dp), | ||
) | ||
|
||
Column { | ||
Text("${event.dateStart} - ${event.dateEnd}") | ||
} | ||
} | ||
|
||
Row( | ||
modifier = Modifier.padding(top = 8.dp), | ||
verticalAlignment = Alignment.CenterVertically, | ||
) { | ||
Icon( | ||
imageVector = Icons.Outlined.MyLocation, | ||
contentDescription = null, | ||
modifier = Modifier.padding(16.dp), | ||
) | ||
|
||
Column { | ||
Text(event.location) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.