-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement event map screen #105
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
27 changes: 26 additions & 1 deletion
27
core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/EventMapEvent.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 |
---|---|---|
@@ -1,3 +1,28 @@ | ||
package io.github.droidkaigi.confsched.model | ||
|
||
class EventMapEvent | ||
import kotlinx.datetime.LocalTime | ||
|
||
class EventMapEvent( | ||
val name: String, | ||
val roomName: String, | ||
val dateLabel: String, | ||
val isFavorite: Boolean, | ||
val description: String, | ||
private val startTime: LocalTime, | ||
private val endTime: LocalTime, | ||
) { | ||
val timeDuration: String | ||
get() = "$startTime ~ $endTime" | ||
} | ||
|
||
fun createSampleEventMapEvent( | ||
isFavorite: Boolean = false, | ||
) = EventMapEvent( | ||
name = "ランチミートアップ", | ||
roomName = "Arctic Fox", | ||
dateLabel = "DAY1", | ||
isFavorite = isFavorite, | ||
description = "様々なテーマごとに集まって、一緒にランチを食べながらお話ししましょう。席に限りがありますので、お弁当受け取り後お早めにお越しください。", | ||
startTime = LocalTime(10, 30), | ||
endTime = LocalTime(12, 30), | ||
) |
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
188 changes: 188 additions & 0 deletions
188
feature/eventmap/src/commonMain/composeResources/drawable/event_map.xml
Large diffs are not rendered by default.
Oops, something went wrong.
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
113 changes: 104 additions & 9 deletions
113
...p/src/commonMain/kotlin/io/github/droidkaigi/confsched/eventmap/component/EventMapItem.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 |
---|---|---|
@@ -1,39 +1,134 @@ | ||
package io.github.droidkaigi.confsched.eventmap.component | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.border | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.Star | ||
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.text.style.TextOverflow | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import io.github.droidkaigi.confsched.model.EventMapEvent | ||
|
||
@Composable | ||
fun EventMapItem( | ||
eventMapEvent: EventMapEvent, | ||
@Suppress("UnusedParameter") | ||
onClick: (url: String) -> Unit, | ||
onClickFavorite: (eventMapEvent: EventMapEvent) -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Row( | ||
val green = Color(0xFF45E761) | ||
val gray = Color(0xFFC5C7C4) | ||
Column( | ||
modifier = modifier | ||
.border(1.dp, gray, RoundedCornerShape(5.dp)) | ||
.background(Color.Transparent, RoundedCornerShape(5.dp)) | ||
.clickable { | ||
// eventMapEvent.profileUrl?.let(onClick) | ||
} | ||
.padding(horizontal = 16.dp, vertical = 10.dp), | ||
.padding(12.dp), | ||
verticalArrangement = Arrangement.Top, | ||
horizontalAlignment = Alignment.Start, | ||
) { | ||
Row( | ||
verticalAlignment = Alignment.CenterVertically, | ||
horizontalArrangement = Arrangement.Start, | ||
) { | ||
ToolTip( | ||
text = eventMapEvent.roomName, | ||
icon = Icons.Filled.Star, | ||
color = green, | ||
) | ||
Spacer(Modifier.width(4.dp)) | ||
ToolTip( | ||
text = eventMapEvent.dateLabel, | ||
color = Color(0xFFBFC9C2), | ||
) | ||
Spacer(Modifier.weight(1F)) | ||
Icon( | ||
imageVector = Icons.Default.Star, | ||
contentDescription = null, | ||
modifier = Modifier.size(24.dp).clickable { onClickFavorite(eventMapEvent) }, | ||
tint = if (eventMapEvent.isFavorite) green else gray, | ||
) | ||
} | ||
Spacer(Modifier.height(8.dp)) | ||
Text( | ||
text = eventMapEvent.name, | ||
fontSize = 17.sp, | ||
lineHeight = 23.8.sp, | ||
fontWeight = FontWeight.W600, | ||
letterSpacing = 0.1.sp, | ||
color = gray, | ||
) | ||
Spacer(Modifier.height(8.dp)) | ||
Text( | ||
text = eventMapEvent.description, | ||
fontSize = 13.sp, | ||
lineHeight = 20.sp, | ||
fontWeight = FontWeight.W400, | ||
letterSpacing = 0.25.sp, | ||
color = Color.White.copy(alpha = 0.7F), | ||
) | ||
Spacer(Modifier.height(8.dp)) | ||
Text( | ||
text = eventMapEvent.timeDuration, | ||
fontSize = 11.sp, | ||
lineHeight = 15.sp, | ||
fontWeight = FontWeight.W600, | ||
letterSpacing = 0.1.sp, | ||
color = green, | ||
) | ||
} | ||
} | ||
|
||
@Composable | ||
private fun ToolTip( | ||
text: String, | ||
icon: ImageVector? = null, | ||
color: Color = Color(0xFFC5C7C4), | ||
backgroundColor: Color = Color.Transparent, | ||
) { | ||
Row( | ||
verticalAlignment = Alignment.CenterVertically, | ||
horizontalArrangement = Arrangement.spacedBy(23.dp), | ||
modifier = Modifier | ||
.border(1.dp, color) | ||
.background(backgroundColor, RoundedCornerShape(0.dp)) | ||
.padding(vertical = 4.5.dp, horizontal = 8.dp), | ||
) { | ||
icon?.let { | ||
Icon( | ||
imageVector = icon, | ||
contentDescription = null, | ||
tint = color, | ||
modifier = Modifier.size(12.dp), | ||
) | ||
Spacer(Modifier.width(3.dp)) | ||
} | ||
Text( | ||
text = "EventMapItem + $eventMapEvent", | ||
style = MaterialTheme.typography.bodyLarge, | ||
maxLines = 2, | ||
overflow = TextOverflow.Ellipsis, | ||
text = text, | ||
fontSize = 12.sp, | ||
lineHeight = 16.sp, | ||
letterSpacing = 0.5.sp, | ||
fontWeight = FontWeight.W500, | ||
color = color, | ||
) | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
composeResources 🎉