-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
174 additions
and
62 deletions.
There are no files selected for viewing
Binary file added
BIN
+174 KB
composeApp/src/commonMain/composeResources/font/PoetsenOne-Regular.ttf
Binary file not shown.
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
44 changes: 44 additions & 0 deletions
44
composeApp/src/commonMain/kotlin/in/procyk/shin/ui/component/BottomBanner.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,44 @@ | ||
package `in`.procyk.shin.ui.component | ||
|
||
import androidx.compose.foundation.layout.* | ||
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.vector.ImageVector | ||
import androidx.compose.ui.platform.LocalUriHandler | ||
import androidx.compose.ui.unit.dp | ||
|
||
data class BottomBannerItem( | ||
val url: String, | ||
val icon: ImageVector, | ||
) { | ||
} | ||
|
||
@Composable | ||
internal fun BottomBanner( | ||
title: String?, | ||
vararg items: BottomBannerItem, | ||
) { | ||
Column( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(bottom = 12.dp), | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
verticalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
title?.let { Text(it) } | ||
Row( | ||
modifier = Modifier.fillMaxWidth(), | ||
horizontalArrangement = Arrangement.spacedBy(16.dp, Alignment.CenterHorizontally) | ||
) { | ||
val uriHandler = LocalUriHandler.current | ||
for (item in items) { | ||
ShinIconButton( | ||
onClick = { uriHandler.openUri(item.url) }, | ||
icon = item.icon, | ||
) | ||
} | ||
} | ||
} | ||
} |
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
53 changes: 53 additions & 0 deletions
53
composeApp/src/commonMain/kotlin/in/procyk/shin/ui/component/ShinIconButton.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,53 @@ | ||
package `in`.procyk.shin.ui.component | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.interaction.MutableInteractionSource | ||
import androidx.compose.foundation.interaction.collectIsHoveredAsState | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.LocalContentColor | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
|
||
@Composable | ||
internal fun ShinIconButton( | ||
onClick: () -> Unit, | ||
icon: ImageVector, | ||
iconOutlined: ImageVector = icon, | ||
contentDescription: String? = null, | ||
size: Dp = 24.dp, | ||
hoveredColor: Color = LocalContentColor.current, | ||
notHoveredColor: Color = hoveredColor.copy(alpha = 0.6f), | ||
) { | ||
val interactionSource = remember { MutableInteractionSource() } | ||
val isHovered by interactionSource.collectIsHoveredAsState() | ||
Box( | ||
contentAlignment = Alignment.Center, | ||
modifier = Modifier | ||
.padding(12.dp) | ||
.clickable( | ||
onClick = onClick, | ||
interactionSource = interactionSource, | ||
indication = null, | ||
) | ||
) { | ||
Icon( | ||
imageVector = if (isHovered) icon else iconOutlined, | ||
contentDescription = contentDescription, | ||
modifier = Modifier.size(size), | ||
tint = when { | ||
isHovered -> hoveredColor | ||
else -> notHoveredColor | ||
} | ||
) | ||
} | ||
} |
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
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