diff --git a/app/src/main/java/cc/skysparkle/matewave/ui/components/AppBackground.kt b/app/src/main/java/cc/skysparkle/matewave/ui/components/AppBackground.kt
index 54d30a0..07d9718 100644
--- a/app/src/main/java/cc/skysparkle/matewave/ui/components/AppBackground.kt
+++ b/app/src/main/java/cc/skysparkle/matewave/ui/components/AppBackground.kt
@@ -1,39 +1,129 @@
package cc.skysparkle.matewave.ui.components
+import android.content.Context
+import android.graphics.BitmapFactory
+import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
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.asImageBitmap
+import androidx.compose.ui.layout.ContentScale
+import androidx.compose.ui.platform.LocalContext
+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.withContext
-/** Near-black backdrop with a faint neon glow at the top and a lime one at the bottom. */
+private object BackgroundAssetCache {
+ @Volatile private var bitmap: ImageBitmap? = null
+
+ fun cached(): ImageBitmap? = bitmap
+
+ fun load(context: Context): ImageBitmap? {
+ bitmap?.let { return it }
+ synchronized(this) {
+ bitmap?.let { return it }
+ val metrics = context.resources.displayMetrics
+ val target = maxOf(metrics.widthPixels, metrics.heightPixels).coerceAtLeast(1)
+
+ val bounds = BitmapFactory.Options().apply { inJustDecodeBounds = true }
+ BitmapFactory.decodeResource(context.resources, R.drawable.bg_forest, bounds)
+
+ var sample = 1
+ while (maxOf(bounds.outWidth, bounds.outHeight) / sample > target * 2) sample *= 2
+
+ val options = BitmapFactory.Options().apply {
+ inSampleSize = sample
+ inPreferredConfig = android.graphics.Bitmap.Config.RGB_565
+ }
+ val decoded = runCatching {
+ BitmapFactory.decodeResource(context.resources, R.drawable.bg_forest, options)
+ ?.asImageBitmap()
+ }.getOrNull()
+ bitmap = decoded
+ return decoded
+ }
+ }
+}
+
+/** Slight green cast so the grey mist matches the accent colours. */
+private val ForestTint = ColorFilter.colorMatrix(
+ 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() {
- Box(
- modifier = Modifier
- .fillMaxSize()
- .background(AppBackground)
- .drawWithCache {
- val top = Brush.radialGradient(
- colors = listOf(ChessGreen.copy(alpha = 0.16f), ChessGreen.copy(alpha = 0f)),
- center = Offset(size.width * 0.85f, size.height * 0.02f),
- radius = size.maxDimension * 0.55f
- )
- val bottom = Brush.radialGradient(
- colors = listOf(Lime.copy(alpha = 0.06f), Lime.copy(alpha = 0f)),
- center = Offset(0f, size.height),
- radius = size.maxDimension * 0.5f
- )
- onDrawBehind {
- drawRect(top)
- drawRect(bottom)
+ val context = LocalContext.current
+ var bitmap by remember { mutableStateOf(BackgroundAssetCache.cached()) }
+
+ LaunchedEffect(Unit) {
+ if (bitmap == null) {
+ bitmap = withContext(Dispatchers.IO) { BackgroundAssetCache.load(context) }
+ }
+ }
+
+ Box(modifier = Modifier.fillMaxSize().background(AppBackground)) {
+ bitmap?.let { image ->
+ Image(
+ bitmap = image,
+ contentDescription = null,
+ modifier = Modifier.fillMaxSize(),
+ 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)
+ }
}
- }
- )
+ )
+ }
}
diff --git a/app/src/main/java/cc/skysparkle/matewave/ui/components/WavePattern.kt b/app/src/main/java/cc/skysparkle/matewave/ui/components/WavePattern.kt
new file mode 100644
index 0000000..df72bfb
--- /dev/null
+++ b/app/src/main/java/cc/skysparkle/matewave/ui/components/WavePattern.kt
@@ -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)
+ }
+ }
+}
diff --git a/app/src/main/java/cc/skysparkle/matewave/ui/screens/AccountScreen.kt b/app/src/main/java/cc/skysparkle/matewave/ui/screens/AccountScreen.kt
index 3207afe..ca5026a 100644
--- a/app/src/main/java/cc/skysparkle/matewave/ui/screens/AccountScreen.kt
+++ b/app/src/main/java/cc/skysparkle/matewave/ui/screens/AccountScreen.kt
@@ -60,6 +60,7 @@ import cc.skysparkle.matewave.ui.components.ButtonIcon
import cc.skysparkle.matewave.ui.components.GlassButton
import cc.skysparkle.matewave.ui.components.GlassScaffold
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.theme.ChessGreen
import cc.skysparkle.matewave.ui.theme.PanelBorder
@@ -355,7 +356,7 @@ private fun ProfileHero(
0.6f to Surface1.copy(alpha = 0.6f),
1.0f to Surface1.copy(alpha = 0.95f)
)
- )
+ ).wavePattern(ChessGreen.copy(alpha = 0.12f))
)
Box(
@@ -411,7 +412,7 @@ private fun ProfileHero(
Text(
profile.name,
color = ink,
- style = MaterialTheme.typography.displaySmall,
+ style = MaterialTheme.typography.headlineLarge,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f, fill = false)
diff --git a/app/src/main/java/cc/skysparkle/matewave/ui/screens/GameScreen.kt b/app/src/main/java/cc/skysparkle/matewave/ui/screens/GameScreen.kt
index 9f64e4f..14e390f 100644
--- a/app/src/main/java/cc/skysparkle/matewave/ui/screens/GameScreen.kt
+++ b/app/src/main/java/cc/skysparkle/matewave/ui/screens/GameScreen.kt
@@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.padding
import cc.skysparkle.matewave.ui.theme.ink
import androidx.compose.foundation.background
+import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@@ -461,15 +462,26 @@ private fun PlayerRow(
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(
modifier = Modifier
- .size(8.dp)
+ .size(40.dp)
.clip(CircleShape)
- .background(if (active) ChessGreen else ink.copy(alpha = 0.15f))
- )
- Spacer(Modifier.width(10.dp))
- AvatarCircle(base64 = avatar, size = 34.dp)
+ .background(if (active) ChessGreen else Color.Transparent),
+ contentAlignment = Alignment.Center
+ ) {
+ AvatarCircle(base64 = avatar, size = 36.dp)
+ }
Spacer(Modifier.width(10.dp))
Column(modifier = Modifier.weight(1f)) {
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp)) {
@@ -514,21 +526,27 @@ internal fun BigClock(millis: Long, active: Boolean) {
active -> ink
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(
modifier = Modifier
- .clip(RoundedCornerShape(10.dp))
- .background(if (active) ink.copy(alpha = 0.12f) else Color.Transparent)
- .padding(horizontal = 12.dp, vertical = 6.dp),
+ .clip(RoundedCornerShape(50))
+ .background(fill)
+ .padding(horizontal = 14.dp, vertical = 6.dp),
contentAlignment = Alignment.Center
) {
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 {
Text(
"%d:%02d".format(totalSeconds / 60, totalSeconds % 60),
- color = color,
- style = MaterialTheme.typography.headlineSmall,
- fontWeight = androidx.compose.ui.text.font.FontWeight.SemiBold
+ color = textColor,
+ style = MaterialTheme.typography.titleLarge.copy(fontFeatureSettings = "tnum")
)
}
}
diff --git a/app/src/main/java/cc/skysparkle/matewave/ui/screens/LicensesScreen.kt b/app/src/main/java/cc/skysparkle/matewave/ui/screens/LicensesScreen.kt
index 285997b..192a587 100644
--- a/app/src/main/java/cc/skysparkle/matewave/ui/screens/LicensesScreen.kt
+++ b/app/src/main/java/cc/skysparkle/matewave/ui/screens/LicensesScreen.kt
@@ -45,6 +45,7 @@ private data class LicenseEntry(
)
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 val LIBRARIES = listOf(
@@ -109,6 +110,14 @@ private val ASSETS = listOf(
LicenseEntry(
"Vector Chess Pieces", "RhosGFX", null, "CC0 1.0",
"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) {
val context = LocalContext.current
var showApache by remember { mutableStateOf(false) }
+ var showOfl by remember { mutableStateOf(false) }
GlassScaffold(title = stringResource(R.string.licenses_title), onBack = onBack) {
Text(
@@ -143,6 +153,10 @@ fun LicensesScreen(onBack: () -> Unit) {
SetupSectionLabel(stringResource(R.string.licenses_group_assets))
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))
Text(
@@ -154,7 +168,10 @@ fun LicensesScreen(onBack: () -> Unit) {
}
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
-private fun ApacheLicenseDialog(onDismiss: () -> Unit) {
+private fun LicenseTextDialog(title: String, rawRes: Int, fallbackUrl: String, onDismiss: () -> Unit) {
val context = LocalContext.current
- val text = remember {
+ val text = remember(rawRes) {
runCatching {
- context.resources.openRawResource(R.raw.license_apache_2_0)
+ context.resources.openRawResource(rawRes)
.bufferedReader().use { it.readText() }
- }.getOrDefault("https://www.apache.org/licenses/LICENSE-2.0")
+ }.getOrDefault(fallbackUrl)
.trim()
.split(Regex("\n\\s*\n"))
.joinToString("\n\n") { paragraph -> paragraph.lines().joinToString(" ") { it.trim() } }
}
AppDialog(
onDismissRequest = onDismiss,
- title = APACHE,
+ title = title,
actions = { DialogAction(stringResource(R.string.chat_close), onDismiss) }
) {
Column(modifier = Modifier.fillMaxWidth().heightIn(max = 380.dp).verticalScroll(rememberScrollState())) {
diff --git a/app/src/main/java/cc/skysparkle/matewave/ui/screens/MainMenuScreen.kt b/app/src/main/java/cc/skysparkle/matewave/ui/screens/MainMenuScreen.kt
index bebd514..60ce830 100644
--- a/app/src/main/java/cc/skysparkle/matewave/ui/screens/MainMenuScreen.kt
+++ b/app/src/main/java/cc/skysparkle/matewave/ui/screens/MainMenuScreen.kt
@@ -48,6 +48,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
import cc.skysparkle.matewave.R
import cc.skysparkle.matewave.stats.Stats
import cc.skysparkle.matewave.ui.components.AppBottomBar
@@ -58,6 +59,7 @@ 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.GlassShape
import cc.skysparkle.matewave.ui.theme.HeroTextStyle
@@ -106,7 +108,7 @@ fun MainMenuScreen(
verticalAlignment = Alignment.CenterVertically
) {
Box(
- modifier = Modifier.size(44.dp).clip(CircleShape).background(Surface2),
+ modifier = Modifier.size(44.dp).clip(CircleShape).background(ChessGreen),
contentAlignment = Alignment.Center
) {
Image(
@@ -115,6 +117,13 @@ fun MainMenuScreen(
modifier = Modifier.size(width = 20.dp, height = 29.dp)
)
}
+ Spacer(Modifier.width(10.dp))
+ Text(
+ "matewave",
+ color = ink,
+ 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(
@@ -142,7 +151,7 @@ fun MainMenuScreen(
Hero()
Row(
- modifier = Modifier.fillMaxWidth().height(250.dp),
+ modifier = Modifier.fillMaxWidth().height(268.dp),
horizontalArrangement = Arrangement.spacedBy(12.dp)
) {
AiCard(
@@ -238,7 +247,7 @@ private fun Hero() {
else -> stringResource(R.string.greeting_night)
}
Box(modifier = Modifier.fillMaxWidth().padding(top = 8.dp)) {
- Column(modifier = Modifier.padding(end = 92.dp)) {
+ Column(modifier = Modifier.padding(end = 76.dp)) {
Text("$greeting 👋", color = ink.copy(alpha = 0.6f), style = MaterialTheme.typography.bodyLarge)
Spacer(Modifier.height(2.dp))
Text(
@@ -254,7 +263,7 @@ private fun Hero() {
contentDescription = null,
modifier = Modifier
.align(Alignment.CenterEnd)
- .size(96.dp)
+ .size(88.dp)
.rotate(-14f)
)
}
@@ -267,6 +276,7 @@ private fun AiCard(subtitle: String, modifier: Modifier = Modifier, onClick: ()
modifier = modifier
.clip(GlassShape)
.background(ChessGreen)
+ .wavePattern(OnAccent.copy(alpha = 0.16f))
.clickable(onClick = onClick)
) {
Image(
@@ -284,23 +294,18 @@ private fun AiCard(subtitle: String, modifier: Modifier = Modifier, onClick: ()
Text(
stringResource(R.string.mode_ai_title),
color = OnAccent,
- style = MaterialTheme.typography.headlineSmall,
+ style = MaterialTheme.typography.headlineSmall.copy(fontSize = 19.sp, lineHeight = 24.sp),
maxLines = 2,
overflow = TextOverflow.Ellipsis
)
Spacer(Modifier.height(4.dp))
- Row(verticalAlignment = Alignment.CenterVertically) {
- Text(
- subtitle,
- color = OnAccent.copy(alpha = 0.7f),
- style = MaterialTheme.typography.bodySmall,
- maxLines = 2,
- overflow = TextOverflow.Ellipsis,
- modifier = Modifier.weight(1f)
- )
- Spacer(Modifier.width(8.dp))
- ArrowBubble(fill = OnAccent, tint = ChessGreen)
- }
+ Text(
+ subtitle,
+ color = OnAccent.copy(alpha = 0.7f),
+ style = MaterialTheme.typography.bodySmall,
+ maxLines = 2,
+ overflow = TextOverflow.Ellipsis
+ )
}
}
}
@@ -332,7 +337,7 @@ private fun SmallModeCard(
ArrowBubble(fill = Surface2, tint = ink)
}
Spacer(Modifier.weight(1f))
- Text(title, color = ink, style = MaterialTheme.typography.titleMedium, maxLines = 1, overflow = TextOverflow.Ellipsis)
+ 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)
}
}
@@ -368,7 +373,7 @@ private fun ContinueCard(info: ResumeInfo, modifier: Modifier = Modifier, onClic
stringResource(R.string.continue_game_title),
color = OnAccent,
style = MaterialTheme.typography.titleMedium,
- maxLines = 1,
+ maxLines = 2,
overflow = TextOverflow.Ellipsis
)
Text(details, color = OnAccent.copy(alpha = 0.7f), style = MaterialTheme.typography.bodySmall, maxLines = 1, overflow = TextOverflow.Ellipsis)
@@ -399,7 +404,7 @@ private fun LearnCard(
.height(148.dp)
.clip(GlassShape)
.background(Surface1)
- .border(1.dp, if (highlighted) Lime.copy(alpha = 0.7f) else PanelBorder, GlassShape)
+ .border(1.dp, if (highlighted) ChessGreen.copy(alpha = 0.7f) else PanelBorder, GlassShape)
.clickable(onClick = onClick)
.padding(14.dp)
) {
@@ -407,7 +412,7 @@ private fun LearnCard(
modifier = Modifier
.size(40.dp)
.clip(RoundedCornerShape(14.dp))
- .background(if (highlighted) Lime else Surface2),
+ .background(if (highlighted) ChessGreen else Surface2),
contentAlignment = Alignment.Center
) {
AppIcon(iconRes, size = 22.dp, tint = if (highlighted) OnAccent else ChessGreen)
diff --git a/app/src/main/java/cc/skysparkle/matewave/ui/screens/SpectatorScreen.kt b/app/src/main/java/cc/skysparkle/matewave/ui/screens/SpectatorScreen.kt
index 579fe98..2588f02 100644
--- a/app/src/main/java/cc/skysparkle/matewave/ui/screens/SpectatorScreen.kt
+++ b/app/src/main/java/cc/skysparkle/matewave/ui/screens/SpectatorScreen.kt
@@ -1,6 +1,7 @@
package cc.skysparkle.matewave.ui.screens
import androidx.compose.foundation.background
+import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@@ -223,15 +224,25 @@ private fun SpectatorPlayerRow(
val avatar = remember(player.id) {
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(
modifier = Modifier
- .size(8.dp)
+ .size(40.dp)
.clip(CircleShape)
- .background(if (active) ChessGreen else ink.copy(alpha = 0.15f))
- )
- Spacer(Modifier.width(10.dp))
- AvatarCircle(base64 = avatar, size = 34.dp)
+ .background(if (active) ChessGreen else androidx.compose.ui.graphics.Color.Transparent),
+ contentAlignment = Alignment.Center
+ ) {
+ AvatarCircle(base64 = avatar, size = 36.dp)
+ }
Spacer(Modifier.width(10.dp))
Column(modifier = Modifier.weight(1f)) {
Text(
diff --git a/app/src/main/java/cc/skysparkle/matewave/ui/theme/Theme.kt b/app/src/main/java/cc/skysparkle/matewave/ui/theme/Theme.kt
index 3e686e3..6e27a7b 100644
--- a/app/src/main/java/cc/skysparkle/matewave/ui/theme/Theme.kt
+++ b/app/src/main/java/cc/skysparkle/matewave/ui/theme/Theme.kt
@@ -9,7 +9,10 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
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. */
@@ -41,33 +44,52 @@ private val DarkScheme = darkColorScheme(
surfaceVariant = Surface2
)
-private val base = Typography()
-
-/** Heavy, tightly set headings like the mockups; body text stays the system default. */
-private val AppTypography = Typography(
- displayLarge = base.displayLarge.copy(fontWeight = FontWeight.ExtraBold, letterSpacing = (-1.5).sp),
- displayMedium = base.displayMedium.copy(fontWeight = FontWeight.ExtraBold, letterSpacing = (-1.2).sp),
- displaySmall = base.displaySmall.copy(fontWeight = FontWeight.ExtraBold, letterSpacing = (-0.8).sp),
- headlineLarge = base.headlineLarge.copy(fontWeight = FontWeight.Bold, letterSpacing = (-0.6).sp),
- headlineMedium = base.headlineMedium.copy(fontWeight = FontWeight.Bold, letterSpacing = (-0.5).sp),
- headlineSmall = base.headlineSmall.copy(fontWeight = FontWeight.Bold, letterSpacing = (-0.3).sp),
- titleLarge = base.titleLarge.copy(fontWeight = FontWeight.Bold, letterSpacing = (-0.2).sp),
- titleMedium = base.titleMedium.copy(fontWeight = FontWeight.SemiBold),
- titleSmall = base.titleSmall.copy(fontWeight = FontWeight.SemiBold),
- bodyLarge = base.bodyLarge,
- bodyMedium = base.bodyMedium,
- bodySmall = base.bodySmall,
- labelLarge = base.labelLarge.copy(fontWeight = FontWeight.SemiBold),
- labelMedium = base.labelMedium.copy(fontWeight = FontWeight.SemiBold, letterSpacing = 0.6.sp),
- labelSmall = base.labelSmall.copy(fontWeight = FontWeight.Medium)
+/** 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)
)
-/** Large hero heading on the home and profile screens. */
+/** 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(
- fontSize = 52.sp,
- lineHeight = 52.sp,
+ fontFamily = DisplayFont,
+ fontSize = 46.sp,
+ lineHeight = 50.sp,
fontWeight = FontWeight.ExtraBold,
- letterSpacing = (-2).sp
+ letterSpacing = (-1.5).sp
)
/** The app has a single dark theme; system bars are set up in MainActivity. */
diff --git a/app/src/main/res/drawable-nodpi/bg_forest.jpg b/app/src/main/res/drawable-nodpi/bg_forest.jpg
new file mode 100644
index 0000000..07fa3ed
Binary files /dev/null and b/app/src/main/res/drawable-nodpi/bg_forest.jpg differ
diff --git a/app/src/main/res/font/manrope_bold.ttf b/app/src/main/res/font/manrope_bold.ttf
new file mode 100644
index 0000000..c34d1ce
Binary files /dev/null and b/app/src/main/res/font/manrope_bold.ttf differ
diff --git a/app/src/main/res/font/manrope_medium.ttf b/app/src/main/res/font/manrope_medium.ttf
new file mode 100644
index 0000000..495bd12
Binary files /dev/null and b/app/src/main/res/font/manrope_medium.ttf differ
diff --git a/app/src/main/res/font/manrope_regular.ttf b/app/src/main/res/font/manrope_regular.ttf
new file mode 100644
index 0000000..cf8e91d
Binary files /dev/null and b/app/src/main/res/font/manrope_regular.ttf differ
diff --git a/app/src/main/res/font/manrope_semibold.ttf b/app/src/main/res/font/manrope_semibold.ttf
new file mode 100644
index 0000000..ff96210
Binary files /dev/null and b/app/src/main/res/font/manrope_semibold.ttf differ
diff --git a/app/src/main/res/font/unbounded_extrabold.ttf b/app/src/main/res/font/unbounded_extrabold.ttf
new file mode 100644
index 0000000..ef33c73
Binary files /dev/null and b/app/src/main/res/font/unbounded_extrabold.ttf differ
diff --git a/app/src/main/res/font/unbounded_semibold.ttf b/app/src/main/res/font/unbounded_semibold.ttf
new file mode 100644
index 0000000..ac38594
Binary files /dev/null and b/app/src/main/res/font/unbounded_semibold.ttf differ
diff --git a/app/src/main/res/raw/license_ofl_1_1.txt b/app/src/main/res/raw/license_ofl_1_1.txt
new file mode 100644
index 0000000..00776b9
--- /dev/null
+++ b/app/src/main/res/raw/license_ofl_1_1.txt
@@ -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.
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index f0669d8..4968c2e 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -171,6 +171,8 @@
Daten
Radio
Vollständiger Text der Apache License 2.0
+ Vollständiger Text der SIL Open Font License 1.1
+ Schriften der Oberfläche: Unbounded für Überschriften, Manrope für Text.
Die Aufgaben stammen aus der offenen Lichess-Puzzle-Datenbank. Die CC0-Lizenz verlangt keine Namensnennung – wir danken dem Lichess-Team.
Ö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.
Das Jazzradio in den Einstellungen spielt nur Radio Swiss Jazz; ist einer der offiziellen Stream-Links nicht erreichbar, nutzt die App einen anderen.
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 8eb89c4..78b77f0 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -171,6 +171,8 @@
データ
ラジオ
Apache License 2.0 の全文
+ SIL Open Font License 1.1 の全文
+ インターフェースのフォント:見出しは Unbounded、本文は Manrope。
パズルは Lichess のオープンなパズルデータベースから選んでいます。CC0 ライセンスでは表示義務はありませんが、Lichess チームに感謝します。
SRG SSR が公開しているインターネットストリームです。広告もナビゲーターもなく、受信料で運営されています。音楽の権利は放送局と権利者に帰属し、アプリは再生するだけで何も保存しません。
設定のジャズラジオは Radio Swiss Jazz だけを再生します。公式リンクのひとつがつながらないときは、別のリンクに切り替わります。
diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml
index 34b99ba..a8cdb4b 100644
--- a/app/src/main/res/values-lt/strings.xml
+++ b/app/src/main/res/values-lt/strings.xml
@@ -171,6 +171,8 @@
Duomenys
Radijas
Pilnas Apache License 2.0 tekstas
+ Pilnas SIL Open Font License 1.1 tekstas
+ Sąsajos šriftai: „Unbounded“ antraštėms, „Manrope“ tekstui.
Užduotys atrinktos iš atviros „Lichess“ galvosūkių duomenų bazės. CC0 licencija nereikalauja nurodyti autorystės – dėkojame „Lichess“ komandai.
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.
Nustatymuose esantis džiazo radijas groja tik „Radio Swiss Jazz“; jei viena oficiali nuoroda nepasiekiama, programa naudoja kitą.
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 1ae6e01..20656fa 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -177,6 +177,8 @@
Данные
Радио
Полный текст Apache License 2.0
+ Полный текст SIL Open Font License 1.1
+ Шрифты интерфейса: Unbounded для заголовков, Manrope для текста.
Тактические задачи отобраны из открытой базы Lichess. Лицензия CC0 не требует указания авторства — мы благодарим команду Lichess.
Общедоступный интернет-поток SRG SSR: без рекламы и без ведущих, финансируется лицензионными сборами. Права на музыку принадлежат вещателю и правообладателям; приложение только воспроизводит поток и ничего не сохраняет.
Джаз-радио в настройках играет только Radio Swiss Jazz; если одна из его официальных ссылок недоступна, приложение берёт другую.
diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml
index 6b2e2a5..a788dc6 100644
--- a/app/src/main/res/values-zh/strings.xml
+++ b/app/src/main/res/values-zh/strings.xml
@@ -171,6 +171,8 @@
数据
电台
Apache License 2.0 全文
+ SIL Open Font License 1.1 全文
+ 界面字体:标题使用 Unbounded,正文使用 Manrope。
题目选自 Lichess 开放的谜题数据库。CC0 许可证无需署名,在此感谢 Lichess 团队。
SRG SSR 公开提供的网络电台流:无广告、无主持人,由收视费资助。音乐版权归电台和权利人所有,应用只播放,不保存任何内容。
设置中的爵士电台只播放 Radio Swiss Jazz;其中一个官方地址不可用时,应用会改用另一个。
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index a51c706..e224d35 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -171,6 +171,8 @@
Data
Radio
Full text of the Apache License 2.0
+ Full text of the SIL Open Font License 1.1
+ Typeface of the interface: Unbounded for headings, Manrope for text.
Puzzles are selected from the open Lichess puzzle database. The CC0 license does not require attribution — we thank the Lichess team.
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.
The jazz radio in Settings plays only Radio Swiss Jazz; if one of its official stream links is unavailable, the app uses another.
diff --git a/fastlane/metadata/android/de-DE/changelogs/9.txt b/fastlane/metadata/android/de-DE/changelogs/9.txt
index 5fceaae..d7d34f6 100644
--- a/fastlane/metadata/android/de-DE/changelogs/9.txt
+++ b/fastlane/metadata/android/de-DE/changelogs/9.txt
@@ -2,3 +2,5 @@
• 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
diff --git a/fastlane/metadata/android/en-US/changelogs/9.txt b/fastlane/metadata/android/en-US/changelogs/9.txt
index e164fc2..53371cb 100644
--- a/fastlane/metadata/android/en-US/changelogs/9.txt
+++ b/fastlane/metadata/android/en-US/changelogs/9.txt
@@ -2,3 +2,5 @@
• 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
diff --git a/fastlane/metadata/android/ja-JP/changelogs/9.txt b/fastlane/metadata/android/ja-JP/changelogs/9.txt
index 650c093..7033a18 100644
--- a/fastlane/metadata/android/ja-JP/changelogs/9.txt
+++ b/fastlane/metadata/android/ja-JP/changelogs/9.txt
@@ -2,3 +2,5 @@
• ホーム画面を刷新:大きなモードカード、そのすぐ横に「対局を再開」、レーティング・対局数・勝利・連勝を表示する進捗パネル
• プロフィールを刷新:大きな名前とアバター、統計タイル、レーティンググラフ
• 新しいフローティングナビゲーションバー
+• 新しいフォント:見出しは Unbounded、本文は Manrope
+• 対局画面にプレイヤーカードとライム色の時計
diff --git a/fastlane/metadata/android/lt/changelogs/9.txt b/fastlane/metadata/android/lt/changelogs/9.txt
index c05463a..9f49da7 100644
--- a/fastlane/metadata/android/lt/changelogs/9.txt
+++ b/fastlane/metadata/android/lt/changelogs/9.txt
@@ -2,3 +2,5 @@
• 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
diff --git a/fastlane/metadata/android/ru-RU/changelogs/9.txt b/fastlane/metadata/android/ru-RU/changelogs/9.txt
index 999397a..64bcf82 100644
--- a/fastlane/metadata/android/ru-RU/changelogs/9.txt
+++ b/fastlane/metadata/android/ru-RU/changelogs/9.txt
@@ -2,3 +2,5 @@
• Новый главный экран: крупные карточки режимов, «Продолжить партию» рядом с ними, панель прогресса с рейтингом, партиями, победами и серией
• Новый профиль: крупное имя и аватар, плитки статистики и график рейтинга
• Новое плавающее нижнее меню
+• Новые шрифты: Unbounded для заголовков, Manrope для текста
+• Карточки игроков и лаймовые часы на экране партии
diff --git a/fastlane/metadata/android/zh-CN/changelogs/9.txt b/fastlane/metadata/android/zh-CN/changelogs/9.txt
index 286c101..e07daae 100644
--- a/fastlane/metadata/android/zh-CN/changelogs/9.txt
+++ b/fastlane/metadata/android/zh-CN/changelogs/9.txt
@@ -2,3 +2,5 @@
• 重新设计的主页:大号模式卡片,旁边即是“继续对局”,进度面板显示等级分、对局数、胜局和连胜
• 重新设计的个人资料:大号名字和头像、统计卡片和等级分曲线
• 全新悬浮底部导航栏
+• 新字体:标题使用 Unbounded,正文使用 Manrope
+• 对局界面新增玩家卡片和青柠色计时器