mirror of
https://github.com/andwati/ledga.git
synced 2026-10-18 03:12:55 +00:00
v1.3.1 hotfix: status-bar overlap + font fallback
- LedgaTopBar now applies WindowInsets.statusBars padding. Previously enableEdgeToEdge was on but the top bar drew at y=0, so the avatar and trailing icons sat under the system clock / WiFi indicator. - PillTabBar uses WindowInsets.navigationBars padding instead of a hardcoded 21dp bottom so the floating pill sits above the system gesture pill on devices like the S24 Ultra. - Typography switched from Google-Fonts Inter to FontFamily.SansSerif. Inter requires a downloadable-fonts round-trip via Google Play Services that doesn't always succeed; the fallback was hitting FontFamily.Default, which inherits the user's system font choice — on Samsung One UI that's frequently a handwritten / script style and broke the type rhythm everywhere. SansSerif uses the platform sans (One UI Sans on Galaxy, Roboto elsewhere) regardless of user preference.
This commit is contained in:
@@ -27,8 +27,8 @@ android {
|
||||
applicationId = "com.ledga.app"
|
||||
minSdk = 26
|
||||
targetSdk = 34
|
||||
versionCode = 3
|
||||
versionName = "1.3.0"
|
||||
versionCode = 4
|
||||
versionName = "1.3.1"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -9,10 +9,13 @@ import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.navigationBars
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.windowInsetsPadding
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
@@ -59,7 +62,9 @@ fun PillTabBar(
|
||||
Box(
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.padding(PaddingValues(start = 21.dp, end = 21.dp, top = 12.dp, bottom = 21.dp)),
|
||||
// Sit above the navigation bar / gesture pill, never under it.
|
||||
.windowInsetsPadding(WindowInsets.navigationBars)
|
||||
.padding(PaddingValues(start = 21.dp, end = 21.dp, top = 12.dp, bottom = 12.dp)),
|
||||
) {
|
||||
Surface(
|
||||
modifier = Modifier
|
||||
|
||||
@@ -7,10 +7,13 @@ import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.statusBars
|
||||
import androidx.compose.foundation.layout.windowInsetsPadding
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
@@ -51,6 +54,9 @@ fun LedgaTopBar(
|
||||
Row(
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
// Push below the status bar — MainActivity uses enableEdgeToEdge,
|
||||
// so without this the avatar + actions sit under the system clock.
|
||||
.windowInsetsPadding(WindowInsets.statusBars)
|
||||
.height(64.dp)
|
||||
.padding(horizontal = Space.Screen),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
|
||||
@@ -4,94 +4,86 @@ import androidx.compose.material3.Typography
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.googlefonts.Font
|
||||
import androidx.compose.ui.text.googlefonts.GoogleFont
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.ledga.app.R
|
||||
|
||||
// =====================================================================
|
||||
// Ledga v2 type scale — LEDGA_REDESIGN.md §1.4
|
||||
// Font: Inter (via Google Fonts). Numbers should use tnum where shown.
|
||||
//
|
||||
// We use [FontFamily.SansSerif] (the platform's sans-serif font — Roboto
|
||||
// on AOSP, Samsung One UI Sans on Galaxy, etc.) deliberately over
|
||||
// FontFamily.Default. Default inherits the user's system font preference,
|
||||
// which on some devices (Samsung One UI) is a handwritten / script style
|
||||
// that breaks our type rhythm.
|
||||
//
|
||||
// A future patch can switch back to Inter via downloadable fonts or a
|
||||
// bundled TTF; for now reliability > Inter-pixel-fidelity.
|
||||
// =====================================================================
|
||||
|
||||
private val GoogleFontsProvider = GoogleFont.Provider(
|
||||
providerAuthority = "com.google.android.gms.fonts",
|
||||
providerPackage = "com.google.android.gms",
|
||||
certificates = R.array.com_google_android_gms_fonts_certs,
|
||||
)
|
||||
|
||||
private val InterFont = GoogleFont("Inter")
|
||||
|
||||
private val Inter = FontFamily(
|
||||
Font(googleFont = InterFont, fontProvider = GoogleFontsProvider, weight = FontWeight.Normal),
|
||||
Font(googleFont = InterFont, fontProvider = GoogleFontsProvider, weight = FontWeight.Medium),
|
||||
Font(googleFont = InterFont, fontProvider = GoogleFontsProvider, weight = FontWeight.SemiBold),
|
||||
Font(googleFont = InterFont, fontProvider = GoogleFontsProvider, weight = FontWeight.Bold),
|
||||
)
|
||||
private val LedgaFont = FontFamily.SansSerif
|
||||
|
||||
object LedgaText {
|
||||
val DisplayXL = TextStyle(
|
||||
fontFamily = Inter,
|
||||
fontFamily = LedgaFont,
|
||||
fontSize = 56.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
lineHeight = 58.8.sp,
|
||||
letterSpacing = (-1.5).sp,
|
||||
)
|
||||
val DisplayL = TextStyle(
|
||||
fontFamily = Inter,
|
||||
fontFamily = LedgaFont,
|
||||
fontSize = 44.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
lineHeight = 46.2.sp,
|
||||
letterSpacing = (-1).sp,
|
||||
)
|
||||
val DisplayM = TextStyle(
|
||||
fontFamily = Inter,
|
||||
fontFamily = LedgaFont,
|
||||
fontSize = 32.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
lineHeight = 35.2.sp,
|
||||
letterSpacing = (-0.5).sp,
|
||||
)
|
||||
val TitleL = TextStyle(
|
||||
fontFamily = Inter,
|
||||
fontFamily = LedgaFont,
|
||||
fontSize = 24.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
lineHeight = 28.8.sp,
|
||||
letterSpacing = (-0.2).sp,
|
||||
)
|
||||
val TitleM = TextStyle(
|
||||
fontFamily = Inter,
|
||||
fontFamily = LedgaFont,
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
lineHeight = 25.sp,
|
||||
letterSpacing = (-0.1).sp,
|
||||
)
|
||||
val TitleS = TextStyle(
|
||||
fontFamily = Inter,
|
||||
fontFamily = LedgaFont,
|
||||
fontSize = 17.sp,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
lineHeight = 22.1.sp,
|
||||
)
|
||||
val BodyL = TextStyle(
|
||||
fontFamily = Inter,
|
||||
fontFamily = LedgaFont,
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
lineHeight = 22.4.sp,
|
||||
)
|
||||
val BodyM = TextStyle(
|
||||
fontFamily = Inter,
|
||||
fontFamily = LedgaFont,
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
lineHeight = 19.6.sp,
|
||||
)
|
||||
val Caption = TextStyle(
|
||||
fontFamily = Inter,
|
||||
fontFamily = LedgaFont,
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
lineHeight = 15.6.sp,
|
||||
letterSpacing = 0.1.sp,
|
||||
)
|
||||
val Overline = TextStyle(
|
||||
fontFamily = Inter,
|
||||
fontFamily = LedgaFont,
|
||||
fontSize = 11.sp,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
lineHeight = 14.3.sp,
|
||||
|
||||
Reference in New Issue
Block a user