Skip to content

Commit

Permalink
chore: final touches adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
yamilmedina committed Aug 30, 2024
1 parent e192760 commit 83541cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import com.wire.android.model.UserAvatarData
import com.wire.android.ui.home.conversationslist.model.Membership
import com.wire.android.ui.theme.Accent
import com.wire.android.ui.theme.WireTheme
import com.wire.android.ui.theme.nonScaledSp
import com.wire.android.ui.theme.wireColorScheme
import com.wire.android.ui.theme.wireDimensions
import com.wire.android.util.ui.PreviewMultipleThemes
Expand Down Expand Up @@ -209,7 +210,7 @@ private fun DefaultInitialsAvatar(
textAlign = TextAlign.Center,
style = MaterialTheme.typography.titleLarge,
maxLines = 1,
fontSize = size.value.sp / 3
fontSize =( size.value.sp / 3).nonScaledSp
)
}
}
Expand Down Expand Up @@ -404,7 +405,7 @@ fun PreviewUserProfileAvatarWithInitialsBig() {
}
}

@Preview(fontScale = 1f)
@Preview(fontScale = 3f)
@Composable
fun PreviewUserProfileAvatarSmallest() {
WireTheme {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@
package com.wire.android.ui.theme

import androidx.compose.material3.Typography
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.sp
import io.github.esentsov.PackagePrivate

@Immutable
Expand Down Expand Up @@ -75,3 +79,7 @@ val WireTypographyTypes: ScreenSizeDependent<WireTypography> = ScreenSizeDepende
tablet7 = DefaultWireTypography,
tablet10 = DefaultWireTypography
)

val TextUnit.nonScaledSp
@Composable
get() = (this.value / LocalDensity.current.fontScale).sp

0 comments on commit 83541cd

Please sign in to comment.