Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3ea4d36c3 | ||
|
|
58f2766c57 | ||
|
|
50cc40ddaf | ||
|
|
b28fd42bfa | ||
|
|
570754fabe | ||
|
|
86921dc35c | ||
|
|
792f1d127f | ||
|
|
6d62019d3b |
@@ -12,6 +12,9 @@
|
|||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> **Matewave is coming to Google Play!** The app is now in closed testing there ahead of the public release. Ideas, wishes and suggestions for improvement are very welcome — send them wherever is easiest for you: an issue on [Gitea](https://git.skysparkle.cc/kalarina/Matewave/issues) or [GitHub](https://github.com/kalarina-bit/Matewave/issues), or an email to [cuken107@proton.me](mailto:cuken107@proton.me).
|
> **Matewave is coming to Google Play!** The app is now in closed testing there ahead of the public release. Ideas, wishes and suggestions for improvement are very welcome — send them wherever is easiest for you: an issue on [Gitea](https://git.skysparkle.cc/kalarina/Matewave/issues) or [GitHub](https://github.com/kalarina-bit/Matewave/issues), or an email to [cuken107@proton.me](mailto:cuken107@proton.me).
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> **Looking for designers!** Matewave is looking for volunteer designers to help with icons, logos, animations, cover art (store graphics) and UI design. This is unpaid help for an open-source project. If you're interested, write to [cuken107@proton.me](mailto:cuken107@proton.me).
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/kalarina-bit/Matewave/releases/latest"><img src="https://img.shields.io/github/v/release/kalarina-bit/Matewave?style=for-the-badge&label=release&labelColor=1b1b1b&color=2e7d32" alt="Latest release"></a>
|
<a href="https://github.com/kalarina-bit/Matewave/releases/latest"><img src="https://img.shields.io/github/v/release/kalarina-bit/Matewave?style=for-the-badge&label=release&labelColor=1b1b1b&color=2e7d32" alt="Latest release"></a>
|
||||||
</p>
|
</p>
|
||||||
@@ -24,9 +27,9 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="assets/screenshots/1-play-learn-solve-left.png" width="160" alt="Play, learn, solve"><img src="assets/screenshots/2-play-learn-solve-right.png" width="160" alt="Home screen">
|
<img src="assets/screenshots/1-play-learn-solve.png" width="200" alt="Play, learn, solve">
|
||||||
<img src="assets/screenshots/3-play-ai-or-a-friend.png" width="160" alt="Play AI or a friend">
|
<img src="assets/screenshots/2-play-ai-or-a-friend.png" width="200" alt="Play AI or a friend">
|
||||||
<img src="assets/screenshots/4-puzzles.png" width="160" alt="Puzzles for your rating">
|
<img src="assets/screenshots/3-puzzles.png" width="200" alt="Puzzles for your rating">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ android {
|
|||||||
applicationId = "cc.skysparkle.matewave"
|
applicationId = "cc.skysparkle.matewave"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 36
|
targetSdk = 36
|
||||||
versionCode = 6
|
versionCode = 9
|
||||||
versionName = "1.0.48"
|
versionName = "1.0.49"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package cc.skysparkle.matewave
|
package cc.skysparkle.matewave
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
@@ -57,7 +56,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
// The app has one dark look: light system bar icons over the background photo.
|
// The app has one dark look: light system bar icons over the dark backdrop.
|
||||||
enableEdgeToEdge(
|
enableEdgeToEdge(
|
||||||
statusBarStyle = SystemBarStyle.dark(android.graphics.Color.TRANSPARENT),
|
statusBarStyle = SystemBarStyle.dark(android.graphics.Color.TRANSPARENT),
|
||||||
navigationBarStyle = SystemBarStyle.dark(android.graphics.Color.TRANSPARENT)
|
navigationBarStyle = SystemBarStyle.dark(android.graphics.Color.TRANSPARENT)
|
||||||
@@ -79,12 +78,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
androidx.compose.foundation.layout.Box(
|
androidx.compose.foundation.layout.Box(
|
||||||
modifier = androidx.compose.ui.Modifier.fillMaxSize()
|
modifier = androidx.compose.ui.Modifier.fillMaxSize()
|
||||||
) {
|
) {
|
||||||
cc.skysparkle.matewave.ui.components.AppBackgroundImage()
|
cc.skysparkle.matewave.ui.components.AppBackdrop()
|
||||||
androidx.compose.foundation.layout.Box(
|
|
||||||
modifier = androidx.compose.ui.Modifier
|
|
||||||
.fillMaxSize()
|
|
||||||
.background(cc.skysparkle.matewave.ui.theme.PhotoScrim)
|
|
||||||
)
|
|
||||||
AppNavHost()
|
AppNavHost()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package cc.skysparkle.matewave.ui.components
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.BitmapFactory
|
import android.graphics.BitmapFactory
|
||||||
import android.util.DisplayMetrics
|
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
@@ -14,12 +13,19 @@ import androidx.compose.runtime.mutableStateOf
|
|||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.draw.drawWithCache
|
||||||
|
import androidx.compose.ui.geometry.Offset
|
||||||
|
import androidx.compose.ui.graphics.Brush
|
||||||
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
|
import androidx.compose.ui.graphics.ColorMatrix
|
||||||
import androidx.compose.ui.graphics.ImageBitmap
|
import androidx.compose.ui.graphics.ImageBitmap
|
||||||
import androidx.compose.ui.graphics.asImageBitmap
|
import androidx.compose.ui.graphics.asImageBitmap
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import cc.skysparkle.matewave.R
|
import cc.skysparkle.matewave.R
|
||||||
|
import cc.skysparkle.matewave.ui.theme.AppBackground
|
||||||
|
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Lime
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
|
|
||||||
@@ -32,7 +38,7 @@ private object BackgroundAssetCache {
|
|||||||
bitmap?.let { return it }
|
bitmap?.let { return it }
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
bitmap?.let { return it }
|
bitmap?.let { return it }
|
||||||
val metrics: DisplayMetrics = context.resources.displayMetrics
|
val metrics = context.resources.displayMetrics
|
||||||
val target = maxOf(metrics.widthPixels, metrics.heightPixels).coerceAtLeast(1)
|
val target = maxOf(metrics.widthPixels, metrics.heightPixels).coerceAtLeast(1)
|
||||||
|
|
||||||
val bounds = BitmapFactory.Options().apply { inJustDecodeBounds = true }
|
val bounds = BitmapFactory.Options().apply { inJustDecodeBounds = true }
|
||||||
@@ -55,10 +61,25 @@ private object BackgroundAssetCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
/** Slight green cast so the grey mist matches the accent colours. */
|
||||||
fun AppBackgroundImage() {
|
private val ForestTint = ColorFilter.colorMatrix(
|
||||||
val context = LocalContext.current
|
ColorMatrix(
|
||||||
|
floatArrayOf(
|
||||||
|
0.80f, 0f, 0f, 0f, 0f,
|
||||||
|
0f, 0.95f, 0f, 0f, 6f,
|
||||||
|
0f, 0f, 0.85f, 0f, 2f,
|
||||||
|
0f, 0f, 0f, 1f, 0f
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The misty forest artwork, deeply darkened so it reads as texture: the mist stays
|
||||||
|
* visible behind the headings at the top and fades into near-black lower down.
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun AppBackdrop() {
|
||||||
|
val context = LocalContext.current
|
||||||
var bitmap by remember { mutableStateOf(BackgroundAssetCache.cached()) }
|
var bitmap by remember { mutableStateOf(BackgroundAssetCache.cached()) }
|
||||||
|
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
@@ -67,15 +88,42 @@ fun AppBackgroundImage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val image = bitmap
|
Box(modifier = Modifier.fillMaxSize().background(AppBackground)) {
|
||||||
if (image != null) {
|
bitmap?.let { image ->
|
||||||
Image(
|
Image(
|
||||||
bitmap = image,
|
bitmap = image,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
contentScale = ContentScale.Crop
|
contentScale = ContentScale.Crop,
|
||||||
|
colorFilter = ForestTint
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.drawWithCache {
|
||||||
|
val shade = Brush.verticalGradient(
|
||||||
|
0.00f to AppBackground.copy(alpha = 0.72f),
|
||||||
|
0.30f to AppBackground.copy(alpha = 0.80f),
|
||||||
|
0.60f to AppBackground.copy(alpha = 0.90f),
|
||||||
|
1.00f to AppBackground.copy(alpha = 0.96f)
|
||||||
|
)
|
||||||
|
val glow = Brush.radialGradient(
|
||||||
|
colors = listOf(ChessGreen.copy(alpha = 0.14f), ChessGreen.copy(alpha = 0f)),
|
||||||
|
center = Offset(size.width * 0.9f, 0f),
|
||||||
|
radius = size.maxDimension * 0.5f
|
||||||
|
)
|
||||||
|
val lime = Brush.radialGradient(
|
||||||
|
colors = listOf(Lime.copy(alpha = 0.05f), Lime.copy(alpha = 0f)),
|
||||||
|
center = Offset(0f, size.height),
|
||||||
|
radius = size.maxDimension * 0.45f
|
||||||
|
)
|
||||||
|
onDrawBehind {
|
||||||
|
drawRect(shade)
|
||||||
|
drawRect(glow)
|
||||||
|
drawRect(lime)
|
||||||
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
Box(modifier = Modifier.fillMaxSize().background(Color(0xFF101413)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,37 +2,45 @@ package cc.skysparkle.matewave.ui.components
|
|||||||
|
|
||||||
import cc.skysparkle.matewave.ui.theme.ink
|
import cc.skysparkle.matewave.ui.theme.ink
|
||||||
|
|
||||||
|
import androidx.compose.animation.animateColorAsState
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.RowScope
|
import androidx.compose.foundation.layout.RowScope
|
||||||
import androidx.compose.foundation.layout.Spacer
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.ColorFilter
|
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.res.painterResource
|
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.semantics.Role
|
||||||
|
import androidx.compose.ui.semantics.contentDescription
|
||||||
|
import androidx.compose.ui.semantics.selected
|
||||||
|
import androidx.compose.ui.semantics.semantics
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import cc.skysparkle.matewave.R
|
import cc.skysparkle.matewave.R
|
||||||
import cc.skysparkle.matewave.ui.theme.UiCornerRadius
|
import cc.skysparkle.matewave.ui.theme.FloatingBarFill
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Lime
|
||||||
|
import cc.skysparkle.matewave.ui.theme.OnAccent
|
||||||
|
import cc.skysparkle.matewave.ui.theme.PanelBorder
|
||||||
|
|
||||||
enum class BottomTab { HOME, FRIENDS, SETTINGS, ACCOUNT }
|
enum class BottomTab { HOME, FRIENDS, SETTINGS, ACCOUNT }
|
||||||
|
|
||||||
|
/** Floating pill; the active tab is a lime circle, the others are plain icons. */
|
||||||
@Composable
|
@Composable
|
||||||
fun AppBottomBar(
|
fun AppBottomBar(
|
||||||
current: BottomTab,
|
current: BottomTab,
|
||||||
@@ -43,22 +51,27 @@ fun AppBottomBar(
|
|||||||
|
|
||||||
accountAvatarBase64: String? = null
|
accountAvatarBase64: String? = null
|
||||||
) {
|
) {
|
||||||
|
val shape = RoundedCornerShape(50)
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(horizontal = 24.dp, vertical = 4.dp)
|
.padding(horizontal = 24.dp, vertical = 8.dp)
|
||||||
.background(cc.skysparkle.matewave.ui.theme.FloatingBarFill, RoundedCornerShape(UiCornerRadius))
|
.clip(shape)
|
||||||
.padding(vertical = 6.dp),
|
.background(FloatingBarFill)
|
||||||
horizontalArrangement = Arrangement.SpaceEvenly
|
.border(1.dp, PanelBorder, shape)
|
||||||
|
.padding(horizontal = 8.dp, vertical = 8.dp)
|
||||||
|
.height(52.dp),
|
||||||
|
horizontalArrangement = Arrangement.SpaceEvenly,
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
NavItem(stringResource(R.string.nav_home), current == BottomTab.HOME, onHomeClick) { tint ->
|
NavItem(stringResource(R.string.nav_home), current == BottomTab.HOME, onHomeClick) { tint ->
|
||||||
NavIcon(R.drawable.ic_home, tint)
|
AppIcon(R.drawable.ic_home, size = 24.dp, tint = tint)
|
||||||
}
|
}
|
||||||
NavItem(stringResource(R.string.nav_friends), current == BottomTab.FRIENDS, onFriendsClick) { tint ->
|
NavItem(stringResource(R.string.nav_friends), current == BottomTab.FRIENDS, onFriendsClick) { tint ->
|
||||||
NavIcon(R.drawable.ic_friends, tint)
|
AppIcon(R.drawable.ic_friends, size = 24.dp, tint = tint)
|
||||||
}
|
}
|
||||||
NavItem(stringResource(R.string.nav_settings), current == BottomTab.SETTINGS, onSettingsClick) { tint ->
|
NavItem(stringResource(R.string.nav_settings), current == BottomTab.SETTINGS, onSettingsClick) { tint ->
|
||||||
NavIcon(R.drawable.ic_settings, tint)
|
AppIcon(R.drawable.ic_settings, size = 24.dp, tint = tint)
|
||||||
}
|
}
|
||||||
NavItem(stringResource(R.string.account_title), current == BottomTab.ACCOUNT, onAccountClick) { tint ->
|
NavItem(stringResource(R.string.account_title), current == BottomTab.ACCOUNT, onAccountClick) { tint ->
|
||||||
val bitmap = rememberChatImage(accountAvatarBase64, AVATAR_MAX_DIMENSION_PX)
|
val bitmap = rememberChatImage(accountAvatarBase64, AVATAR_MAX_DIMENSION_PX)
|
||||||
@@ -67,10 +80,10 @@ fun AppBottomBar(
|
|||||||
bitmap = bitmap,
|
bitmap = bitmap,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
modifier = Modifier.size(24.dp).clip(CircleShape)
|
modifier = Modifier.size(28.dp).clip(CircleShape)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
NavIcon(R.drawable.ic_default_avatar, tint)
|
AppIcon(R.drawable.ic_default_avatar, size = 24.dp, tint = tint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,33 +97,30 @@ private fun RowScope.NavItem(
|
|||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
icon: @Composable (tint: Color) -> Unit
|
icon: @Composable (tint: Color) -> Unit
|
||||||
) {
|
) {
|
||||||
val shape = RoundedCornerShape(UiCornerRadius)
|
val fill by animateColorAsState(if (active) Lime else Lime.copy(alpha = 0f), label = "navFill")
|
||||||
val itemColor = if (active) ink else ink.copy(alpha = 0.7f)
|
Box(
|
||||||
Column(
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.clip(shape)
|
.semantics {
|
||||||
.background(if (active) ink.copy(alpha = 0.14f) else ink.copy(alpha = 0f), shape)
|
contentDescription = label
|
||||||
.clickable(onClick = onClick)
|
selected = active
|
||||||
.padding(vertical = 8.dp),
|
}
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
.clickable(
|
||||||
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
|
indication = null,
|
||||||
|
role = Role.Tab,
|
||||||
|
onClick = onClick
|
||||||
|
),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
icon(itemColor)
|
Box(
|
||||||
Spacer(Modifier.height(4.dp))
|
modifier = Modifier
|
||||||
Text(
|
.size(52.dp)
|
||||||
label,
|
.clip(CircleShape)
|
||||||
color = if (active) itemColor else Color.Transparent,
|
.background(fill),
|
||||||
style = MaterialTheme.typography.labelMedium
|
contentAlignment = Alignment.Center
|
||||||
)
|
) {
|
||||||
|
icon(if (active) OnAccent else ink.copy(alpha = 0.6f))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun NavIcon(iconRes: Int, tint: Color) {
|
|
||||||
Image(
|
|
||||||
painter = painterResource(iconRes),
|
|
||||||
contentDescription = null,
|
|
||||||
colorFilter = ColorFilter.tint(tint),
|
|
||||||
modifier = Modifier.size(24.dp)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import androidx.compose.ui.window.DialogWindowProvider
|
|||||||
import cc.skysparkle.matewave.ui.theme.DialogScrimColor
|
import cc.skysparkle.matewave.ui.theme.DialogScrimColor
|
||||||
import cc.skysparkle.matewave.ui.theme.ink
|
import cc.skysparkle.matewave.ui.theme.ink
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@@ -49,8 +50,8 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.window.Dialog
|
import androidx.compose.ui.window.Dialog
|
||||||
|
|
||||||
val DialogSurface = Color(0xFF262B29)
|
val DialogSurface = cc.skysparkle.matewave.ui.theme.Surface1
|
||||||
val DialogAccent = Color(0xFF93DBA3)
|
val DialogAccent = cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
val DialogShape = RoundedCornerShape(28.dp)
|
val DialogShape = RoundedCornerShape(28.dp)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -115,7 +116,7 @@ fun AppDialog(
|
|||||||
}
|
}
|
||||||
.clip(DialogShape)
|
.clip(DialogShape)
|
||||||
.background(DialogSurface)
|
.background(DialogSurface)
|
||||||
|
.border(1.dp, cc.skysparkle.matewave.ui.theme.PanelBorder, DialogShape)
|
||||||
.clickable(
|
.clickable(
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
indication = null
|
indication = null
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package cc.skysparkle.matewave.ui.components
|
package cc.skysparkle.matewave.ui.components
|
||||||
|
|
||||||
import cc.skysparkle.matewave.ui.theme.ink
|
|
||||||
|
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.material3.LocalContentColor
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
@@ -17,7 +16,7 @@ import androidx.compose.ui.unit.dp
|
|||||||
fun AppIcon(
|
fun AppIcon(
|
||||||
resId: Int,
|
resId: Int,
|
||||||
size: Dp = 20.dp,
|
size: Dp = 20.dp,
|
||||||
tint: Color = ink,
|
tint: Color = LocalContentColor.current,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
contentDescription: String? = null
|
contentDescription: String? = null
|
||||||
) {
|
) {
|
||||||
@@ -30,6 +29,6 @@ fun AppIcon(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ButtonIcon(resId: Int, tint: Color = ink, size: Dp = 18.dp) {
|
fun ButtonIcon(resId: Int, tint: Color = LocalContentColor.current, size: Dp = 18.dp) {
|
||||||
AppIcon(resId, size = size, tint = tint, modifier = Modifier.padding(end = 8.dp))
|
AppIcon(resId, size = size, tint = tint, modifier = Modifier.padding(end = 8.dp))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,9 +42,15 @@ import androidx.compose.ui.res.stringResource
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import cc.skysparkle.matewave.R
|
import cc.skysparkle.matewave.R
|
||||||
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.material3.LocalContentColor
|
||||||
|
import androidx.compose.runtime.CompositionLocalProvider
|
||||||
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Lime
|
||||||
|
import cc.skysparkle.matewave.ui.theme.OnAccent
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Surface2
|
||||||
import cc.skysparkle.matewave.ui.theme.GlassShape
|
import cc.skysparkle.matewave.ui.theme.GlassShape
|
||||||
import cc.skysparkle.matewave.ui.theme.PanelBorder
|
import cc.skysparkle.matewave.ui.theme.PanelBorder
|
||||||
import cc.skysparkle.matewave.ui.theme.PanelFill
|
|
||||||
import cc.skysparkle.matewave.ui.theme.TabletMaxContentWidth
|
import cc.skysparkle.matewave.ui.theme.TabletMaxContentWidth
|
||||||
import cc.skysparkle.matewave.ui.theme.glass
|
import cc.skysparkle.matewave.ui.theme.glass
|
||||||
|
|
||||||
@@ -61,7 +67,7 @@ fun GlassScaffold(
|
|||||||
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.TopCenter) {
|
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.TopCenter) {
|
||||||
Column(modifier = Modifier.fillMaxSize().widthIn(max = TabletMaxContentWidth)) {
|
Column(modifier = Modifier.fillMaxSize().widthIn(max = TabletMaxContentWidth)) {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth().statusBarsPadding().padding(horizontal = 4.dp, vertical = 4.dp),
|
modifier = Modifier.fillMaxWidth().statusBarsPadding().padding(start = 4.dp, end = 4.dp, top = 8.dp, bottom = 8.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
if (onBack != null) {
|
if (onBack != null) {
|
||||||
@@ -69,11 +75,12 @@ fun GlassScaffold(
|
|||||||
AppIcon(
|
AppIcon(
|
||||||
R.drawable.ic_arrow_back,
|
R.drawable.ic_arrow_back,
|
||||||
size = 24.dp,
|
size = 24.dp,
|
||||||
|
tint = ChessGreen,
|
||||||
contentDescription = stringResource(R.string.back)
|
contentDescription = stringResource(R.string.back)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Spacer(Modifier.width(48.dp))
|
Spacer(Modifier.width(16.dp))
|
||||||
}
|
}
|
||||||
if (titleContent != null) {
|
if (titleContent != null) {
|
||||||
Row(modifier = Modifier.weight(1f), verticalAlignment = Alignment.CenterVertically, content = titleContent)
|
Row(modifier = Modifier.weight(1f), verticalAlignment = Alignment.CenterVertically, content = titleContent)
|
||||||
@@ -81,7 +88,9 @@ fun GlassScaffold(
|
|||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
color = ink,
|
color = ink,
|
||||||
style = MaterialTheme.typography.titleLarge,
|
style = MaterialTheme.typography.headlineSmall,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
modifier = Modifier.weight(1f)
|
modifier = Modifier.weight(1f)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -122,6 +131,9 @@ private fun Modifier.pressScale(interactionSource: MutableInteractionSource): Mo
|
|||||||
return this.graphicsLayer { scaleX = scale; scaleY = scale }
|
return this.graphicsLayer { scaleX = scale; scaleY = scale }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val PillShape = RoundedCornerShape(50)
|
||||||
|
|
||||||
|
/** The main action: a lime pill with dark text and icons. */
|
||||||
@Composable
|
@Composable
|
||||||
fun GlassButton(
|
fun GlassButton(
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
@@ -130,12 +142,13 @@ fun GlassButton(
|
|||||||
content: @Composable RowScope.() -> Unit
|
content: @Composable RowScope.() -> Unit
|
||||||
) {
|
) {
|
||||||
val interaction = remember { MutableInteractionSource() }
|
val interaction = remember { MutableInteractionSource() }
|
||||||
|
CompositionLocalProvider(LocalContentColor provides OnAccent) {
|
||||||
Row(
|
Row(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.pressScale(interaction)
|
.pressScale(interaction)
|
||||||
.alpha(if (enabled) 1f else 0.4f)
|
.alpha(if (enabled) 1f else 0.4f)
|
||||||
.clip(GlassShape)
|
.clip(PillShape)
|
||||||
.background(ChessGreen)
|
.background(Lime)
|
||||||
.then(
|
.then(
|
||||||
if (enabled) Modifier.clickable(
|
if (enabled) Modifier.clickable(
|
||||||
interactionSource = interaction,
|
interactionSource = interaction,
|
||||||
@@ -143,12 +156,13 @@ fun GlassButton(
|
|||||||
onClick = onClick
|
onClick = onClick
|
||||||
) else Modifier
|
) else Modifier
|
||||||
)
|
)
|
||||||
.padding(horizontal = 20.dp, vertical = 14.dp),
|
.padding(horizontal = 22.dp, vertical = 15.dp),
|
||||||
horizontalArrangement = Arrangement.Center,
|
horizontalArrangement = Arrangement.Center,
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
content = content
|
content = content
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun GlassOutlinedButton(
|
fun GlassOutlinedButton(
|
||||||
@@ -162,9 +176,9 @@ fun GlassOutlinedButton(
|
|||||||
modifier = modifier
|
modifier = modifier
|
||||||
.pressScale(interaction)
|
.pressScale(interaction)
|
||||||
.alpha(if (enabled) 1f else 0.4f)
|
.alpha(if (enabled) 1f else 0.4f)
|
||||||
.clip(GlassShape)
|
.clip(PillShape)
|
||||||
.background(PanelFill)
|
.background(Surface2)
|
||||||
.border(1.dp, PanelBorder, GlassShape)
|
.border(1.dp, PanelBorder, PillShape)
|
||||||
.then(
|
.then(
|
||||||
if (enabled) Modifier.clickable(
|
if (enabled) Modifier.clickable(
|
||||||
interactionSource = interaction,
|
interactionSource = interaction,
|
||||||
@@ -172,7 +186,7 @@ fun GlassOutlinedButton(
|
|||||||
onClick = onClick
|
onClick = onClick
|
||||||
) else Modifier
|
) else Modifier
|
||||||
)
|
)
|
||||||
.padding(horizontal = 20.dp, vertical = 14.dp),
|
.padding(horizontal = 22.dp, vertical = 15.dp),
|
||||||
horizontalArrangement = Arrangement.Center,
|
horizontalArrangement = Arrangement.Center,
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
content = content
|
content = content
|
||||||
@@ -185,7 +199,7 @@ fun GlassCard(modifier: Modifier = Modifier, content: @Composable ColumnScope.()
|
|||||||
modifier = modifier
|
modifier = modifier
|
||||||
.glass()
|
.glass()
|
||||||
.border(1.dp, PanelBorder, GlassShape)
|
.border(1.dp, PanelBorder, GlassShape)
|
||||||
.padding(14.dp),
|
.padding(16.dp),
|
||||||
content = content
|
content = content
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -193,7 +207,7 @@ fun GlassCard(modifier: Modifier = Modifier, content: @Composable ColumnScope.()
|
|||||||
@Composable
|
@Composable
|
||||||
fun GlassProgress(text: String) {
|
fun GlassProgress(text: String) {
|
||||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
|
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||||
CircularProgressIndicator(color = ink, modifier = Modifier.padding(2.dp))
|
CircularProgressIndicator(color = ChessGreen, modifier = Modifier.padding(2.dp))
|
||||||
Text(text, color = ink, style = MaterialTheme.typography.bodyMedium)
|
Text(text, color = ink, style = MaterialTheme.typography.bodyMedium)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import androidx.compose.ui.draw.clip
|
|||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
|
import cc.skysparkle.matewave.ui.theme.OnAccent
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Surface1
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SetupSectionLabel(text: String, modifier: Modifier = Modifier) {
|
fun SetupSectionLabel(text: String, modifier: Modifier = Modifier) {
|
||||||
@@ -36,7 +38,7 @@ fun SetupSegmented(options: List<String>, selectedIndex: Int, onSelect: (Int) ->
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(50))
|
.clip(RoundedCornerShape(50))
|
||||||
.background(ink.copy(alpha = 0.08f))
|
.background(Surface1)
|
||||||
.padding(4.dp),
|
.padding(4.dp),
|
||||||
horizontalArrangement = Arrangement.spacedBy(4.dp)
|
horizontalArrangement = Arrangement.spacedBy(4.dp)
|
||||||
) {
|
) {
|
||||||
@@ -46,12 +48,16 @@ fun SetupSegmented(options: List<String>, selectedIndex: Int, onSelect: (Int) ->
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.clip(RoundedCornerShape(50))
|
.clip(RoundedCornerShape(50))
|
||||||
.background(if (selected) ChessGreen.copy(alpha = 0.35f) else Color.Transparent)
|
.background(if (selected) ChessGreen else Color.Transparent)
|
||||||
.clickable { onSelect(index) }
|
.clickable { onSelect(index) }
|
||||||
.padding(vertical = 10.dp),
|
.padding(vertical = 10.dp),
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
Text(label, color = ink, style = MaterialTheme.typography.bodyMedium)
|
Text(
|
||||||
|
label,
|
||||||
|
color = if (selected) OnAccent else ink.copy(alpha = 0.8f),
|
||||||
|
style = MaterialTheme.typography.labelLarge
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package cc.skysparkle.matewave.ui.components
|
||||||
|
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.drawWithCache
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.Path
|
||||||
|
import androidx.compose.ui.graphics.StrokeCap
|
||||||
|
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import kotlin.math.PI
|
||||||
|
import kotlin.math.sin
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Matewave signature: thin parallel waves drawn behind the content,
|
||||||
|
* fading towards the bottom of the surface.
|
||||||
|
*/
|
||||||
|
fun Modifier.wavePattern(color: Color, lines: Int = 7): Modifier = drawWithCache {
|
||||||
|
val stroke = Stroke(width = 1.5.dp.toPx(), cap = StrokeCap.Round)
|
||||||
|
val amplitude = 9.dp.toPx()
|
||||||
|
val wavelength = size.width * 0.9f
|
||||||
|
val gap = size.height * 0.55f / lines
|
||||||
|
val step = 4.dp.toPx()
|
||||||
|
val paths = List(lines) { i ->
|
||||||
|
val baseY = gap * (i + 1)
|
||||||
|
val phase = i * 0.55f
|
||||||
|
Path().apply {
|
||||||
|
var x = 0f
|
||||||
|
moveTo(x, baseY + amplitude * sin(phase))
|
||||||
|
while (x <= size.width) {
|
||||||
|
x += step
|
||||||
|
lineTo(x, baseY + amplitude * sin(2f * PI.toFloat() * x / wavelength + phase))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onDrawBehind {
|
||||||
|
paths.forEachIndexed { i, path ->
|
||||||
|
drawPath(path, color = color.copy(alpha = color.alpha * (1f - i.toFloat() / lines)), style = stroke)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package cc.skysparkle.matewave.ui.screens
|
package cc.skysparkle.matewave.ui.screens
|
||||||
|
|
||||||
import cc.skysparkle.matewave.ui.components.ListDivider
|
|
||||||
import cc.skysparkle.matewave.ui.components.ListGroup
|
import cc.skysparkle.matewave.ui.components.ListGroup
|
||||||
import cc.skysparkle.matewave.ui.components.ListRow
|
import cc.skysparkle.matewave.ui.components.ListRow
|
||||||
import cc.skysparkle.matewave.ui.components.SectionCaption
|
import cc.skysparkle.matewave.ui.components.SectionCaption
|
||||||
@@ -45,12 +44,10 @@ import androidx.compose.ui.layout.ContentScale
|
|||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.Dp
|
import androidx.compose.ui.unit.Dp
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
import cc.skysparkle.matewave.R
|
import cc.skysparkle.matewave.R
|
||||||
import cc.skysparkle.matewave.ui.components.DialogText
|
import cc.skysparkle.matewave.ui.components.DialogText
|
||||||
import cc.skysparkle.matewave.ui.components.DialogAction
|
import cc.skysparkle.matewave.ui.components.DialogAction
|
||||||
@@ -60,12 +57,19 @@ import cc.skysparkle.matewave.ui.components.BottomTab
|
|||||||
import cc.skysparkle.matewave.data.ProfileStore
|
import cc.skysparkle.matewave.data.ProfileStore
|
||||||
import cc.skysparkle.matewave.ui.components.AppIcon
|
import cc.skysparkle.matewave.ui.components.AppIcon
|
||||||
import cc.skysparkle.matewave.ui.components.ButtonIcon
|
import cc.skysparkle.matewave.ui.components.ButtonIcon
|
||||||
import cc.skysparkle.matewave.ui.components.GlassOutlinedButton
|
import cc.skysparkle.matewave.ui.components.GlassButton
|
||||||
import cc.skysparkle.matewave.ui.components.GlassScaffold
|
import cc.skysparkle.matewave.ui.components.GlassScaffold
|
||||||
import cc.skysparkle.matewave.ui.components.rememberChatImage
|
import cc.skysparkle.matewave.ui.components.rememberChatImage
|
||||||
|
import cc.skysparkle.matewave.ui.components.wavePattern
|
||||||
import cc.skysparkle.matewave.ui.components.encodeImageForChat
|
import cc.skysparkle.matewave.ui.components.encodeImageForChat
|
||||||
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
import cc.skysparkle.matewave.ui.theme.PanelBorder
|
import cc.skysparkle.matewave.ui.theme.PanelBorder
|
||||||
|
import cc.skysparkle.matewave.ui.theme.GlassShape
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Lime
|
||||||
|
import cc.skysparkle.matewave.ui.theme.OnAccent
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Surface1
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Surface2
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import cc.skysparkle.matewave.ui.theme.whiteOutlinedTextFieldColors
|
import cc.skysparkle.matewave.ui.theme.whiteOutlinedTextFieldColors
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@@ -137,109 +141,64 @@ fun AccountScreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Box(
|
ProfileHero(
|
||||||
modifier = Modifier
|
profile = profile,
|
||||||
.fillMaxWidth()
|
onPickBackground = { backgroundPicker.launch("image/*") },
|
||||||
.height(168.dp)
|
onPickAvatar = { avatarPicker.launch("image/*") },
|
||||||
.clip(RoundedCornerShape(20.dp))
|
onEditName = { editingName = true }
|
||||||
.clickable { backgroundPicker.launch("image/*") }
|
|
||||||
) {
|
|
||||||
val bgBitmap = rememberChatImage(profile.backgroundBase64)
|
|
||||||
if (bgBitmap != null) {
|
|
||||||
Image(
|
|
||||||
bitmap = bgBitmap,
|
|
||||||
contentDescription = null,
|
|
||||||
modifier = Modifier.fillMaxWidth().height(168.dp),
|
|
||||||
contentScale = ContentScale.Crop
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
Image(
|
|
||||||
painter = painterResource(R.drawable.bg_profile_default),
|
|
||||||
contentDescription = null,
|
|
||||||
modifier = Modifier.fillMaxWidth().height(168.dp),
|
|
||||||
contentScale = ContentScale.Crop
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Box(
|
|
||||||
modifier = Modifier.fillMaxWidth().height(168.dp).background(
|
|
||||||
Brush.verticalGradient(
|
|
||||||
0.0f to Color.Black.copy(alpha = 0.30f),
|
|
||||||
0.55f to Color.Black.copy(alpha = 0.45f),
|
|
||||||
1.0f to Color.Black.copy(alpha = 0.72f)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
Box(
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
modifier = Modifier
|
AppIcon(R.drawable.ic_rating, size = 20.dp, tint = Lime)
|
||||||
.align(Alignment.TopEnd)
|
Spacer(Modifier.width(8.dp))
|
||||||
.padding(10.dp)
|
|
||||||
.size(36.dp)
|
|
||||||
.clip(CircleShape)
|
|
||||||
.background(Color.Black.copy(alpha = 0.45f))
|
|
||||||
.clickable { backgroundPicker.launch("image/*") },
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
AppIcon(R.drawable.ic_add_photo, size = 20.dp)
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(
|
|
||||||
modifier = Modifier
|
|
||||||
.align(Alignment.BottomStart)
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(horizontal = 18.dp, vertical = 16.dp)
|
|
||||||
) {
|
|
||||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(16.dp)) {
|
|
||||||
Box {
|
|
||||||
AvatarCircle(
|
|
||||||
base64 = profile.avatarBase64,
|
|
||||||
size = 76.dp,
|
|
||||||
modifier = Modifier.clickable { avatarPicker.launch("image/*") }
|
|
||||||
)
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.align(Alignment.BottomEnd)
|
|
||||||
.size(28.dp)
|
|
||||||
.clip(CircleShape)
|
|
||||||
.background(ChessGreen)
|
|
||||||
.clickable { avatarPicker.launch("image/*") },
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
AppIcon(R.drawable.ic_edit, size = 14.dp)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Column {
|
|
||||||
Row(
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
|
||||||
) {
|
|
||||||
Text(
|
Text(
|
||||||
profile.name,
|
stringResource(R.string.friends_rating, profile.elo),
|
||||||
color = ink,
|
color = ink,
|
||||||
fontSize = 23.sp,
|
style = MaterialTheme.typography.titleMedium,
|
||||||
fontWeight = FontWeight.SemiBold,
|
modifier = Modifier.weight(1f)
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
)
|
||||||
|
|
||||||
AppIcon(
|
|
||||||
R.drawable.ic_edit,
|
|
||||||
size = 18.dp,
|
|
||||||
tint = ink.copy(alpha = 0.75f),
|
|
||||||
modifier = Modifier.clickable { editingName = true }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Text(
|
Text(
|
||||||
stringResource(R.string.account_header_summary, profile.elo, cc.skysparkle.matewave.stats.Stats.gamesPlayed()),
|
stringResource(R.string.stats_dialog_title),
|
||||||
color = ink.copy(alpha = 0.72f),
|
color = ChessGreen,
|
||||||
style = MaterialTheme.typography.bodyMedium
|
style = MaterialTheme.typography.labelLarge,
|
||||||
|
modifier = Modifier
|
||||||
|
.clip(RoundedCornerShape(50))
|
||||||
|
.border(1.dp, ChessGreen.copy(alpha = 0.6f), RoundedCornerShape(50))
|
||||||
|
.clickable { showStats = true }
|
||||||
|
.padding(horizontal = 14.dp, vertical = 6.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!profile.levelChosen) {
|
||||||
|
GlassButton(onClick = { showLevelPicker = true }, modifier = Modifier.fillMaxWidth()) {
|
||||||
|
ButtonIcon(R.drawable.ic_speed)
|
||||||
|
Text(stringResource(R.string.account_choose_level), style = MaterialTheme.typography.titleMedium)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StatTiles()
|
||||||
|
|
||||||
|
// Progress: the reason to open a profile.
|
||||||
|
SectionCaption(stringResource(R.string.account_progress))
|
||||||
|
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||||
|
HighlightCard(
|
||||||
|
iconRes = R.drawable.ic_study,
|
||||||
|
title = stringResource(R.string.study_title),
|
||||||
|
value = "${study.learnedCount}/${study.courses.size} · ★${study.masteredCount}",
|
||||||
|
modifier = Modifier.weight(1f),
|
||||||
|
onClick = onStudyClick
|
||||||
|
)
|
||||||
|
HighlightCard(
|
||||||
|
iconRes = R.drawable.ic_puzzle,
|
||||||
|
title = stringResource(R.string.puzzles_title),
|
||||||
|
value = "${cc.skysparkle.matewave.stats.Stats.solvedPuzzles().size}",
|
||||||
|
modifier = Modifier.weight(1f),
|
||||||
|
onClick = null
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RatingHistoryCard(elo = profile.elo, onClick = { showStats = true })
|
||||||
|
|
||||||
if (profile.avatarBase64 != null || profile.backgroundBase64 != null) {
|
if (profile.avatarBase64 != null || profile.backgroundBase64 != null) {
|
||||||
Text(
|
Text(
|
||||||
stringResource(R.string.account_reset_avatar),
|
stringResource(R.string.account_reset_avatar),
|
||||||
@@ -253,43 +212,6 @@ fun AccountScreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!profile.levelChosen) {
|
|
||||||
GlassOutlinedButton(onClick = { showLevelPicker = true }, modifier = Modifier.fillMaxWidth()) {
|
|
||||||
ButtonIcon(R.drawable.ic_speed)
|
|
||||||
Text(stringResource(R.string.account_choose_level), color = ink)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Progress: the reason to open a profile. The rating is shown here once, with its trend.
|
|
||||||
SectionCaption(stringResource(R.string.account_progress))
|
|
||||||
ListGroup {
|
|
||||||
val curve = remember(profile.elo) { cc.skysparkle.matewave.stats.Stats.ratingCurve(profile.elo) }
|
|
||||||
ListRow(
|
|
||||||
title = stringResource(R.string.account_rating_row),
|
|
||||||
icon = R.drawable.ic_rating,
|
|
||||||
iconTint = ChessGreen,
|
|
||||||
value = "${profile.elo}",
|
|
||||||
valueColor = ink,
|
|
||||||
trailing = { MiniRatingGraph(points = curve, modifier = Modifier.width(64.dp).height(24.dp)) },
|
|
||||||
chevron = true,
|
|
||||||
onClick = { showStats = true }
|
|
||||||
)
|
|
||||||
ListDivider()
|
|
||||||
ListRow(
|
|
||||||
title = stringResource(R.string.study_title),
|
|
||||||
icon = R.drawable.ic_study,
|
|
||||||
value = "${study.learnedCount}/${study.courses.size} · ★${study.masteredCount}",
|
|
||||||
chevron = true,
|
|
||||||
onClick = onStudyClick
|
|
||||||
)
|
|
||||||
ListDivider()
|
|
||||||
ListRow(
|
|
||||||
title = stringResource(R.string.puzzles_title),
|
|
||||||
icon = R.drawable.ic_puzzle,
|
|
||||||
value = stringResource(R.string.puzzle_solved_count, cc.skysparkle.matewave.stats.Stats.solvedPuzzles().size)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Security folded into one row; the details live in a dialog.
|
// Security folded into one row; the details live in a dialog.
|
||||||
if (myFingerprint != null) {
|
if (myFingerprint != null) {
|
||||||
SectionCaption(stringResource(R.string.account_section_security))
|
SectionCaption(stringResource(R.string.account_section_security))
|
||||||
@@ -393,6 +315,176 @@ fun AccountScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Big name over a dimmed cover, with a large avatar in a neon ring, as in the mockup. */
|
||||||
|
@Composable
|
||||||
|
private fun ProfileHero(
|
||||||
|
profile: cc.skysparkle.matewave.data.Profile,
|
||||||
|
onPickBackground: () -> Unit,
|
||||||
|
onPickAvatar: () -> Unit,
|
||||||
|
onEditName: () -> Unit
|
||||||
|
) {
|
||||||
|
val heroHeight = 236.dp
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(heroHeight)
|
||||||
|
.clip(GlassShape)
|
||||||
|
.background(Surface1)
|
||||||
|
) {
|
||||||
|
val bgBitmap = rememberChatImage(profile.backgroundBase64)
|
||||||
|
if (bgBitmap != null) {
|
||||||
|
Image(
|
||||||
|
bitmap = bgBitmap,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.fillMaxWidth().height(heroHeight),
|
||||||
|
contentScale = ContentScale.Crop,
|
||||||
|
alpha = 0.45f
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Image(
|
||||||
|
painter = painterResource(R.drawable.bg_profile_default),
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.fillMaxWidth().height(heroHeight),
|
||||||
|
contentScale = ContentScale.Crop,
|
||||||
|
alpha = 0.45f
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.fillMaxWidth().height(heroHeight).background(
|
||||||
|
Brush.verticalGradient(
|
||||||
|
0.0f to Surface1.copy(alpha = 0.2f),
|
||||||
|
0.6f to Surface1.copy(alpha = 0.6f),
|
||||||
|
1.0f to Surface1.copy(alpha = 0.95f)
|
||||||
|
)
|
||||||
|
).wavePattern(ChessGreen.copy(alpha = 0.12f))
|
||||||
|
)
|
||||||
|
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.TopStart)
|
||||||
|
.padding(12.dp)
|
||||||
|
.size(36.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(Color.Black.copy(alpha = 0.45f))
|
||||||
|
.clickable(onClick = onPickBackground),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
AppIcon(R.drawable.ic_add_photo, size = 20.dp)
|
||||||
|
}
|
||||||
|
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.TopEnd)
|
||||||
|
.padding(top = 16.dp, end = 16.dp)
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.size(148.dp).clip(CircleShape).background(ChessGreen),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
AvatarCircle(
|
||||||
|
base64 = profile.avatarBase64,
|
||||||
|
size = 136.dp,
|
||||||
|
modifier = Modifier.clickable(onClick = onPickAvatar)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.BottomStart)
|
||||||
|
.padding(start = 8.dp, bottom = 8.dp)
|
||||||
|
.size(34.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(Lime)
|
||||||
|
.clickable(onClick = onPickAvatar),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
AppIcon(R.drawable.ic_edit, size = 16.dp, tint = OnAccent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.BottomStart)
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clickable(onClick = onEditName)
|
||||||
|
.padding(start = 18.dp, end = 18.dp, bottom = 16.dp),
|
||||||
|
verticalAlignment = Alignment.Bottom
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
profile.name,
|
||||||
|
color = ink,
|
||||||
|
style = MaterialTheme.typography.headlineLarge,
|
||||||
|
maxLines = 2,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
modifier = Modifier.weight(1f, fill = false)
|
||||||
|
)
|
||||||
|
Spacer(Modifier.width(8.dp))
|
||||||
|
AppIcon(
|
||||||
|
R.drawable.ic_edit,
|
||||||
|
size = 18.dp,
|
||||||
|
tint = ink.copy(alpha = 0.7f),
|
||||||
|
modifier = Modifier.padding(bottom = 8.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun HighlightCard(
|
||||||
|
iconRes: Int,
|
||||||
|
title: String,
|
||||||
|
value: String,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
onClick: (() -> Unit)?
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
modifier = modifier
|
||||||
|
.clip(GlassShape)
|
||||||
|
.background(Surface1)
|
||||||
|
.border(1.dp, PanelBorder, GlassShape)
|
||||||
|
.then(if (onClick != null) Modifier.clickable(onClick = onClick) else Modifier)
|
||||||
|
.padding(14.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.size(40.dp).clip(RoundedCornerShape(14.dp)).background(Surface2),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
AppIcon(iconRes, size = 22.dp, tint = ChessGreen)
|
||||||
|
}
|
||||||
|
Spacer(Modifier.width(10.dp))
|
||||||
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
|
Text(title, color = ink.copy(alpha = 0.6f), style = MaterialTheme.typography.labelSmall, maxLines = 2, overflow = TextOverflow.Ellipsis)
|
||||||
|
Text(value, color = ink, style = MaterialTheme.typography.titleMedium, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun RatingHistoryCard(elo: Int, onClick: () -> Unit) {
|
||||||
|
val curve = remember(elo) { cc.skysparkle.matewave.stats.Stats.ratingCurve(elo) }
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clip(GlassShape)
|
||||||
|
.background(Surface1)
|
||||||
|
.border(1.dp, PanelBorder, GlassShape)
|
||||||
|
.clickable(onClick = onClick)
|
||||||
|
.padding(16.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.account_rating_row),
|
||||||
|
color = ink,
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
)
|
||||||
|
AppIcon(R.drawable.ic_arrow_forward, size = 20.dp, tint = ink.copy(alpha = 0.6f))
|
||||||
|
}
|
||||||
|
MiniRatingGraph(points = curve, modifier = Modifier.fillMaxWidth().height(96.dp), showDots = false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private const val MAX_NAME_LENGTH = 20
|
private const val MAX_NAME_LENGTH = 20
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -463,12 +555,12 @@ private fun LevelPickerDialog(onChoose: (Int) -> Unit, onDismiss: () -> Unit) {
|
|||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
SKILL_LEVELS.forEach { level ->
|
SKILL_LEVELS.forEach { level ->
|
||||||
val rowShape = RoundedCornerShape(12.dp)
|
val rowShape = RoundedCornerShape(16.dp)
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(rowShape)
|
.clip(rowShape)
|
||||||
.background(ink.copy(alpha = 0.07f))
|
.background(Surface2)
|
||||||
.clickable { onChoose(level.elo) }
|
.clickable { onChoose(level.elo) }
|
||||||
.padding(horizontal = 16.dp, vertical = 14.dp),
|
.padding(horizontal = 16.dp, vertical = 14.dp),
|
||||||
horizontalArrangement = Arrangement.SpaceBetween
|
horizontalArrangement = Arrangement.SpaceBetween
|
||||||
@@ -487,7 +579,7 @@ fun AvatarCircle(base64: String?, size: Dp, modifier: Modifier = Modifier) {
|
|||||||
modifier = modifier
|
modifier = modifier
|
||||||
.size(size)
|
.size(size)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.background(ChessGreen.copy(alpha = 0.6f))
|
.background(Surface2)
|
||||||
.border(2.dp, PanelBorder, CircleShape),
|
.border(2.dp, PanelBorder, CircleShape),
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
@@ -502,7 +594,7 @@ fun AvatarCircle(base64: String?, size: Dp, modifier: Modifier = Modifier) {
|
|||||||
Image(
|
Image(
|
||||||
painter = painterResource(R.drawable.ic_default_avatar),
|
painter = painterResource(R.drawable.ic_default_avatar),
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
colorFilter = ColorFilter.tint(ink),
|
colorFilter = ColorFilter.tint(ink.copy(alpha = 0.8f)),
|
||||||
modifier = Modifier.size(size * 0.8f)
|
modifier = Modifier.size(size * 0.8f)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,8 +182,8 @@ private fun AppearanceToggle(
|
|||||||
checked = checked,
|
checked = checked,
|
||||||
onCheckedChange = onCheckedChange,
|
onCheckedChange = onCheckedChange,
|
||||||
colors = SwitchDefaults.colors(
|
colors = SwitchDefaults.colors(
|
||||||
checkedThumbColor = Color.White,
|
checkedThumbColor = cc.skysparkle.matewave.ui.theme.OnAccent,
|
||||||
checkedTrackColor = Color(0xFF4F8A5B)
|
checkedTrackColor = cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ import cc.skysparkle.matewave.ui.components.GlassButton
|
|||||||
import cc.skysparkle.matewave.ui.components.GlassScaffold
|
import cc.skysparkle.matewave.ui.components.GlassScaffold
|
||||||
import cc.skysparkle.matewave.ui.components.rememberPermissionRequester
|
import cc.skysparkle.matewave.ui.components.rememberPermissionRequester
|
||||||
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Lime
|
||||||
|
import cc.skysparkle.matewave.ui.theme.OnAccent
|
||||||
|
|
||||||
private enum class Hint { BLUETOOTH_PERMISSION, BLUETOOTH_OFF, WIFI_OFF }
|
private enum class Hint { BLUETOOTH_PERMISSION, BLUETOOTH_OFF, WIFI_OFF }
|
||||||
|
|
||||||
@@ -173,7 +175,7 @@ fun ConnectionScreen(
|
|||||||
modifier = Modifier.weight(1f)
|
modifier = Modifier.weight(1f)
|
||||||
) {
|
) {
|
||||||
ButtonIcon(R.drawable.ic_add, size = 20.dp)
|
ButtonIcon(R.drawable.ic_add, size = 20.dp)
|
||||||
Text(stringResource(R.string.nearby_create), color = ink, style = MaterialTheme.typography.titleMedium, maxLines = 1)
|
Text(stringResource(R.string.nearby_create), style = MaterialTheme.typography.titleMedium, maxLines = 1)
|
||||||
}
|
}
|
||||||
GlassOutlinedButton(onClick = { pickTime = true }) {
|
GlassOutlinedButton(onClick = { pickTime = true }) {
|
||||||
Text(timeControl.shortLabel(), color = ink, maxLines = 1)
|
Text(timeControl.shortLabel(), color = ink, maxLines = 1)
|
||||||
@@ -256,11 +258,11 @@ fun ConnectionScreen(
|
|||||||
Spacer(Modifier.width(8.dp))
|
Spacer(Modifier.width(8.dp))
|
||||||
Text(
|
Text(
|
||||||
stringResource(R.string.players_play),
|
stringResource(R.string.players_play),
|
||||||
color = Color.White,
|
color = OnAccent,
|
||||||
style = MaterialTheme.typography.labelLarge,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(50))
|
.clip(RoundedCornerShape(50))
|
||||||
.background(ChessGreen)
|
.background(Lime)
|
||||||
.clickable { onJoin(entry.type, timeControl, entry.address) }
|
.clickable { onJoin(entry.type, timeControl, entry.address) }
|
||||||
.padding(horizontal = 14.dp, vertical = 6.dp)
|
.padding(horizontal = 14.dp, vertical = 6.dp)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ import cc.skysparkle.matewave.ui.components.ButtonIcon
|
|||||||
import cc.skysparkle.matewave.ui.components.BottomTab
|
import cc.skysparkle.matewave.ui.components.BottomTab
|
||||||
import cc.skysparkle.matewave.ui.components.GlassScaffold
|
import cc.skysparkle.matewave.ui.components.GlassScaffold
|
||||||
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Lime
|
||||||
|
import cc.skysparkle.matewave.ui.theme.OnAccent
|
||||||
import cc.skysparkle.matewave.spectate.FriendGameStatus
|
import cc.skysparkle.matewave.spectate.FriendGameStatus
|
||||||
import cc.skysparkle.matewave.spectate.FriendStatusResolver
|
import cc.skysparkle.matewave.spectate.FriendStatusResolver
|
||||||
import cc.skysparkle.matewave.spectate.NearbyPlayerGame
|
import cc.skysparkle.matewave.spectate.NearbyPlayerGame
|
||||||
@@ -130,7 +132,7 @@ fun FriendsScreen(
|
|||||||
Text(stringResource(R.string.friends_nobody_hint), color = ink.copy(alpha = 0.65f), style = MaterialTheme.typography.bodyMedium)
|
Text(stringResource(R.string.friends_nobody_hint), color = ink.copy(alpha = 0.65f), style = MaterialTheme.typography.bodyMedium)
|
||||||
GlassButton(onClick = onPlay, modifier = Modifier.fillMaxWidth()) {
|
GlassButton(onClick = onPlay, modifier = Modifier.fillMaxWidth()) {
|
||||||
ButtonIcon(R.drawable.ic_play)
|
ButtonIcon(R.drawable.ic_play)
|
||||||
Text(stringResource(R.string.friends_play_nearby), color = ink)
|
Text(stringResource(R.string.friends_play_nearby), style = MaterialTheme.typography.titleMedium)
|
||||||
}
|
}
|
||||||
return@GlassScaffold
|
return@GlassScaffold
|
||||||
}
|
}
|
||||||
@@ -234,11 +236,11 @@ private fun displayName(name: String, id: String): String {
|
|||||||
private fun PlayChip(onClick: () -> Unit) {
|
private fun PlayChip(onClick: () -> Unit) {
|
||||||
Text(
|
Text(
|
||||||
stringResource(R.string.friends_play),
|
stringResource(R.string.friends_play),
|
||||||
color = Color.White,
|
color = OnAccent,
|
||||||
style = MaterialTheme.typography.labelLarge,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(50))
|
.clip(RoundedCornerShape(50))
|
||||||
.background(ChessGreen)
|
.background(Lime)
|
||||||
.clickable(onClick = onClick)
|
.clickable(onClick = onClick)
|
||||||
.padding(horizontal = 14.dp, vertical = 6.dp)
|
.padding(horizontal = 14.dp, vertical = 6.dp)
|
||||||
)
|
)
|
||||||
@@ -384,12 +386,12 @@ private fun WatchChip(status: FriendGameStatus, onClick: () -> Unit) {
|
|||||||
}
|
}
|
||||||
Text(
|
Text(
|
||||||
label,
|
label,
|
||||||
color = if (enabled) Color.White else ink.copy(alpha = 0.5f),
|
color = if (enabled) OnAccent else ink.copy(alpha = 0.5f),
|
||||||
style = MaterialTheme.typography.labelLarge,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(50))
|
.clip(RoundedCornerShape(50))
|
||||||
.background(if (enabled) ChessGreen else ink.copy(alpha = 0.12f))
|
.background(if (enabled) Lime else ink.copy(alpha = 0.12f))
|
||||||
.then(if (enabled) Modifier.clickable(onClick = onClick) else Modifier)
|
.then(if (enabled) Modifier.clickable(onClick = onClick) else Modifier)
|
||||||
.padding(horizontal = 14.dp, vertical = 6.dp)
|
.padding(horizontal = 14.dp, vertical = 6.dp)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.padding
|
|||||||
import cc.skysparkle.matewave.ui.theme.ink
|
import cc.skysparkle.matewave.ui.theme.ink
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@@ -49,6 +50,7 @@ import cc.skysparkle.matewave.ui.components.GlassOutlinedButton
|
|||||||
import cc.skysparkle.matewave.ui.components.GlassScaffold
|
import cc.skysparkle.matewave.ui.components.GlassScaffold
|
||||||
import cc.skysparkle.matewave.ui.components.PromotionDialog
|
import cc.skysparkle.matewave.ui.components.PromotionDialog
|
||||||
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
|
import cc.skysparkle.matewave.ui.theme.OnAccent
|
||||||
import cc.skysparkle.matewave.viewmodel.GameMode
|
import cc.skysparkle.matewave.viewmodel.GameMode
|
||||||
import cc.skysparkle.matewave.viewmodel.GameUiState
|
import cc.skysparkle.matewave.viewmodel.GameUiState
|
||||||
import cc.skysparkle.matewave.viewmodel.GameViewModel
|
import cc.skysparkle.matewave.viewmodel.GameViewModel
|
||||||
@@ -300,7 +302,7 @@ private fun ChatButton(unreadCount: Int, onClick: () -> Unit) {
|
|||||||
.background(ChessGreen),
|
.background(ChessGreen),
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
Text(unreadCount.toString(), color = Color.White, fontSize = 11.sp)
|
Text(unreadCount.toString(), color = OnAccent, fontSize = 11.sp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -460,15 +462,26 @@ private fun PlayerRow(
|
|||||||
state.opponentProfile?.avatarBase64
|
state.opponentProfile?.avatarBase64
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
|
// A card per player; the side to move gets a neon outline and ring.
|
||||||
|
val cardShape = RoundedCornerShape(18.dp)
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clip(cardShape)
|
||||||
|
.background(cc.skysparkle.matewave.ui.theme.Surface1)
|
||||||
|
.border(1.dp, if (active) ChessGreen.copy(alpha = 0.7f) else cc.skysparkle.matewave.ui.theme.PanelBorder, cardShape)
|
||||||
|
.padding(horizontal = 10.dp, vertical = 8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(8.dp)
|
.size(40.dp)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.background(if (active) ChessGreen else ink.copy(alpha = 0.15f))
|
.background(if (active) ChessGreen else Color.Transparent),
|
||||||
)
|
contentAlignment = Alignment.Center
|
||||||
Spacer(Modifier.width(10.dp))
|
) {
|
||||||
AvatarCircle(base64 = avatar, size = 34.dp)
|
AvatarCircle(base64 = avatar, size = 36.dp)
|
||||||
|
}
|
||||||
Spacer(Modifier.width(10.dp))
|
Spacer(Modifier.width(10.dp))
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) {
|
||||||
@@ -513,21 +526,27 @@ internal fun BigClock(millis: Long, active: Boolean) {
|
|||||||
active -> ink
|
active -> ink
|
||||||
else -> ink.copy(alpha = 0.45f)
|
else -> ink.copy(alpha = 0.45f)
|
||||||
}
|
}
|
||||||
|
// The running clock is a lime pill, like the main action; a low clock turns red.
|
||||||
|
val fill = when {
|
||||||
|
low -> Color(0xFFFF6B6B)
|
||||||
|
active -> cc.skysparkle.matewave.ui.theme.Lime
|
||||||
|
else -> ink.copy(alpha = 0.06f)
|
||||||
|
}
|
||||||
|
val textColor = if (active) cc.skysparkle.matewave.ui.theme.OnAccent else color
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(10.dp))
|
.clip(RoundedCornerShape(50))
|
||||||
.background(if (active) ink.copy(alpha = 0.12f) else Color.Transparent)
|
.background(fill)
|
||||||
.padding(horizontal = 12.dp, vertical = 6.dp),
|
.padding(horizontal = 14.dp, vertical = 6.dp),
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
if (totalSeconds >= NO_LIMIT_THRESHOLD_SECONDS) {
|
if (totalSeconds >= NO_LIMIT_THRESHOLD_SECONDS) {
|
||||||
AppIcon(R.drawable.ic_infinity, size = 28.dp, tint = color)
|
AppIcon(R.drawable.ic_infinity, size = 26.dp, tint = textColor)
|
||||||
} else {
|
} else {
|
||||||
Text(
|
Text(
|
||||||
"%d:%02d".format(totalSeconds / 60, totalSeconds % 60),
|
"%d:%02d".format(totalSeconds / 60, totalSeconds % 60),
|
||||||
color = color,
|
color = textColor,
|
||||||
style = MaterialTheme.typography.headlineSmall,
|
style = MaterialTheme.typography.titleLarge.copy(fontFeatureSettings = "tnum")
|
||||||
fontWeight = androidx.compose.ui.text.font.FontWeight.SemiBold
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ private data class LicenseEntry(
|
|||||||
)
|
)
|
||||||
|
|
||||||
private const val APACHE = "Apache License 2.0"
|
private const val APACHE = "Apache License 2.0"
|
||||||
|
private const val OFL = "SIL Open Font License 1.1"
|
||||||
private const val AOSP = "The Android Open Source Project"
|
private const val AOSP = "The Android Open Source Project"
|
||||||
|
|
||||||
private val LIBRARIES = listOf(
|
private val LIBRARIES = listOf(
|
||||||
@@ -109,6 +110,14 @@ private val ASSETS = listOf(
|
|||||||
LicenseEntry(
|
LicenseEntry(
|
||||||
"Vector Chess Pieces", "RhosGFX", null, "CC0 1.0",
|
"Vector Chess Pieces", "RhosGFX", null, "CC0 1.0",
|
||||||
"https://rhosgfx.itch.io/vector-chess-pieces", R.string.licenses_note_pieces
|
"https://rhosgfx.itch.io/vector-chess-pieces", R.string.licenses_note_pieces
|
||||||
|
),
|
||||||
|
LicenseEntry(
|
||||||
|
"Unbounded", "The Unbounded Project Authors", null, OFL,
|
||||||
|
"https://github.com/googlefonts/unbounded", R.string.licenses_note_fonts
|
||||||
|
),
|
||||||
|
LicenseEntry(
|
||||||
|
"Manrope", "The Manrope Project Authors", null, OFL,
|
||||||
|
"https://github.com/googlefonts/manrope", R.string.licenses_note_fonts
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -123,6 +132,7 @@ private val RADIO = listOf(
|
|||||||
fun LicensesScreen(onBack: () -> Unit) {
|
fun LicensesScreen(onBack: () -> Unit) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
var showApache by remember { mutableStateOf(false) }
|
var showApache by remember { mutableStateOf(false) }
|
||||||
|
var showOfl by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
GlassScaffold(title = stringResource(R.string.licenses_title), onBack = onBack) {
|
GlassScaffold(title = stringResource(R.string.licenses_title), onBack = onBack) {
|
||||||
Text(
|
Text(
|
||||||
@@ -143,6 +153,10 @@ fun LicensesScreen(onBack: () -> Unit) {
|
|||||||
|
|
||||||
SetupSectionLabel(stringResource(R.string.licenses_group_assets))
|
SetupSectionLabel(stringResource(R.string.licenses_group_assets))
|
||||||
ASSETS.forEach { entry -> LicenseCard(entry) { openUrl(context, entry.url) } }
|
ASSETS.forEach { entry -> LicenseCard(entry) { openUrl(context, entry.url) } }
|
||||||
|
GlassOutlinedButton(onClick = { showOfl = true }, modifier = Modifier.fillMaxWidth()) {
|
||||||
|
ButtonIcon(R.drawable.ic_copyright)
|
||||||
|
Text(stringResource(R.string.licenses_ofl_full), color = ink)
|
||||||
|
}
|
||||||
|
|
||||||
SetupSectionLabel(stringResource(R.string.licenses_group_radio))
|
SetupSectionLabel(stringResource(R.string.licenses_group_radio))
|
||||||
Text(
|
Text(
|
||||||
@@ -154,7 +168,10 @@ fun LicensesScreen(onBack: () -> Unit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (showApache) {
|
if (showApache) {
|
||||||
ApacheLicenseDialog(onDismiss = { showApache = false })
|
LicenseTextDialog(APACHE, R.raw.license_apache_2_0, "https://www.apache.org/licenses/LICENSE-2.0") { showApache = false }
|
||||||
|
}
|
||||||
|
if (showOfl) {
|
||||||
|
LicenseTextDialog(OFL, R.raw.license_ofl_1_1, "https://openfontlicense.org") { showOfl = false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,20 +202,20 @@ private fun LicenseCard(entry: LicenseEntry, onClick: () -> Unit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ApacheLicenseDialog(onDismiss: () -> Unit) {
|
private fun LicenseTextDialog(title: String, rawRes: Int, fallbackUrl: String, onDismiss: () -> Unit) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val text = remember {
|
val text = remember(rawRes) {
|
||||||
runCatching {
|
runCatching {
|
||||||
context.resources.openRawResource(R.raw.license_apache_2_0)
|
context.resources.openRawResource(rawRes)
|
||||||
.bufferedReader().use { it.readText() }
|
.bufferedReader().use { it.readText() }
|
||||||
}.getOrDefault("https://www.apache.org/licenses/LICENSE-2.0")
|
}.getOrDefault(fallbackUrl)
|
||||||
.trim()
|
.trim()
|
||||||
.split(Regex("\n\\s*\n"))
|
.split(Regex("\n\\s*\n"))
|
||||||
.joinToString("\n\n") { paragraph -> paragraph.lines().joinToString(" ") { it.trim() } }
|
.joinToString("\n\n") { paragraph -> paragraph.lines().joinToString(" ") { it.trim() } }
|
||||||
}
|
}
|
||||||
AppDialog(
|
AppDialog(
|
||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
title = APACHE,
|
title = title,
|
||||||
actions = { DialogAction(stringResource(R.string.chat_close), onDismiss) }
|
actions = { DialogAction(stringResource(R.string.chat_close), onDismiss) }
|
||||||
) {
|
) {
|
||||||
Column(modifier = Modifier.fillMaxWidth().heightIn(max = 380.dp).verticalScroll(rememberScrollState())) {
|
Column(modifier = Modifier.fillMaxWidth().heightIn(max = 380.dp).verticalScroll(rememberScrollState())) {
|
||||||
|
|||||||
@@ -1,17 +1,6 @@
|
|||||||
package cc.skysparkle.matewave.ui.screens
|
package cc.skysparkle.matewave.ui.screens
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.statusBarsPadding
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
|
||||||
import androidx.compose.ui.draw.clip
|
|
||||||
import androidx.compose.ui.platform.LocalContext
|
|
||||||
import cc.skysparkle.matewave.ui.components.ListDivider
|
|
||||||
import cc.skysparkle.matewave.ui.components.ListGroup
|
|
||||||
import cc.skysparkle.matewave.ui.components.ListRow
|
|
||||||
import cc.skysparkle.matewave.ui.components.SectionCaption
|
|
||||||
|
|
||||||
import cc.skysparkle.matewave.ui.theme.ink
|
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
@@ -20,20 +9,24 @@ import androidx.compose.foundation.layout.Box
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
|
import androidx.compose.foundation.layout.fillMaxHeight
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.navigationBarsPadding
|
import androidx.compose.foundation.layout.navigationBarsPadding
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.layout.statusBarsPadding
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.layout.widthIn
|
import androidx.compose.foundation.layout.widthIn
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.collectAsState
|
import androidx.compose.runtime.collectAsState
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
@@ -41,33 +34,44 @@ import androidx.compose.runtime.remember
|
|||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.draw.drawWithCache
|
import androidx.compose.ui.draw.drawWithCache
|
||||||
|
import androidx.compose.ui.draw.rotate
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import androidx.compose.ui.graphics.Brush
|
import androidx.compose.ui.graphics.Brush
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.ColorFilter
|
|
||||||
import androidx.compose.ui.graphics.Path
|
import androidx.compose.ui.graphics.Path
|
||||||
import androidx.compose.ui.graphics.StrokeCap
|
import androidx.compose.ui.graphics.StrokeCap
|
||||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.compose.foundation.Image
|
|
||||||
import cc.skysparkle.matewave.R
|
import cc.skysparkle.matewave.R
|
||||||
import cc.skysparkle.matewave.ui.components.DialogText
|
|
||||||
import cc.skysparkle.matewave.ui.components.DialogAction
|
|
||||||
import cc.skysparkle.matewave.ui.components.AppDialog
|
|
||||||
import cc.skysparkle.matewave.stats.Stats
|
import cc.skysparkle.matewave.stats.Stats
|
||||||
import cc.skysparkle.matewave.ui.components.AppBottomBar
|
import cc.skysparkle.matewave.ui.components.AppBottomBar
|
||||||
|
import cc.skysparkle.matewave.ui.components.AppDialog
|
||||||
|
import cc.skysparkle.matewave.ui.components.AppIcon
|
||||||
import cc.skysparkle.matewave.ui.components.BottomTab
|
import cc.skysparkle.matewave.ui.components.BottomTab
|
||||||
|
import cc.skysparkle.matewave.ui.components.DialogAction
|
||||||
|
import cc.skysparkle.matewave.ui.components.DialogText
|
||||||
|
import cc.skysparkle.matewave.ui.components.SectionCaption
|
||||||
|
import cc.skysparkle.matewave.ui.components.displayName
|
||||||
|
import cc.skysparkle.matewave.ui.components.wavePattern
|
||||||
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
import cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
import cc.skysparkle.matewave.ui.theme.TabletMaxContentWidth
|
|
||||||
import cc.skysparkle.matewave.ui.theme.GlassShape
|
import cc.skysparkle.matewave.ui.theme.GlassShape
|
||||||
import cc.skysparkle.matewave.ui.theme.glass
|
import cc.skysparkle.matewave.ui.theme.HeroTextStyle
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Lime
|
||||||
|
import cc.skysparkle.matewave.ui.theme.OnAccent
|
||||||
|
import cc.skysparkle.matewave.ui.theme.PanelBorder
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Surface1
|
||||||
|
import cc.skysparkle.matewave.ui.theme.Surface2
|
||||||
|
import cc.skysparkle.matewave.ui.theme.TabletMaxContentWidth
|
||||||
|
import cc.skysparkle.matewave.ui.theme.ink
|
||||||
import cc.skysparkle.matewave.viewmodel.GameViewModel
|
import cc.skysparkle.matewave.viewmodel.GameViewModel
|
||||||
import cc.skysparkle.matewave.viewmodel.ResumeInfo
|
import cc.skysparkle.matewave.viewmodel.ResumeInfo
|
||||||
import cc.skysparkle.matewave.ui.components.displayName
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun MainMenuScreen(
|
fun MainMenuScreen(
|
||||||
@@ -86,13 +90,13 @@ fun MainMenuScreen(
|
|||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val resumable by viewModel.resumable.collectAsState()
|
val resumable by viewModel.resumable.collectAsState()
|
||||||
val ongoing = resumable
|
val ongoing = resumable
|
||||||
val hasOngoingGame = ongoing != null
|
|
||||||
val profile = remember { cc.skysparkle.matewave.data.ProfileStore.get() }
|
val profile = remember { cc.skysparkle.matewave.data.ProfileStore.get() }
|
||||||
val lastSetup = remember { cc.skysparkle.matewave.settings.LastGameSetup(context) }
|
val lastSetup = remember { cc.skysparkle.matewave.settings.LastGameSetup(context) }
|
||||||
LaunchedEffect(Unit) { studyViewModel.init(context) }
|
LaunchedEffect(Unit) { studyViewModel.init(context) }
|
||||||
val study by studyViewModel.overview.collectAsState()
|
val study by studyViewModel.overview.collectAsState()
|
||||||
|
|
||||||
var showRatingGate by remember { mutableStateOf(false) }
|
var showRatingGate by remember { mutableStateOf(false) }
|
||||||
|
var showStats by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.TopCenter) {
|
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.TopCenter) {
|
||||||
Column(modifier = Modifier.fillMaxSize().widthIn(max = TabletMaxContentWidth)) {
|
Column(modifier = Modifier.fillMaxSize().widthIn(max = TabletMaxContentWidth)) {
|
||||||
@@ -100,26 +104,40 @@ fun MainMenuScreen(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.statusBarsPadding()
|
.statusBarsPadding()
|
||||||
.padding(top = 16.dp, start = 20.dp, end = 20.dp, bottom = 10.dp),
|
.padding(top = 12.dp, start = 20.dp, end = 20.dp, bottom = 4.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.size(44.dp).clip(CircleShape).background(ChessGreen),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
Image(
|
Image(
|
||||||
painter = painterResource(R.drawable.logo_knight),
|
painter = painterResource(R.drawable.logo_knight),
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = Modifier.size(width = 30.dp, height = 44.dp)
|
modifier = Modifier.size(width = 20.dp, height = 29.dp)
|
||||||
)
|
)
|
||||||
Spacer(Modifier.width(12.dp))
|
}
|
||||||
Greeting(modifier = Modifier.weight(1f))
|
Spacer(Modifier.width(10.dp))
|
||||||
// The rating is always in sight.
|
|
||||||
Text(
|
Text(
|
||||||
"${profile.elo}",
|
"matewave",
|
||||||
color = ink,
|
color = ink,
|
||||||
style = MaterialTheme.typography.titleMedium,
|
style = MaterialTheme.typography.headlineSmall.copy(fontSize = 17.sp, letterSpacing = (-0.3).sp),
|
||||||
|
maxLines = 1
|
||||||
|
)
|
||||||
|
Spacer(Modifier.weight(1f))
|
||||||
|
// The rating is always in sight.
|
||||||
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(50))
|
.clip(RoundedCornerShape(50))
|
||||||
.background(ink.copy(alpha = 0.10f))
|
.background(Surface2)
|
||||||
.padding(horizontal = 12.dp, vertical = 6.dp)
|
.clickable { showStats = true }
|
||||||
)
|
.padding(start = 10.dp, end = 14.dp, top = 8.dp, bottom = 8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
AppIcon(R.drawable.ic_rating, size = 18.dp, tint = Lime)
|
||||||
|
Spacer(Modifier.width(6.dp))
|
||||||
|
Text("${profile.elo}", color = ink, style = MaterialTheme.typography.titleSmall)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
@@ -130,70 +148,71 @@ fun MainMenuScreen(
|
|||||||
.verticalScroll(rememberScrollState()),
|
.verticalScroll(rememberScrollState()),
|
||||||
verticalArrangement = Arrangement.spacedBy(14.dp)
|
verticalArrangement = Arrangement.spacedBy(14.dp)
|
||||||
) {
|
) {
|
||||||
// The most urgent thing first: an unfinished game.
|
Hero()
|
||||||
if (ongoing != null) ContinueCard(ongoing, onContinueGame)
|
|
||||||
|
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(12.dp), modifier = Modifier.fillMaxWidth()) {
|
Row(
|
||||||
ModeTile(
|
modifier = Modifier.fillMaxWidth().height(268.dp),
|
||||||
iconRes = R.drawable.ic_ai_app,
|
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
title = stringResource(R.string.mode_ai_title),
|
) {
|
||||||
|
AiCard(
|
||||||
subtitle = stringResource(R.string.mode_ai_subtitle),
|
subtitle = stringResource(R.string.mode_ai_subtitle),
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f).fillMaxHeight(),
|
||||||
onClick = { if (profile.levelChosen) onVsAiClick() else showRatingGate = true }
|
onClick = { if (profile.levelChosen) onVsAiClick() else showRatingGate = true }
|
||||||
)
|
)
|
||||||
ModeTile(
|
Column(
|
||||||
|
modifier = Modifier.weight(1f).fillMaxHeight(),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
SmallModeCard(
|
||||||
iconRes = R.drawable.ic_versus,
|
iconRes = R.drawable.ic_versus,
|
||||||
title = stringResource(R.string.mode_online_title),
|
title = stringResource(R.string.mode_online_title),
|
||||||
subtitle = stringResource(R.string.mode_online_subtitle),
|
subtitle = stringResource(R.string.mode_online_subtitle),
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f).fillMaxWidth(),
|
||||||
onClick = { if (profile.levelChosen) onVsPlayerClick() else showRatingGate = true }
|
onClick = { if (profile.levelChosen) onVsPlayerClick() else showRatingGate = true }
|
||||||
)
|
)
|
||||||
|
// The most urgent thing takes this slot: an unfinished game, otherwise a quick rematch.
|
||||||
|
if (ongoing != null) {
|
||||||
|
ContinueCard(ongoing, Modifier.weight(1f).fillMaxWidth(), onContinueGame)
|
||||||
|
} else {
|
||||||
|
SmallModeCard(
|
||||||
|
iconRes = R.drawable.ic_quick_game,
|
||||||
|
title = stringResource(R.string.quick_game_title),
|
||||||
|
subtitle = stringResource(difficultyName(lastSetup.aiDifficulty)) +
|
||||||
|
" · " + lastSetup.aiTime.displayName(),
|
||||||
|
modifier = Modifier.weight(1f).fillMaxWidth(),
|
||||||
|
onClick = { if (profile.levelChosen) onQuickGame() else showRatingGate = true }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SectionCaption(stringResource(R.string.home_today))
|
SectionCaption(stringResource(R.string.home_today))
|
||||||
ListGroup {
|
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||||
if (!hasOngoingGame) {
|
val due = study.dueCards > 0
|
||||||
ListRow(
|
LearnCard(
|
||||||
title = stringResource(R.string.quick_game_title),
|
iconRes = if (due) R.drawable.ic_review else R.drawable.ic_study,
|
||||||
subtitle = stringResource(
|
title = stringResource(if (due) R.string.study_review_title else R.string.study_title),
|
||||||
R.string.quick_game_subtitle,
|
subtitle = if (due) {
|
||||||
stringResource(difficultyName(lastSetup.aiDifficulty)),
|
stringResource(R.string.study_review_summary, study.dueCards, study.dueCourses)
|
||||||
lastSetup.aiTime.displayName()
|
|
||||||
),
|
|
||||||
icon = R.drawable.ic_quick_game,
|
|
||||||
iconTint = ChessGreen,
|
|
||||||
chevron = true,
|
|
||||||
onClick = { if (profile.levelChosen) onQuickGame() else showRatingGate = true }
|
|
||||||
)
|
|
||||||
ListDivider()
|
|
||||||
}
|
|
||||||
if (study.dueCards > 0) {
|
|
||||||
ListRow(
|
|
||||||
title = stringResource(R.string.study_review_title),
|
|
||||||
subtitle = stringResource(R.string.study_review_summary, study.dueCards, study.dueCourses),
|
|
||||||
icon = R.drawable.ic_review,
|
|
||||||
iconTint = cc.skysparkle.matewave.ui.screens.StarGold,
|
|
||||||
chevron = true,
|
|
||||||
onClick = onStudyClick
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
ListRow(
|
stringResource(R.string.study_menu_subtitle)
|
||||||
title = stringResource(R.string.study_title),
|
},
|
||||||
subtitle = stringResource(R.string.study_menu_subtitle),
|
highlighted = due,
|
||||||
icon = R.drawable.ic_study,
|
modifier = Modifier.weight(1f),
|
||||||
chevron = true,
|
|
||||||
onClick = onStudyClick
|
onClick = onStudyClick
|
||||||
)
|
)
|
||||||
}
|
LearnCard(
|
||||||
ListDivider()
|
iconRes = R.drawable.ic_puzzle,
|
||||||
ListRow(
|
|
||||||
title = stringResource(R.string.puzzles_title),
|
title = stringResource(R.string.puzzles_title),
|
||||||
subtitle = stringResource(R.string.puzzles_subtitle),
|
subtitle = stringResource(R.string.puzzle_solved_count, Stats.solvedPuzzles().size),
|
||||||
icon = R.drawable.ic_puzzle,
|
highlighted = false,
|
||||||
chevron = true,
|
modifier = Modifier.weight(1f),
|
||||||
onClick = onPuzzlesClick
|
onClick = onPuzzlesClick
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProgressPanel(elo = profile.elo, onClick = { showStats = true })
|
||||||
|
Spacer(Modifier.height(4.dp))
|
||||||
}
|
}
|
||||||
|
|
||||||
Box(modifier = Modifier.navigationBarsPadding()) {
|
Box(modifier = Modifier.navigationBarsPadding()) {
|
||||||
@@ -215,10 +234,11 @@ fun MainMenuScreen(
|
|||||||
onDismiss = { showRatingGate = false }
|
onDismiss = { showRatingGate = false }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (showStats) StatsDialog(onDismiss = { showStats = false })
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun Greeting(modifier: Modifier = Modifier) {
|
private fun Hero() {
|
||||||
val hour = remember { java.util.Calendar.getInstance().get(java.util.Calendar.HOUR_OF_DAY) }
|
val hour = remember { java.util.Calendar.getInstance().get(java.util.Calendar.HOUR_OF_DAY) }
|
||||||
val greeting = when (hour) {
|
val greeting = when (hour) {
|
||||||
in 5..11 -> stringResource(R.string.greeting_morning)
|
in 5..11 -> stringResource(R.string.greeting_morning)
|
||||||
@@ -226,65 +246,236 @@ private fun Greeting(modifier: Modifier = Modifier) {
|
|||||||
in 18..22 -> stringResource(R.string.greeting_evening)
|
in 18..22 -> stringResource(R.string.greeting_evening)
|
||||||
else -> stringResource(R.string.greeting_night)
|
else -> stringResource(R.string.greeting_night)
|
||||||
}
|
}
|
||||||
Column(modifier = modifier) {
|
Box(modifier = Modifier.fillMaxWidth().padding(top = 8.dp)) {
|
||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Column(modifier = Modifier.padding(end = 76.dp)) {
|
||||||
Text(greeting, color = ink, style = MaterialTheme.typography.headlineSmall)
|
Text("$greeting 👋", color = ink.copy(alpha = 0.6f), style = MaterialTheme.typography.bodyLarge)
|
||||||
Spacer(Modifier.width(6.dp))
|
Spacer(Modifier.height(2.dp))
|
||||||
Text("👋", fontSize = 20.sp)
|
Text(
|
||||||
|
stringResource(R.string.home_hero),
|
||||||
|
color = ink,
|
||||||
|
style = HeroTextStyle,
|
||||||
|
maxLines = 2,
|
||||||
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
}
|
}
|
||||||
Text(stringResource(R.string.greeting_ready), color = ink.copy(alpha = 0.7f), style = MaterialTheme.typography.bodyMedium)
|
Image(
|
||||||
|
painter = painterResource(R.drawable.piece_white_knight),
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.CenterEnd)
|
||||||
|
.size(88.dp)
|
||||||
|
.rotate(-14f)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The main mode: a tall neon card with a big piece, like the hero tile of the mockup. */
|
||||||
|
@Composable
|
||||||
|
private fun AiCard(subtitle: String, modifier: Modifier = Modifier, onClick: () -> Unit) {
|
||||||
|
Box(
|
||||||
|
modifier = modifier
|
||||||
|
.clip(GlassShape)
|
||||||
|
.background(ChessGreen)
|
||||||
|
.wavePattern(OnAccent.copy(alpha = 0.16f))
|
||||||
|
.clickable(onClick = onClick)
|
||||||
|
) {
|
||||||
|
Image(
|
||||||
|
painter = painterResource(R.drawable.piece_black_king),
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.TopEnd)
|
||||||
|
.padding(top = 10.dp, end = 4.dp)
|
||||||
|
.size(108.dp)
|
||||||
|
.rotate(10f)
|
||||||
|
)
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.align(Alignment.BottomStart).fillMaxWidth().padding(16.dp)
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.mode_ai_title),
|
||||||
|
color = OnAccent,
|
||||||
|
style = MaterialTheme.typography.headlineSmall.copy(fontSize = 19.sp, lineHeight = 24.sp),
|
||||||
|
maxLines = 2,
|
||||||
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
|
Spacer(Modifier.height(4.dp))
|
||||||
|
Text(
|
||||||
|
subtitle,
|
||||||
|
color = OnAccent.copy(alpha = 0.7f),
|
||||||
|
style = MaterialTheme.typography.bodySmall,
|
||||||
|
maxLines = 2,
|
||||||
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun SmallModeCard(
|
||||||
|
iconRes: Int,
|
||||||
|
title: String,
|
||||||
|
subtitle: String,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
onClick: () -> Unit
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = modifier
|
||||||
|
.clip(GlassShape)
|
||||||
|
.background(Surface1)
|
||||||
|
.border(1.dp, PanelBorder, GlassShape)
|
||||||
|
.clickable(onClick = onClick)
|
||||||
|
.padding(14.dp)
|
||||||
|
) {
|
||||||
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.size(34.dp).clip(CircleShape).background(ChessGreen.copy(alpha = 0.14f)),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
AppIcon(iconRes, size = 18.dp, tint = ChessGreen)
|
||||||
|
}
|
||||||
|
Spacer(Modifier.weight(1f))
|
||||||
|
ArrowBubble(fill = Surface2, tint = ink)
|
||||||
|
}
|
||||||
|
Spacer(Modifier.weight(1f))
|
||||||
|
Text(title, color = ink, style = MaterialTheme.typography.titleMedium, maxLines = 2, overflow = TextOverflow.Ellipsis)
|
||||||
|
Text(subtitle, color = ink.copy(alpha = 0.55f), style = MaterialTheme.typography.bodySmall, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** An unfinished game against the AI: move number, whose turn and the clock, one tap to resume. */
|
/** An unfinished game against the AI: move number, whose turn and the clock, one tap to resume. */
|
||||||
@Composable
|
@Composable
|
||||||
private fun ContinueCard(info: ResumeInfo, onClick: () -> Unit) {
|
private fun ContinueCard(info: ResumeInfo, modifier: Modifier = Modifier, onClick: () -> Unit) {
|
||||||
val turn = stringResource(if (info.myTurn) R.string.home_your_move else R.string.home_ai_move)
|
val turn = stringResource(if (info.myTurn) R.string.home_your_move else R.string.home_ai_move)
|
||||||
val clock = info.myMillis?.let { ms ->
|
val clock = info.myMillis?.let { ms ->
|
||||||
val s = ms.coerceAtLeast(0) / 1000
|
val s = ms.coerceAtLeast(0) / 1000
|
||||||
"%d:%02d".format(s / 60, s % 60)
|
"%d:%02d".format(s / 60, s % 60)
|
||||||
}
|
}
|
||||||
val details = stringResource(R.string.home_continue_details, info.moveNumber, turn) + (clock?.let { " · $it" } ?: "")
|
val details = stringResource(R.string.home_continue_details, info.moveNumber, turn) + (clock?.let { " · $it" } ?: "")
|
||||||
Row(
|
Column(
|
||||||
modifier = Modifier
|
modifier = modifier
|
||||||
.fillMaxWidth()
|
.clip(GlassShape)
|
||||||
.glass()
|
.background(Lime)
|
||||||
.border(1.dp, ChessGreen.copy(alpha = 0.6f), GlassShape)
|
|
||||||
.clickable(onClick = onClick)
|
.clickable(onClick = onClick)
|
||||||
.padding(16.dp),
|
.padding(14.dp)
|
||||||
verticalAlignment = Alignment.CenterVertically
|
|
||||||
) {
|
) {
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
Text(stringResource(R.string.continue_game_title), color = ink, style = MaterialTheme.typography.titleMedium)
|
|
||||||
Text(details, color = ink.copy(alpha = 0.7f), style = MaterialTheme.typography.bodySmall)
|
|
||||||
}
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.size(44.dp).clip(CircleShape).background(ChessGreen),
|
modifier = Modifier.size(34.dp).clip(CircleShape).background(OnAccent.copy(alpha = 0.1f)),
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
cc.skysparkle.matewave.ui.components.AppIcon(R.drawable.ic_arrow_forward, size = 20.dp, tint = Color.White)
|
AppIcon(R.drawable.ic_play, size = 18.dp, tint = OnAccent)
|
||||||
}
|
}
|
||||||
|
Spacer(Modifier.weight(1f))
|
||||||
|
ArrowBubble(fill = OnAccent, tint = Lime)
|
||||||
|
}
|
||||||
|
Spacer(Modifier.weight(1f))
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.continue_game_title),
|
||||||
|
color = OnAccent,
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
maxLines = 2,
|
||||||
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
|
Text(details, color = OnAccent.copy(alpha = 0.7f), style = MaterialTheme.typography.bodySmall, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** One of the two equal ways to start a game. */
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ModeTile(iconRes: Int, title: String, subtitle: String, modifier: Modifier = Modifier, onClick: () -> Unit) {
|
private fun ArrowBubble(fill: Color, tint: Color) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.size(30.dp).clip(CircleShape).background(fill),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
AppIcon(R.drawable.ic_arrow_forward, size = 16.dp, tint = tint)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun LearnCard(
|
||||||
|
iconRes: Int,
|
||||||
|
title: String,
|
||||||
|
subtitle: String,
|
||||||
|
highlighted: Boolean,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
onClick: () -> Unit
|
||||||
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.glass()
|
.height(148.dp)
|
||||||
|
.clip(GlassShape)
|
||||||
|
.background(Surface1)
|
||||||
|
.border(1.dp, if (highlighted) ChessGreen.copy(alpha = 0.7f) else PanelBorder, GlassShape)
|
||||||
.clickable(onClick = onClick)
|
.clickable(onClick = onClick)
|
||||||
.padding(14.dp),
|
.padding(14.dp)
|
||||||
verticalArrangement = Arrangement.spacedBy(4.dp)
|
|
||||||
) {
|
) {
|
||||||
Image(
|
Box(
|
||||||
painter = painterResource(iconRes),
|
modifier = Modifier
|
||||||
contentDescription = null,
|
.size(40.dp)
|
||||||
colorFilter = ColorFilter.tint(ink),
|
.clip(RoundedCornerShape(14.dp))
|
||||||
modifier = Modifier.size(24.dp)
|
.background(if (highlighted) ChessGreen else Surface2),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
AppIcon(iconRes, size = 22.dp, tint = if (highlighted) OnAccent else ChessGreen)
|
||||||
|
}
|
||||||
|
Spacer(Modifier.weight(1f))
|
||||||
|
Text(title, color = ink, style = MaterialTheme.typography.titleSmall, maxLines = 2, overflow = TextOverflow.Ellipsis)
|
||||||
|
Spacer(Modifier.height(2.dp))
|
||||||
|
Text(subtitle, color = ink.copy(alpha = 0.55f), style = MaterialTheme.typography.bodySmall, maxLines = 2, overflow = TextOverflow.Ellipsis)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Rating with its trend and the three numbers players look at; opens the statistics. */
|
||||||
|
@Composable
|
||||||
|
private fun ProgressPanel(elo: Int, onClick: () -> Unit) {
|
||||||
|
val curve = remember(elo) { Stats.ratingCurve(elo) }
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clip(GlassShape)
|
||||||
|
.background(Surface1)
|
||||||
|
.border(1.dp, PanelBorder, GlassShape)
|
||||||
|
.clickable(onClick = onClick)
|
||||||
|
.padding(16.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.account_progress).uppercase(),
|
||||||
|
color = ink.copy(alpha = 0.5f),
|
||||||
|
style = MaterialTheme.typography.labelMedium
|
||||||
)
|
)
|
||||||
Text(title, color = ink, style = MaterialTheme.typography.titleMedium)
|
Text("$elo", color = ink, style = MaterialTheme.typography.headlineMedium)
|
||||||
Text(subtitle, color = ink.copy(alpha = 0.65f), style = MaterialTheme.typography.bodySmall)
|
}
|
||||||
|
MiniRatingGraph(points = curve, modifier = Modifier.width(132.dp).height(44.dp), showDots = false, showGrid = false)
|
||||||
|
}
|
||||||
|
StatTiles()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Games, wins and streak, as three equal tiles. */
|
||||||
|
@Composable
|
||||||
|
internal fun StatTiles() {
|
||||||
|
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||||
|
StatTile(R.drawable.ic_play, stringResource(R.string.stat_games), "${Stats.gamesPlayed()}", Modifier.weight(1f))
|
||||||
|
StatTile(R.drawable.ic_trophy, stringResource(R.string.stat_wins), "${Stats.wins()}", Modifier.weight(1f))
|
||||||
|
StatTile(R.drawable.ic_speed, stringResource(R.string.stat_streak), "${Stats.streak()}", Modifier.weight(1f))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun StatTile(iconRes: Int, label: String, value: String, modifier: Modifier = Modifier) {
|
||||||
|
Column(
|
||||||
|
modifier = modifier
|
||||||
|
.clip(RoundedCornerShape(16.dp))
|
||||||
|
.background(Surface2)
|
||||||
|
.padding(vertical = 12.dp, horizontal = 8.dp),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
|
) {
|
||||||
|
AppIcon(iconRes, size = 18.dp, tint = ChessGreen)
|
||||||
|
Spacer(Modifier.height(6.dp))
|
||||||
|
Text(label, color = ink.copy(alpha = 0.6f), style = MaterialTheme.typography.labelSmall, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
|
Text(value, color = ink, style = MaterialTheme.typography.titleMedium, maxLines = 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,7 +517,7 @@ internal fun StatsDialog(onDismiss: () -> Unit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
internal fun MiniRatingGraph(points: List<Int>, modifier: Modifier = Modifier) {
|
internal fun MiniRatingGraph(points: List<Int>, modifier: Modifier = Modifier, showDots: Boolean = true, showGrid: Boolean = true) {
|
||||||
val lineInk = ink
|
val lineInk = ink
|
||||||
// Paths, gradient and stroke are built once per size and reused by every redraw.
|
// Paths, gradient and stroke are built once per size and reused by every redraw.
|
||||||
Spacer(
|
Spacer(
|
||||||
@@ -352,24 +543,31 @@ internal fun MiniRatingGraph(points: List<Int>, modifier: Modifier = Modifier) {
|
|||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
val fillBrush = Brush.verticalGradient(listOf(ChessGreen.copy(alpha = 0.35f), ChessGreen.copy(alpha = 0f)))
|
val fillBrush = Brush.verticalGradient(listOf(ChessGreen.copy(alpha = 0.35f), ChessGreen.copy(alpha = 0f)))
|
||||||
val lineStroke = Stroke(width = 4f, cap = StrokeCap.Round)
|
val lineBrush = Brush.horizontalGradient(listOf(ChessGreen, Lime))
|
||||||
|
val lineStroke = Stroke(width = 2.5.dp.toPx(), cap = StrokeCap.Round)
|
||||||
|
|
||||||
onDrawBehind {
|
onDrawBehind {
|
||||||
|
if (showGrid) {
|
||||||
val gridLines = 4
|
val gridLines = 4
|
||||||
for (i in 0..gridLines) {
|
for (i in 0..gridLines) {
|
||||||
val y = size.height / gridLines * i
|
val y = size.height / gridLines * i
|
||||||
drawLine(lineInk.copy(alpha = 0.08f), Offset(0f, y), Offset(size.width, y), strokeWidth = 1f)
|
drawLine(lineInk.copy(alpha = 0.06f), Offset(0f, y), Offset(size.width, y), strokeWidth = 1f)
|
||||||
|
}
|
||||||
|
drawLine(lineInk.copy(alpha = 0.25f), Offset(0f, zeroY), Offset(size.width, zeroY), strokeWidth = 1.5f)
|
||||||
}
|
}
|
||||||
drawLine(lineInk.copy(alpha = 0.3f), Offset(0f, zeroY), Offset(size.width, zeroY), strokeWidth = 1.5f)
|
|
||||||
|
|
||||||
drawPath(fill, brush = fillBrush)
|
drawPath(fill, brush = fillBrush)
|
||||||
drawPath(line, color = ChessGreen, style = lineStroke)
|
drawPath(line, brush = lineBrush, style = lineStroke)
|
||||||
|
|
||||||
|
if (showDots) {
|
||||||
points.forEachIndexed { i, v ->
|
points.forEachIndexed { i, v ->
|
||||||
val center = Offset(i * stepX, yOf(v))
|
val center = Offset(i * stepX, yOf(v))
|
||||||
drawCircle(color = lineInk, radius = 5f, center = center)
|
drawCircle(color = Surface1, radius = 5f, center = center)
|
||||||
drawCircle(color = ChessGreen, radius = 3f, center = center)
|
drawCircle(color = ChessGreen, radius = 3f, center = center)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
drawCircle(color = Lime, radius = 4.dp.toPx(), center = Offset(size.width, yOf(points.last())))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ private fun ActionCard(icon: Int, title: String, subtitle: String?, button: Stri
|
|||||||
Spacer(Modifier.width(12.dp))
|
Spacer(Modifier.width(12.dp))
|
||||||
GlassButton(onClick = onClick) {
|
GlassButton(onClick = onClick) {
|
||||||
ButtonIcon(R.drawable.ic_play)
|
ButtonIcon(R.drawable.ic_play)
|
||||||
Text(button, color = ink, maxLines = 1)
|
Text(button, maxLines = 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ fun OpeningTrainerScreen(viewModel: OpeningStudyViewModel, onBack: () -> Unit) {
|
|||||||
}
|
}
|
||||||
GlassButton(onClick = { if (!viewModel.continueStudy()) onBack() }, modifier = Modifier.weight(1f)) {
|
GlassButton(onClick = { if (!viewModel.continueStudy()) onBack() }, modifier = Modifier.weight(1f)) {
|
||||||
ButtonIcon(R.drawable.ic_next)
|
ButtonIcon(R.drawable.ic_next)
|
||||||
Text(stringResource(R.string.study_next), color = ink, maxLines = 1)
|
Text(stringResource(R.string.study_next), maxLines = 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ fun PermissionsScreen(onBack: () -> Unit) {
|
|||||||
cc.skysparkle.matewave.network.Transports.applyAnnounceSetting()
|
cc.skysparkle.matewave.network.Transports.applyAnnounceSetting()
|
||||||
},
|
},
|
||||||
colors = SwitchDefaults.colors(
|
colors = SwitchDefaults.colors(
|
||||||
checkedThumbColor = Color.White,
|
checkedThumbColor = cc.skysparkle.matewave.ui.theme.OnAccent,
|
||||||
checkedTrackColor = Color(0xFF4F8A5B)
|
checkedTrackColor = cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -142,8 +142,8 @@ fun PermissionsScreen(onBack: () -> Unit) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
colors = SwitchDefaults.colors(
|
colors = SwitchDefaults.colors(
|
||||||
checkedThumbColor = Color.White,
|
checkedThumbColor = cc.skysparkle.matewave.ui.theme.OnAccent,
|
||||||
checkedTrackColor = Color(0xFF4F8A5B)
|
checkedTrackColor = cc.skysparkle.matewave.ui.theme.ChessGreen
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ fun PuzzleSolveScreen(viewModel: GameViewModel, onBack: () -> Unit, onNextPuzzle
|
|||||||
if (next != null) {
|
if (next != null) {
|
||||||
GlassButton(onClick = { onNextPuzzle(next) }, modifier = Modifier.fillMaxWidth()) {
|
GlassButton(onClick = { onNextPuzzle(next) }, modifier = Modifier.fillMaxWidth()) {
|
||||||
ButtonIcon(R.drawable.ic_next)
|
ButtonIcon(R.drawable.ic_next)
|
||||||
Text(stringResource(R.string.puzzle_next), color = ink, style = MaterialTheme.typography.titleMedium)
|
Text(stringResource(R.string.puzzle_next), style = MaterialTheme.typography.titleMedium)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ private fun SettingSwitch(checked: Boolean, onCheckedChange: (Boolean) -> Unit)
|
|||||||
onCheckedChange = onCheckedChange,
|
onCheckedChange = onCheckedChange,
|
||||||
colors = SwitchDefaults.colors(
|
colors = SwitchDefaults.colors(
|
||||||
checkedTrackColor = ChessGreen,
|
checkedTrackColor = ChessGreen,
|
||||||
checkedThumbColor = Color.White,
|
checkedThumbColor = cc.skysparkle.matewave.ui.theme.OnAccent,
|
||||||
uncheckedTrackColor = ink.copy(alpha = 0.15f),
|
uncheckedTrackColor = ink.copy(alpha = 0.15f),
|
||||||
uncheckedThumbColor = Color.White.copy(alpha = 0.7f)
|
uncheckedThumbColor = Color.White.copy(alpha = 0.7f)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package cc.skysparkle.matewave.ui.screens
|
package cc.skysparkle.matewave.ui.screens
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.border
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@@ -223,15 +225,25 @@ private fun SpectatorPlayerRow(
|
|||||||
val avatar = remember(player.id) {
|
val avatar = remember(player.id) {
|
||||||
if (player.id.isEmpty()) null else FriendsStore.list().firstOrNull { it.userId == player.id }?.avatarBase64
|
if (player.id.isEmpty()) null else FriendsStore.list().firstOrNull { it.userId == player.id }?.avatarBase64
|
||||||
}
|
}
|
||||||
Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
|
val cardShape = androidx.compose.foundation.shape.RoundedCornerShape(18.dp)
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clip(cardShape)
|
||||||
|
.background(cc.skysparkle.matewave.ui.theme.Surface1)
|
||||||
|
.border(1.dp, if (active) ChessGreen.copy(alpha = 0.7f) else cc.skysparkle.matewave.ui.theme.PanelBorder, cardShape)
|
||||||
|
.padding(horizontal = 10.dp, vertical = 8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(8.dp)
|
.size(40.dp)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.background(if (active) ChessGreen else ink.copy(alpha = 0.15f))
|
.background(if (active) ChessGreen else androidx.compose.ui.graphics.Color.Transparent),
|
||||||
)
|
contentAlignment = Alignment.Center
|
||||||
Spacer(Modifier.width(10.dp))
|
) {
|
||||||
AvatarCircle(base64 = avatar, size = 34.dp)
|
AvatarCircle(base64 = avatar, size = 36.dp)
|
||||||
|
}
|
||||||
Spacer(Modifier.width(10.dp))
|
Spacer(Modifier.width(10.dp))
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ fun VsAiSetupScreen(
|
|||||||
ButtonIcon(R.drawable.ic_play)
|
ButtonIcon(R.drawable.ic_play)
|
||||||
Text(
|
Text(
|
||||||
stringResource(R.string.vsai_play_summary, difficultyLabel(difficulty), timeControl.displayName()),
|
stringResource(R.string.vsai_play_summary, difficultyLabel(difficulty), timeControl.displayName()),
|
||||||
color = ink,
|
|
||||||
style = MaterialTheme.typography.titleMedium,
|
style = MaterialTheme.typography.titleMedium,
|
||||||
maxLines = 1
|
maxLines = 1
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,15 +4,14 @@ import androidx.compose.foundation.background
|
|||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.Brush
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.Shape
|
import androidx.compose.ui.graphics.Shape
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
val PanelFill = Color(0xFF14171C).copy(alpha = 0.86f)
|
val PanelFill = Surface1
|
||||||
val PanelBorder = Color.White.copy(alpha = 0.10f)
|
val PanelBorder = Color.White.copy(alpha = 0.06f)
|
||||||
|
|
||||||
val UiCornerRadius = 8.dp
|
val UiCornerRadius = 22.dp
|
||||||
val GlassShape: Shape = RoundedCornerShape(UiCornerRadius)
|
val GlassShape: Shape = RoundedCornerShape(UiCornerRadius)
|
||||||
|
|
||||||
val TabletMaxContentWidth = 600.dp
|
val TabletMaxContentWidth = 600.dp
|
||||||
@@ -21,17 +20,6 @@ fun Modifier.glass(): Modifier = this
|
|||||||
.clip(GlassShape)
|
.clip(GlassShape)
|
||||||
.background(PanelFill)
|
.background(PanelFill)
|
||||||
|
|
||||||
val PhotoScrim = Brush.verticalGradient(
|
val DialogScrimColor = Color.Black.copy(alpha = 0.70f)
|
||||||
0.00f to Color.Black.copy(alpha = 0.84f),
|
|
||||||
0.10f to Color.Black.copy(alpha = 0.72f),
|
|
||||||
0.22f to Color.Black.copy(alpha = 0.58f),
|
|
||||||
0.38f to Color.Black.copy(alpha = 0.48f),
|
|
||||||
0.55f to Color.Black.copy(alpha = 0.47f),
|
|
||||||
0.72f to Color.Black.copy(alpha = 0.55f),
|
|
||||||
0.88f to Color.Black.copy(alpha = 0.68f),
|
|
||||||
1.00f to Color.Black.copy(alpha = 0.80f)
|
|
||||||
)
|
|
||||||
|
|
||||||
val DialogScrimColor = Color.Black.copy(alpha = 0.62f)
|
val FloatingBarFill = Surface2
|
||||||
|
|
||||||
val FloatingBarFill = Color.Black.copy(alpha = 0.25f)
|
|
||||||
|
|||||||
@@ -3,13 +3,32 @@ package cc.skysparkle.matewave.ui.theme
|
|||||||
import androidx.compose.material3.LocalContentColor
|
import androidx.compose.material3.LocalContentColor
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.OutlinedTextFieldDefaults
|
import androidx.compose.material3.OutlinedTextFieldDefaults
|
||||||
|
import androidx.compose.material3.Typography
|
||||||
import androidx.compose.material3.darkColorScheme
|
import androidx.compose.material3.darkColorScheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.CompositionLocalProvider
|
import androidx.compose.runtime.CompositionLocalProvider
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
|
import androidx.compose.ui.text.font.Font
|
||||||
|
import androidx.compose.ui.text.font.FontFamily
|
||||||
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
import cc.skysparkle.matewave.R
|
||||||
|
import androidx.compose.ui.unit.sp
|
||||||
|
|
||||||
|
/** Neon green: the brand accent for highlights, selected states and progress. */
|
||||||
|
val ChessGreen = Color(0xFF35E07E)
|
||||||
|
val ChessGreenDark = Color(0xFF123D25)
|
||||||
|
|
||||||
|
/** Lime: the one colour for the main action on a screen. */
|
||||||
|
val Lime = Color(0xFFE3F84B)
|
||||||
|
|
||||||
|
/** Text and icons on top of [ChessGreen] or [Lime]. */
|
||||||
|
val OnAccent = Color(0xFF0B1610)
|
||||||
|
|
||||||
|
val AppBackground = Color(0xFF0C0F0E)
|
||||||
|
val Surface1 = Color(0xFF161B19)
|
||||||
|
val Surface2 = Color(0xFF1F2623)
|
||||||
|
|
||||||
val ChessGreen = Color(0xFF3E7C4A)
|
|
||||||
val ChessGreenDark = Color(0xFF1B4D2E)
|
|
||||||
val HighlightMove = Color(0x8858A6FF)
|
val HighlightMove = Color(0x8858A6FF)
|
||||||
val HighlightCheck = Color(0x88E53935)
|
val HighlightCheck = Color(0x88E53935)
|
||||||
val HighlightLastMove = Color(0x664FC3F7)
|
val HighlightLastMove = Color(0x664FC3F7)
|
||||||
@@ -17,15 +36,66 @@ val HighlightHint = Color(0x88FFC107)
|
|||||||
|
|
||||||
private val DarkScheme = darkColorScheme(
|
private val DarkScheme = darkColorScheme(
|
||||||
primary = ChessGreen,
|
primary = ChessGreen,
|
||||||
secondary = ChessGreenDark,
|
onPrimary = OnAccent,
|
||||||
background = Color(0xFF121212),
|
secondary = Lime,
|
||||||
surface = Color(0xFF1E1E1E)
|
onSecondary = OnAccent,
|
||||||
|
background = AppBackground,
|
||||||
|
surface = Surface1,
|
||||||
|
surfaceVariant = Surface2
|
||||||
|
)
|
||||||
|
|
||||||
|
/** Wide display face for the big headings: the brand voice of the app. */
|
||||||
|
val DisplayFont = FontFamily(
|
||||||
|
Font(R.font.unbounded_semibold, FontWeight.SemiBold),
|
||||||
|
Font(R.font.unbounded_extrabold, FontWeight.ExtraBold)
|
||||||
|
)
|
||||||
|
|
||||||
|
/** Text face for everything else. Characters it lacks (CJK, symbols) fall back to the system font. */
|
||||||
|
val TextFont = FontFamily(
|
||||||
|
Font(R.font.manrope_regular, FontWeight.Normal),
|
||||||
|
Font(R.font.manrope_medium, FontWeight.Medium),
|
||||||
|
Font(R.font.manrope_semibold, FontWeight.SemiBold),
|
||||||
|
Font(R.font.manrope_bold, FontWeight.Bold)
|
||||||
|
)
|
||||||
|
|
||||||
|
private val base = Typography()
|
||||||
|
|
||||||
|
private fun TextStyle.display(weight: FontWeight, tracking: Double) =
|
||||||
|
copy(fontFamily = DisplayFont, fontWeight = weight, letterSpacing = tracking.sp)
|
||||||
|
|
||||||
|
private fun TextStyle.text(weight: FontWeight) = copy(fontFamily = TextFont, fontWeight = weight)
|
||||||
|
|
||||||
|
private val AppTypography = Typography(
|
||||||
|
displayLarge = base.displayLarge.display(FontWeight.ExtraBold, -1.5),
|
||||||
|
displayMedium = base.displayMedium.display(FontWeight.ExtraBold, -1.2),
|
||||||
|
displaySmall = base.displaySmall.display(FontWeight.ExtraBold, -0.8),
|
||||||
|
headlineLarge = base.headlineLarge.display(FontWeight.ExtraBold, -0.8),
|
||||||
|
headlineMedium = base.headlineMedium.display(FontWeight.ExtraBold, -0.6),
|
||||||
|
headlineSmall = base.headlineSmall.copy(fontSize = 21.sp, lineHeight = 28.sp).display(FontWeight.SemiBold, -0.4),
|
||||||
|
titleLarge = base.titleLarge.text(FontWeight.Bold),
|
||||||
|
titleMedium = base.titleMedium.text(FontWeight.Bold),
|
||||||
|
titleSmall = base.titleSmall.text(FontWeight.Bold),
|
||||||
|
bodyLarge = base.bodyLarge.text(FontWeight.Medium),
|
||||||
|
bodyMedium = base.bodyMedium.text(FontWeight.Medium),
|
||||||
|
bodySmall = base.bodySmall.text(FontWeight.Medium),
|
||||||
|
labelLarge = base.labelLarge.text(FontWeight.Bold),
|
||||||
|
labelMedium = base.labelMedium.text(FontWeight.Bold).copy(letterSpacing = 1.sp),
|
||||||
|
labelSmall = base.labelSmall.text(FontWeight.SemiBold)
|
||||||
|
)
|
||||||
|
|
||||||
|
/** Large hero heading on the home screen. */
|
||||||
|
val HeroTextStyle = TextStyle(
|
||||||
|
fontFamily = DisplayFont,
|
||||||
|
fontSize = 46.sp,
|
||||||
|
lineHeight = 50.sp,
|
||||||
|
fontWeight = FontWeight.ExtraBold,
|
||||||
|
letterSpacing = (-1.5).sp
|
||||||
)
|
)
|
||||||
|
|
||||||
/** The app has a single dark theme; system bars are set up in MainActivity. */
|
/** The app has a single dark theme; system bars are set up in MainActivity. */
|
||||||
@Composable
|
@Composable
|
||||||
fun MatewaveTheme(content: @Composable () -> Unit) {
|
fun MatewaveTheme(content: @Composable () -> Unit) {
|
||||||
MaterialTheme(colorScheme = DarkScheme) {
|
MaterialTheme(colorScheme = DarkScheme, typography = AppTypography) {
|
||||||
// Text and icons without their own colour are light, so nothing turns black on the dark background
|
// Text and icons without their own colour are light, so nothing turns black on the dark background
|
||||||
CompositionLocalProvider(LocalContentColor provides Color.White, content = content)
|
CompositionLocalProvider(LocalContentColor provides Color.White, content = content)
|
||||||
}
|
}
|
||||||
@@ -35,9 +105,9 @@ fun MatewaveTheme(content: @Composable () -> Unit) {
|
|||||||
fun whiteOutlinedTextFieldColors() = OutlinedTextFieldDefaults.colors(
|
fun whiteOutlinedTextFieldColors() = OutlinedTextFieldDefaults.colors(
|
||||||
focusedTextColor = ink,
|
focusedTextColor = ink,
|
||||||
unfocusedTextColor = ink,
|
unfocusedTextColor = ink,
|
||||||
focusedBorderColor = ink.copy(alpha = 0.6f),
|
focusedBorderColor = ChessGreen,
|
||||||
unfocusedBorderColor = ink.copy(alpha = 0.3f),
|
unfocusedBorderColor = ink.copy(alpha = 0.2f),
|
||||||
focusedLabelColor = ink.copy(alpha = 0.8f),
|
focusedLabelColor = ChessGreen,
|
||||||
unfocusedLabelColor = ink.copy(alpha = 0.6f),
|
unfocusedLabelColor = ink.copy(alpha = 0.6f),
|
||||||
cursorColor = ink
|
cursorColor = ChessGreen
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
Copyright 2018 The Manrope Project Authors (https://github.com/googlefonts/manrope)
|
||||||
|
Copyright 2022 The Unbounded Project Authors (https://github.com/googlefonts/unbounded)
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
https://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||||
@@ -171,6 +171,8 @@
|
|||||||
<string name="licenses_group_data">Daten</string>
|
<string name="licenses_group_data">Daten</string>
|
||||||
<string name="licenses_group_radio">Radio</string>
|
<string name="licenses_group_radio">Radio</string>
|
||||||
<string name="licenses_apache_full">Vollständiger Text der Apache License 2.0</string>
|
<string name="licenses_apache_full">Vollständiger Text der Apache License 2.0</string>
|
||||||
|
<string name="licenses_ofl_full">Vollständiger Text der SIL Open Font License 1.1</string>
|
||||||
|
<string name="licenses_note_fonts">Schriften der Oberfläche: Unbounded für Überschriften, Manrope für Text.</string>
|
||||||
<string name="licenses_note_puzzles">Die Aufgaben stammen aus der offenen Lichess-Puzzle-Datenbank. Die CC0-Lizenz verlangt keine Namensnennung – wir danken dem Lichess-Team.</string>
|
<string name="licenses_note_puzzles">Die Aufgaben stammen aus der offenen Lichess-Puzzle-Datenbank. Die CC0-Lizenz verlangt keine Namensnennung – wir danken dem Lichess-Team.</string>
|
||||||
<string name="licenses_note_swissjazz">Öffentlich zugänglicher Internet-Stream der SRG SSR: ohne Werbung und ohne Moderation, durch Gebühren finanziert. Die Musik gehört dem Sender und den Rechteinhabern; die App spielt den Stream nur ab und speichert nichts.</string>
|
<string name="licenses_note_swissjazz">Öffentlich zugänglicher Internet-Stream der SRG SSR: ohne Werbung und ohne Moderation, durch Gebühren finanziert. Die Musik gehört dem Sender und den Rechteinhabern; die App spielt den Stream nur ab und speichert nichts.</string>
|
||||||
<string name="licenses_radio_hint">Das Jazzradio in den Einstellungen spielt nur Radio Swiss Jazz; ist einer der offiziellen Stream-Links nicht erreichbar, nutzt die App einen anderen.</string>
|
<string name="licenses_radio_hint">Das Jazzradio in den Einstellungen spielt nur Radio Swiss Jazz; ist einer der offiziellen Stream-Links nicht erreichbar, nutzt die App einen anderen.</string>
|
||||||
@@ -307,6 +309,10 @@
|
|||||||
<string name="study_start_button">Start</string>
|
<string name="study_start_button">Start</string>
|
||||||
<string name="study_locked_short">Gesperrt</string>
|
<string name="study_locked_short">Gesperrt</string>
|
||||||
<string name="home_today">Heute</string>
|
<string name="home_today">Heute</string>
|
||||||
|
<string name="home_hero">Spiel los</string>
|
||||||
|
<string name="stat_games">Partien</string>
|
||||||
|
<string name="stat_wins">Siege</string>
|
||||||
|
<string name="stat_streak">Serie</string>
|
||||||
<string name="home_continue_details">Zug %1$d · %2$s</string>
|
<string name="home_continue_details">Zug %1$d · %2$s</string>
|
||||||
<string name="home_your_move">du bist am Zug</string>
|
<string name="home_your_move">du bist am Zug</string>
|
||||||
<string name="home_ai_move">KI am Zug</string>
|
<string name="home_ai_move">KI am Zug</string>
|
||||||
|
|||||||
@@ -171,6 +171,8 @@
|
|||||||
<string name="licenses_group_data">データ</string>
|
<string name="licenses_group_data">データ</string>
|
||||||
<string name="licenses_group_radio">ラジオ</string>
|
<string name="licenses_group_radio">ラジオ</string>
|
||||||
<string name="licenses_apache_full">Apache License 2.0 の全文</string>
|
<string name="licenses_apache_full">Apache License 2.0 の全文</string>
|
||||||
|
<string name="licenses_ofl_full">SIL Open Font License 1.1 の全文</string>
|
||||||
|
<string name="licenses_note_fonts">インターフェースのフォント:見出しは Unbounded、本文は Manrope。</string>
|
||||||
<string name="licenses_note_puzzles">パズルは Lichess のオープンなパズルデータベースから選んでいます。CC0 ライセンスでは表示義務はありませんが、Lichess チームに感謝します。</string>
|
<string name="licenses_note_puzzles">パズルは Lichess のオープンなパズルデータベースから選んでいます。CC0 ライセンスでは表示義務はありませんが、Lichess チームに感謝します。</string>
|
||||||
<string name="licenses_note_swissjazz">SRG SSR が公開しているインターネットストリームです。広告もナビゲーターもなく、受信料で運営されています。音楽の権利は放送局と権利者に帰属し、アプリは再生するだけで何も保存しません。</string>
|
<string name="licenses_note_swissjazz">SRG SSR が公開しているインターネットストリームです。広告もナビゲーターもなく、受信料で運営されています。音楽の権利は放送局と権利者に帰属し、アプリは再生するだけで何も保存しません。</string>
|
||||||
<string name="licenses_radio_hint">設定のジャズラジオは Radio Swiss Jazz だけを再生します。公式リンクのひとつがつながらないときは、別のリンクに切り替わります。</string>
|
<string name="licenses_radio_hint">設定のジャズラジオは Radio Swiss Jazz だけを再生します。公式リンクのひとつがつながらないときは、別のリンクに切り替わります。</string>
|
||||||
@@ -306,6 +308,10 @@
|
|||||||
<string name="study_start_button">始める</string>
|
<string name="study_start_button">始める</string>
|
||||||
<string name="study_locked_short">ロック中</string>
|
<string name="study_locked_short">ロック中</string>
|
||||||
<string name="home_today">今日</string>
|
<string name="home_today">今日</string>
|
||||||
|
<string name="home_hero">さあ、対局</string>
|
||||||
|
<string name="stat_games">対局数</string>
|
||||||
|
<string name="stat_wins">勝利</string>
|
||||||
|
<string name="stat_streak">連勝</string>
|
||||||
<string name="home_continue_details">%1$d手目 · %2$s</string>
|
<string name="home_continue_details">%1$d手目 · %2$s</string>
|
||||||
<string name="home_your_move">あなたの番</string>
|
<string name="home_your_move">あなたの番</string>
|
||||||
<string name="home_ai_move">AIの番</string>
|
<string name="home_ai_move">AIの番</string>
|
||||||
|
|||||||
@@ -171,6 +171,8 @@
|
|||||||
<string name="licenses_group_data">Duomenys</string>
|
<string name="licenses_group_data">Duomenys</string>
|
||||||
<string name="licenses_group_radio">Radijas</string>
|
<string name="licenses_group_radio">Radijas</string>
|
||||||
<string name="licenses_apache_full">Pilnas Apache License 2.0 tekstas</string>
|
<string name="licenses_apache_full">Pilnas Apache License 2.0 tekstas</string>
|
||||||
|
<string name="licenses_ofl_full">Pilnas SIL Open Font License 1.1 tekstas</string>
|
||||||
|
<string name="licenses_note_fonts">Sąsajos šriftai: „Unbounded“ antraštėms, „Manrope“ tekstui.</string>
|
||||||
<string name="licenses_note_puzzles">Užduotys atrinktos iš atviros „Lichess“ galvosūkių duomenų bazės. CC0 licencija nereikalauja nurodyti autorystės – dėkojame „Lichess“ komandai.</string>
|
<string name="licenses_note_puzzles">Užduotys atrinktos iš atviros „Lichess“ galvosūkių duomenų bazės. CC0 licencija nereikalauja nurodyti autorystės – dėkojame „Lichess“ komandai.</string>
|
||||||
<string name="licenses_note_swissjazz">Viešai prieinama SRG SSR interneto transliacija: be reklamos ir be vedėjų, finansuojama iš licencijos mokesčių. Muzikos teisės priklauso transliuotojui ir teisių turėtojams; programa srautą tik groja ir nieko neišsaugo.</string>
|
<string name="licenses_note_swissjazz">Viešai prieinama SRG SSR interneto transliacija: be reklamos ir be vedėjų, finansuojama iš licencijos mokesčių. Muzikos teisės priklauso transliuotojui ir teisių turėtojams; programa srautą tik groja ir nieko neišsaugo.</string>
|
||||||
<string name="licenses_radio_hint">Nustatymuose esantis džiazo radijas groja tik „Radio Swiss Jazz“; jei viena oficiali nuoroda nepasiekiama, programa naudoja kitą.</string>
|
<string name="licenses_radio_hint">Nustatymuose esantis džiazo radijas groja tik „Radio Swiss Jazz“; jei viena oficiali nuoroda nepasiekiama, programa naudoja kitą.</string>
|
||||||
@@ -309,6 +311,10 @@
|
|||||||
<string name="study_start_button">Pradėti</string>
|
<string name="study_start_button">Pradėti</string>
|
||||||
<string name="study_locked_short">Užrakinta</string>
|
<string name="study_locked_short">Užrakinta</string>
|
||||||
<string name="home_today">Šiandien</string>
|
<string name="home_today">Šiandien</string>
|
||||||
|
<string name="home_hero">Žaisk</string>
|
||||||
|
<string name="stat_games">Partijos</string>
|
||||||
|
<string name="stat_wins">Pergalės</string>
|
||||||
|
<string name="stat_streak">Serija</string>
|
||||||
<string name="home_continue_details">Ėjimas %1$d · %2$s</string>
|
<string name="home_continue_details">Ėjimas %1$d · %2$s</string>
|
||||||
<string name="home_your_move">jūsų ėjimas</string>
|
<string name="home_your_move">jūsų ėjimas</string>
|
||||||
<string name="home_ai_move">DI ėjimas</string>
|
<string name="home_ai_move">DI ėjimas</string>
|
||||||
|
|||||||
@@ -177,6 +177,8 @@
|
|||||||
<string name="licenses_group_data">Данные</string>
|
<string name="licenses_group_data">Данные</string>
|
||||||
<string name="licenses_group_radio">Радио</string>
|
<string name="licenses_group_radio">Радио</string>
|
||||||
<string name="licenses_apache_full">Полный текст Apache License 2.0</string>
|
<string name="licenses_apache_full">Полный текст Apache License 2.0</string>
|
||||||
|
<string name="licenses_ofl_full">Полный текст SIL Open Font License 1.1</string>
|
||||||
|
<string name="licenses_note_fonts">Шрифты интерфейса: Unbounded для заголовков, Manrope для текста.</string>
|
||||||
<string name="licenses_note_puzzles">Тактические задачи отобраны из открытой базы Lichess. Лицензия CC0 не требует указания авторства — мы благодарим команду Lichess.</string>
|
<string name="licenses_note_puzzles">Тактические задачи отобраны из открытой базы Lichess. Лицензия CC0 не требует указания авторства — мы благодарим команду Lichess.</string>
|
||||||
<string name="licenses_note_swissjazz">Общедоступный интернет-поток SRG SSR: без рекламы и без ведущих, финансируется лицензионными сборами. Права на музыку принадлежат вещателю и правообладателям; приложение только воспроизводит поток и ничего не сохраняет.</string>
|
<string name="licenses_note_swissjazz">Общедоступный интернет-поток SRG SSR: без рекламы и без ведущих, финансируется лицензионными сборами. Права на музыку принадлежат вещателю и правообладателям; приложение только воспроизводит поток и ничего не сохраняет.</string>
|
||||||
<string name="licenses_radio_hint">Джаз-радио в настройках играет только Radio Swiss Jazz; если одна из его официальных ссылок недоступна, приложение берёт другую.</string>
|
<string name="licenses_radio_hint">Джаз-радио в настройках играет только Radio Swiss Jazz; если одна из его официальных ссылок недоступна, приложение берёт другую.</string>
|
||||||
@@ -315,6 +317,10 @@
|
|||||||
<string name="study_start_button">Начать</string>
|
<string name="study_start_button">Начать</string>
|
||||||
<string name="study_locked_short">Закрыт</string>
|
<string name="study_locked_short">Закрыт</string>
|
||||||
<string name="home_today">Сегодня</string>
|
<string name="home_today">Сегодня</string>
|
||||||
|
<string name="home_hero">Играй</string>
|
||||||
|
<string name="stat_games">Партии</string>
|
||||||
|
<string name="stat_wins">Победы</string>
|
||||||
|
<string name="stat_streak">Серия</string>
|
||||||
<string name="home_continue_details">Ход %1$d · %2$s</string>
|
<string name="home_continue_details">Ход %1$d · %2$s</string>
|
||||||
<string name="home_your_move">ваш ход</string>
|
<string name="home_your_move">ваш ход</string>
|
||||||
<string name="home_ai_move">ход ИИ</string>
|
<string name="home_ai_move">ход ИИ</string>
|
||||||
|
|||||||
@@ -171,6 +171,8 @@
|
|||||||
<string name="licenses_group_data">数据</string>
|
<string name="licenses_group_data">数据</string>
|
||||||
<string name="licenses_group_radio">电台</string>
|
<string name="licenses_group_radio">电台</string>
|
||||||
<string name="licenses_apache_full">Apache License 2.0 全文</string>
|
<string name="licenses_apache_full">Apache License 2.0 全文</string>
|
||||||
|
<string name="licenses_ofl_full">SIL Open Font License 1.1 全文</string>
|
||||||
|
<string name="licenses_note_fonts">界面字体:标题使用 Unbounded,正文使用 Manrope。</string>
|
||||||
<string name="licenses_note_puzzles">题目选自 Lichess 开放的谜题数据库。CC0 许可证无需署名,在此感谢 Lichess 团队。</string>
|
<string name="licenses_note_puzzles">题目选自 Lichess 开放的谜题数据库。CC0 许可证无需署名,在此感谢 Lichess 团队。</string>
|
||||||
<string name="licenses_note_swissjazz">SRG SSR 公开提供的网络电台流:无广告、无主持人,由收视费资助。音乐版权归电台和权利人所有,应用只播放,不保存任何内容。</string>
|
<string name="licenses_note_swissjazz">SRG SSR 公开提供的网络电台流:无广告、无主持人,由收视费资助。音乐版权归电台和权利人所有,应用只播放,不保存任何内容。</string>
|
||||||
<string name="licenses_radio_hint">设置中的爵士电台只播放 Radio Swiss Jazz;其中一个官方地址不可用时,应用会改用另一个。</string>
|
<string name="licenses_radio_hint">设置中的爵士电台只播放 Radio Swiss Jazz;其中一个官方地址不可用时,应用会改用另一个。</string>
|
||||||
@@ -306,6 +308,10 @@
|
|||||||
<string name="study_start_button">开始</string>
|
<string name="study_start_button">开始</string>
|
||||||
<string name="study_locked_short">已锁定</string>
|
<string name="study_locked_short">已锁定</string>
|
||||||
<string name="home_today">今日</string>
|
<string name="home_today">今日</string>
|
||||||
|
<string name="home_hero">开局吧</string>
|
||||||
|
<string name="stat_games">对局</string>
|
||||||
|
<string name="stat_wins">胜局</string>
|
||||||
|
<string name="stat_streak">连胜</string>
|
||||||
<string name="home_continue_details">第 %1$d 步 · %2$s</string>
|
<string name="home_continue_details">第 %1$d 步 · %2$s</string>
|
||||||
<string name="home_your_move">轮到你</string>
|
<string name="home_your_move">轮到你</string>
|
||||||
<string name="home_ai_move">AI 走棋</string>
|
<string name="home_ai_move">AI 走棋</string>
|
||||||
|
|||||||
@@ -171,6 +171,8 @@
|
|||||||
<string name="licenses_group_data">Data</string>
|
<string name="licenses_group_data">Data</string>
|
||||||
<string name="licenses_group_radio">Radio</string>
|
<string name="licenses_group_radio">Radio</string>
|
||||||
<string name="licenses_apache_full">Full text of the Apache License 2.0</string>
|
<string name="licenses_apache_full">Full text of the Apache License 2.0</string>
|
||||||
|
<string name="licenses_ofl_full">Full text of the SIL Open Font License 1.1</string>
|
||||||
|
<string name="licenses_note_fonts">Typeface of the interface: Unbounded for headings, Manrope for text.</string>
|
||||||
<string name="licenses_note_puzzles">Puzzles are selected from the open Lichess puzzle database. The CC0 license does not require attribution — we thank the Lichess team.</string>
|
<string name="licenses_note_puzzles">Puzzles are selected from the open Lichess puzzle database. The CC0 license does not require attribution — we thank the Lichess team.</string>
|
||||||
<string name="licenses_note_swissjazz">Publicly available internet stream from SRG SSR: no advertising and no presenters, funded by license fees. The music belongs to the broadcaster and rights holders; the app only plays the stream and stores nothing.</string>
|
<string name="licenses_note_swissjazz">Publicly available internet stream from SRG SSR: no advertising and no presenters, funded by license fees. The music belongs to the broadcaster and rights holders; the app only plays the stream and stores nothing.</string>
|
||||||
<string name="licenses_radio_hint">The jazz radio in Settings plays only Radio Swiss Jazz; if one of its official stream links is unavailable, the app uses another.</string>
|
<string name="licenses_radio_hint">The jazz radio in Settings plays only Radio Swiss Jazz; if one of its official stream links is unavailable, the app uses another.</string>
|
||||||
@@ -307,6 +309,10 @@
|
|||||||
<string name="study_start_button">Start</string>
|
<string name="study_start_button">Start</string>
|
||||||
<string name="study_locked_short">Locked</string>
|
<string name="study_locked_short">Locked</string>
|
||||||
<string name="home_today">Today</string>
|
<string name="home_today">Today</string>
|
||||||
|
<string name="home_hero">Play it</string>
|
||||||
|
<string name="stat_games">Games</string>
|
||||||
|
<string name="stat_wins">Wins</string>
|
||||||
|
<string name="stat_streak">Streak</string>
|
||||||
<string name="home_continue_details">Move %1$d · %2$s</string>
|
<string name="home_continue_details">Move %1$d · %2$s</string>
|
||||||
<string name="home_your_move">your move</string>
|
<string name="home_your_move">your move</string>
|
||||||
<string name="home_ai_move">AI to move</string>
|
<string name="home_ai_move">AI to move</string>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 756 KiB |
|
After Width: | Height: | Size: 714 KiB |
|
After Width: | Height: | Size: 783 KiB |
|
Before Width: | Height: | Size: 783 KiB |
|
Before Width: | Height: | Size: 942 KiB |
|
After Width: | Height: | Size: 600 KiB |
|
Before Width: | Height: | Size: 832 KiB |
@@ -0,0 +1,6 @@
|
|||||||
|
• Neues Aussehen: dunkles Design mit Neongrün und Limette als Akzente
|
||||||
|
• Neuer Startbildschirm: große Modus-Karten, „Partie fortsetzen“ direkt daneben, Fortschrittsanzeige mit Wertung, Partien, Siegen und Serie
|
||||||
|
• Neues Profil: großer Name und Avatar, Statistik-Kacheln und Wertungsdiagramm
|
||||||
|
• Neue schwebende Navigationsleiste
|
||||||
|
• Neue Schriften: Unbounded für Überschriften, Manrope für Text
|
||||||
|
• Spielerkarten und eine Uhr in Limette im Partiebildschirm
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
• New look: dark theme with neon green and lime accents
|
||||||
|
• Redesigned home screen: big mode cards, Continue game right next to them, progress panel with rating, games, wins and streak
|
||||||
|
• Redesigned profile: large name and avatar, stat tiles and rating chart
|
||||||
|
• New floating bottom bar
|
||||||
|
• New fonts: Unbounded for headings, Manrope for text
|
||||||
|
• Player cards and a lime clock on the game screen
|
||||||
|
After Width: | Height: | Size: 314 KiB |
|
Before Width: | Height: | Size: 756 KiB After Width: | Height: | Size: 714 KiB |
|
Before Width: | Height: | Size: 783 KiB After Width: | Height: | Size: 783 KiB |
|
Before Width: | Height: | Size: 942 KiB After Width: | Height: | Size: 600 KiB |
|
Before Width: | Height: | Size: 832 KiB |
@@ -0,0 +1,6 @@
|
|||||||
|
• 新しいデザイン:ネオングリーンとライムを差し色にしたダークテーマ
|
||||||
|
• ホーム画面を刷新:大きなモードカード、そのすぐ横に「対局を再開」、レーティング・対局数・勝利・連勝を表示する進捗パネル
|
||||||
|
• プロフィールを刷新:大きな名前とアバター、統計タイル、レーティンググラフ
|
||||||
|
• 新しいフローティングナビゲーションバー
|
||||||
|
• 新しいフォント:見出しは Unbounded、本文は Manrope
|
||||||
|
• 対局画面にプレイヤーカードとライム色の時計
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
• Nauja išvaizda: tamsi tema su neoninės žalios ir laimo spalvos akcentais
|
||||||
|
• Naujas pagrindinis ekranas: didelės režimų kortelės, „Tęsti partiją“ šalia jų, pažangos skydelis su reitingu, partijomis, pergalėmis ir serija
|
||||||
|
• Naujas profilis: didelis vardas ir avataras, statistikos plytelės ir reitingo grafikas
|
||||||
|
• Nauja plaukiojanti apatinė juosta
|
||||||
|
• Nauji šriftai: „Unbounded“ antraštėms, „Manrope“ tekstui
|
||||||
|
• Žaidėjų kortelės ir laimo spalvos laikrodis partijos ekrane
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
• Новый облик: тёмная тема с неоново-зелёными и лаймовыми акцентами
|
||||||
|
• Новый главный экран: крупные карточки режимов, «Продолжить партию» рядом с ними, панель прогресса с рейтингом, партиями, победами и серией
|
||||||
|
• Новый профиль: крупное имя и аватар, плитки статистики и график рейтинга
|
||||||
|
• Новое плавающее нижнее меню
|
||||||
|
• Новые шрифты: Unbounded для заголовков, Manrope для текста
|
||||||
|
• Карточки игроков и лаймовые часы на экране партии
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
• 全新外观:深色主题,搭配霓虹绿与青柠色点缀
|
||||||
|
• 重新设计的主页:大号模式卡片,旁边即是“继续对局”,进度面板显示等级分、对局数、胜局和连胜
|
||||||
|
• 重新设计的个人资料:大号名字和头像、统计卡片和等级分曲线
|
||||||
|
• 全新悬浮底部导航栏
|
||||||
|
• 新字体:标题使用 Unbounded,正文使用 Manrope
|
||||||
|
• 对局界面新增玩家卡片和青柠色计时器
|
||||||