mirror of
				https://github.com/oxen-io/session-android.git
				synced 2025-10-31 07:21:41 +00:00 
			
		
		
		
	Updated typography
Updated the typography in an composition local so it can be accessed from anyehere in compose and matching the figma declarations.
This commit is contained in:
		| @@ -25,8 +25,8 @@ import org.thoughtcrime.securesms.ui.RadioOption | |||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
| import org.thoughtcrime.securesms.ui.components.SlimOutlineButton | import org.thoughtcrime.securesms.ui.components.SlimOutlineButton | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
| import org.thoughtcrime.securesms.ui.theme.extraSmall |  | ||||||
| import org.thoughtcrime.securesms.ui.fadingEdges | import org.thoughtcrime.securesms.ui.fadingEdges | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
|  |  | ||||||
| typealias ExpiryCallbacks = Callbacks<ExpiryMode> | typealias ExpiryCallbacks = Callbacks<ExpiryMode> | ||||||
| typealias ExpiryRadioOption = RadioOption<ExpiryMode> | typealias ExpiryRadioOption = RadioOption<ExpiryMode> | ||||||
| @@ -54,7 +54,7 @@ fun DisappearingMessages( | |||||||
|  |  | ||||||
|                 if (state.showGroupFooter) Text( |                 if (state.showGroupFooter) Text( | ||||||
|                     text = stringResource(R.string.activity_disappearing_messages_group_footer), |                     text = stringResource(R.string.activity_disappearing_messages_group_footer), | ||||||
|                     style = extraSmall, |                     style = LocalType.current.extraSmall, | ||||||
|                     fontWeight = FontWeight(400), |                     fontWeight = FontWeight(400), | ||||||
|                     color = LocalColors.current.textSecondary, |                     color = LocalColors.current.textSecondary, | ||||||
|                     textAlign = TextAlign.Center, |                     textAlign = TextAlign.Center, | ||||||
|   | |||||||
| @@ -29,8 +29,7 @@ import org.thoughtcrime.securesms.ui.theme.LocalColors | |||||||
| import org.thoughtcrime.securesms.ui.components.AppBar | import org.thoughtcrime.securesms.ui.components.AppBar | ||||||
| import org.thoughtcrime.securesms.ui.components.QrImage | import org.thoughtcrime.securesms.ui.components.QrImage | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
| import org.thoughtcrime.securesms.ui.theme.small | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.xl |  | ||||||
|  |  | ||||||
| @Composable | @Composable | ||||||
| internal fun StartConversationScreen( | internal fun StartConversationScreen( | ||||||
| @@ -78,12 +77,12 @@ internal fun StartConversationScreen( | |||||||
|                         .padding(top = LocalDimensions.current.itemSpacing) |                         .padding(top = LocalDimensions.current.itemSpacing) | ||||||
|                         .padding(bottom = LocalDimensions.current.margin) |                         .padding(bottom = LocalDimensions.current.margin) | ||||||
|                 ) { |                 ) { | ||||||
|                     Text(stringResource(R.string.accountIdYours), style = xl) |                     Text(stringResource(R.string.accountIdYours), style = LocalType.current.xl) | ||||||
|                     Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsItemSpacing)) |                     Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsItemSpacing)) | ||||||
|                     Text( |                     Text( | ||||||
|                         text = stringResource(R.string.qrYoursDescription), |                         text = stringResource(R.string.qrYoursDescription), | ||||||
|                         color = LocalColors.current.textSecondary, |                         color = LocalColors.current.textSecondary, | ||||||
|                         style = small |                         style = LocalType.current.small | ||||||
|                     ) |                     ) | ||||||
|                     Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing)) |                     Spacer(modifier = Modifier.height(LocalDimensions.current.smallItemSpacing)) | ||||||
|                     QrImage( |                     QrImage( | ||||||
|   | |||||||
| @@ -17,14 +17,13 @@ import androidx.compose.ui.tooling.preview.Preview | |||||||
| import network.loki.messenger.R | import network.loki.messenger.R | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.base |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
| import org.thoughtcrime.securesms.ui.components.AppBar | import org.thoughtcrime.securesms.ui.components.AppBar | ||||||
| import org.thoughtcrime.securesms.ui.components.SlimOutlineButton | import org.thoughtcrime.securesms.ui.components.SlimOutlineButton | ||||||
| import org.thoughtcrime.securesms.ui.components.SlimOutlineCopyButton | import org.thoughtcrime.securesms.ui.components.SlimOutlineCopyButton | ||||||
| import org.thoughtcrime.securesms.ui.components.border | import org.thoughtcrime.securesms.ui.components.border | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
| import org.thoughtcrime.securesms.ui.theme.small | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
|  |  | ||||||
| @Composable | @Composable | ||||||
| internal fun InviteFriend( | internal fun InviteFriend( | ||||||
| @@ -47,7 +46,7 @@ internal fun InviteFriend( | |||||||
|                     .border() |                     .border() | ||||||
|                     .padding(LocalDimensions.current.smallMargin), |                     .padding(LocalDimensions.current.smallMargin), | ||||||
|                 textAlign = TextAlign.Center, |                 textAlign = TextAlign.Center, | ||||||
|                 style = base |                 style = LocalType.current.base | ||||||
|             ) |             ) | ||||||
|  |  | ||||||
|             Spacer(modifier = Modifier.height(LocalDimensions.current.xsItemSpacing)) |             Spacer(modifier = Modifier.height(LocalDimensions.current.xsItemSpacing)) | ||||||
| @@ -55,7 +54,7 @@ internal fun InviteFriend( | |||||||
|             Text( |             Text( | ||||||
|                 stringResource(R.string.invite_your_friend_to_chat_with_you_on_session_by_sharing_your_account_id_with_them), |                 stringResource(R.string.invite_your_friend_to_chat_with_you_on_session_by_sharing_your_account_id_with_them), | ||||||
|                 textAlign = TextAlign.Center, |                 textAlign = TextAlign.Center, | ||||||
|                 style = small, |                 style = LocalType.current.small, | ||||||
|                 color = LocalColors.current.textSecondary, |                 color = LocalColors.current.textSecondary, | ||||||
|                 modifier = Modifier.padding(horizontal = LocalDimensions.current.smallItemSpacing) |                 modifier = Modifier.padding(horizontal = LocalDimensions.current.smallItemSpacing) | ||||||
|             ) |             ) | ||||||
|   | |||||||
| @@ -36,7 +36,7 @@ import org.thoughtcrime.securesms.ui.components.PrimaryOutlineButton | |||||||
| import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField | import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField | ||||||
| import org.thoughtcrime.securesms.ui.components.SessionTabRow | import org.thoughtcrime.securesms.ui.components.SessionTabRow | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
| import org.thoughtcrime.securesms.ui.theme.small | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
|  |  | ||||||
| private val TITLES = listOf(R.string.enter_account_id, R.string.qrScan) | private val TITLES = listOf(R.string.enter_account_id, R.string.qrScan) | ||||||
|  |  | ||||||
| @@ -100,7 +100,7 @@ private fun EnterAccountId( | |||||||
|                     .contentDescription(R.string.AccessibilityId_help_desk_link) |                     .contentDescription(R.string.AccessibilityId_help_desk_link) | ||||||
|                     .padding(horizontal = LocalDimensions.current.margin) |                     .padding(horizontal = LocalDimensions.current.margin) | ||||||
|                     .fillMaxWidth(), |                     .fillMaxWidth(), | ||||||
|                 style = small, |                 style = LocalType.current.small, | ||||||
|                 color = LocalColors.current.textSecondary, |                 color = LocalColors.current.textSecondary, | ||||||
|                 iconRes = R.drawable.ic_circle_question_mark, |                 iconRes = R.drawable.ic_circle_question_mark, | ||||||
|                 onClick = onHelp |                 onClick = onHelp | ||||||
|   | |||||||
| @@ -68,14 +68,14 @@ import org.thoughtcrime.securesms.ui.theme.LocalDimensions | |||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | ||||||
| import org.thoughtcrime.securesms.ui.TitledText | import org.thoughtcrime.securesms.ui.TitledText | ||||||
| import org.thoughtcrime.securesms.ui.theme.base |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.baseBold |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.baseMonospace |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.ThemeColors | import org.thoughtcrime.securesms.ui.theme.ThemeColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.blackAlpha40 | import org.thoughtcrime.securesms.ui.theme.blackAlpha40 | ||||||
| import org.thoughtcrime.securesms.ui.theme.dangerButtonColors | import org.thoughtcrime.securesms.ui.theme.dangerButtonColors | ||||||
| import org.thoughtcrime.securesms.ui.setComposeContent | import org.thoughtcrime.securesms.ui.setComposeContent | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.bold | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.monospace | ||||||
| import javax.inject.Inject | import javax.inject.Inject | ||||||
|  |  | ||||||
| @AndroidEntryPoint | @AndroidEntryPoint | ||||||
| @@ -361,7 +361,7 @@ fun FileDetails(fileDetails: List<TitledText>) { | |||||||
| fun TitledErrorText(titledText: TitledText?) { | fun TitledErrorText(titledText: TitledText?) { | ||||||
|     TitledText( |     TitledText( | ||||||
|         titledText, |         titledText, | ||||||
|         style = base, |         style = LocalType.current.base, | ||||||
|         color = LocalColors.current.danger |         color = LocalColors.current.danger | ||||||
|     ) |     ) | ||||||
| } | } | ||||||
| @@ -370,7 +370,7 @@ fun TitledErrorText(titledText: TitledText?) { | |||||||
| fun TitledMonospaceText(titledText: TitledText?) { | fun TitledMonospaceText(titledText: TitledText?) { | ||||||
|     TitledText( |     TitledText( | ||||||
|         titledText, |         titledText, | ||||||
|         style = baseMonospace |         style = LocalType.current.base.monospace() | ||||||
|     ) |     ) | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -378,7 +378,7 @@ fun TitledMonospaceText(titledText: TitledText?) { | |||||||
| fun TitledText( | fun TitledText( | ||||||
|     titledText: TitledText?, |     titledText: TitledText?, | ||||||
|     modifier: Modifier = Modifier, |     modifier: Modifier = Modifier, | ||||||
|     style: TextStyle = base, |     style: TextStyle = LocalType.current.base, | ||||||
|     color: Color = Color.Unspecified |     color: Color = Color.Unspecified | ||||||
| ) { | ) { | ||||||
|     titledText?.apply { |     titledText?.apply { | ||||||
| @@ -396,7 +396,7 @@ fun TitledText( | |||||||
| @Composable | @Composable | ||||||
| fun TitledView(title: GetString, modifier: Modifier = Modifier, content: @Composable () -> Unit) { | fun TitledView(title: GetString, modifier: Modifier = Modifier, content: @Composable () -> Unit) { | ||||||
|     Column(modifier = modifier, verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.xxxsItemSpacing)) { |     Column(modifier = modifier, verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.xxxsItemSpacing)) { | ||||||
|         Text(title.string(), style = baseBold) |         Text(title.string(), style = LocalType.current.base.bold()) | ||||||
|         content() |         content() | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -19,12 +19,9 @@ import org.thoughtcrime.securesms.ui.Divider | |||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | ||||||
| import org.thoughtcrime.securesms.ui.theme.base |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.ThemeColors | import org.thoughtcrime.securesms.ui.theme.ThemeColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.h4 | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.h8 |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.small |  | ||||||
|  |  | ||||||
| @Composable | @Composable | ||||||
| internal fun EmptyView(newAccount: Boolean) { | internal fun EmptyView(newAccount: Boolean) { | ||||||
| @@ -42,12 +39,12 @@ internal fun EmptyView(newAccount: Boolean) { | |||||||
|         if (newAccount) { |         if (newAccount) { | ||||||
|             Text( |             Text( | ||||||
|                 stringResource(R.string.onboardingAccountCreated), |                 stringResource(R.string.onboardingAccountCreated), | ||||||
|                 style = h4, |                 style = LocalType.current.h4, | ||||||
|                 textAlign = TextAlign.Center |                 textAlign = TextAlign.Center | ||||||
|             ) |             ) | ||||||
|             Text( |             Text( | ||||||
|                 stringResource(R.string.welcome_to_session), |                 stringResource(R.string.welcome_to_session), | ||||||
|                 style = base, |                 style = LocalType.current.base, | ||||||
|                 color = LocalColors.current.primary, |                 color = LocalColors.current.primary, | ||||||
|                 textAlign = TextAlign.Center |                 textAlign = TextAlign.Center | ||||||
|             ) |             ) | ||||||
| @@ -57,12 +54,12 @@ internal fun EmptyView(newAccount: Boolean) { | |||||||
|  |  | ||||||
|         Text( |         Text( | ||||||
|             stringResource(R.string.conversationsNone), |             stringResource(R.string.conversationsNone), | ||||||
|             style = h8, |             style = LocalType.current.h8, | ||||||
|             textAlign = TextAlign.Center, |             textAlign = TextAlign.Center, | ||||||
|             modifier = Modifier.padding(bottom = LocalDimensions.current.xsItemSpacing)) |             modifier = Modifier.padding(bottom = LocalDimensions.current.xsItemSpacing)) | ||||||
|         Text( |         Text( | ||||||
|             stringResource(R.string.onboardingHitThePlusButton), |             stringResource(R.string.onboardingHitThePlusButton), | ||||||
|             style = small, |             style = LocalType.current.small, | ||||||
|             textAlign = TextAlign.Center |             textAlign = TextAlign.Center | ||||||
|         ) |         ) | ||||||
|         Spacer(modifier = Modifier.weight(2f)) |         Spacer(modifier = Modifier.weight(2f)) | ||||||
|   | |||||||
| @@ -26,8 +26,7 @@ import org.thoughtcrime.securesms.ui.theme.ThemeColors | |||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
| import org.thoughtcrime.securesms.ui.components.SlimPrimaryOutlineButton | import org.thoughtcrime.securesms.ui.components.SlimPrimaryOutlineButton | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
| import org.thoughtcrime.securesms.ui.theme.h8 | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.small |  | ||||||
|  |  | ||||||
| @Composable | @Composable | ||||||
| internal fun SeedReminder(startRecoveryPasswordActivity: () -> Unit) { | internal fun SeedReminder(startRecoveryPasswordActivity: () -> Unit) { | ||||||
| @@ -51,14 +50,14 @@ internal fun SeedReminder(startRecoveryPasswordActivity: () -> Unit) { | |||||||
|                 Row { |                 Row { | ||||||
|                     Text( |                     Text( | ||||||
|                         stringResource(R.string.save_your_recovery_password), |                         stringResource(R.string.save_your_recovery_password), | ||||||
|                         style = h8 |                         style = LocalType.current.h8 | ||||||
|                     ) |                     ) | ||||||
|                     Spacer(Modifier.requiredWidth(LocalDimensions.current.xxsItemSpacing)) |                     Spacer(Modifier.requiredWidth(LocalDimensions.current.xxsItemSpacing)) | ||||||
|                     SessionShieldIcon() |                     SessionShieldIcon() | ||||||
|                 } |                 } | ||||||
|                 Text( |                 Text( | ||||||
|                     stringResource(R.string.save_your_recovery_password_to_make_sure_you_don_t_lose_access_to_your_account), |                     stringResource(R.string.save_your_recovery_password_to_make_sure_you_don_t_lose_access_to_your_account), | ||||||
|                     style = small |                     style = LocalType.current.small | ||||||
|                 ) |                 ) | ||||||
|             } |             } | ||||||
|             Spacer(Modifier.width(LocalDimensions.current.xxsMargin)) |             Spacer(Modifier.width(LocalDimensions.current.xxsMargin)) | ||||||
|   | |||||||
| @@ -48,8 +48,7 @@ import org.thoughtcrime.securesms.ui.components.BorderlessHtmlButton | |||||||
| import org.thoughtcrime.securesms.ui.components.PrimaryFillButton | import org.thoughtcrime.securesms.ui.components.PrimaryFillButton | ||||||
| import org.thoughtcrime.securesms.ui.components.PrimaryOutlineButton | import org.thoughtcrime.securesms.ui.components.PrimaryOutlineButton | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
| import org.thoughtcrime.securesms.ui.theme.h4 | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.large |  | ||||||
| import kotlin.time.Duration.Companion.milliseconds | import kotlin.time.Duration.Companion.milliseconds | ||||||
|  |  | ||||||
| @Preview | @Preview | ||||||
| @@ -113,7 +112,7 @@ internal fun LandingScreen( | |||||||
|             Text( |             Text( | ||||||
|                 stringResource(R.string.onboardingBubblePrivacyInYourPocket), |                 stringResource(R.string.onboardingBubblePrivacyInYourPocket), | ||||||
|                 modifier = Modifier.align(Alignment.CenterHorizontally), |                 modifier = Modifier.align(Alignment.CenterHorizontally), | ||||||
|                 style = h4, |                 style = LocalType.current.h4, | ||||||
|                 textAlign = TextAlign.Center |                 textAlign = TextAlign.Center | ||||||
|             ) |             ) | ||||||
|             Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacing)) |             Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacing)) | ||||||
| @@ -217,7 +216,7 @@ private fun MessageText( | |||||||
|     ) { |     ) { | ||||||
|         Text( |         Text( | ||||||
|             text, |             text, | ||||||
|             style = large, |             style = LocalType.current.large, | ||||||
|             color = textColor, |             color = textColor, | ||||||
|             modifier = Modifier.padding( |             modifier = Modifier.padding( | ||||||
|                 horizontal = LocalDimensions.current.smallItemSpacing, |                 horizontal = LocalDimensions.current.smallItemSpacing, | ||||||
|   | |||||||
| @@ -26,11 +26,10 @@ import network.loki.messenger.R | |||||||
| import org.thoughtcrime.securesms.onboarding.ui.ContinuePrimaryOutlineButton | import org.thoughtcrime.securesms.onboarding.ui.ContinuePrimaryOutlineButton | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.base |  | ||||||
| import org.thoughtcrime.securesms.ui.components.MaybeScanQrCode | import org.thoughtcrime.securesms.ui.components.MaybeScanQrCode | ||||||
| import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField | import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField | ||||||
| import org.thoughtcrime.securesms.ui.components.SessionTabRow | import org.thoughtcrime.securesms.ui.components.SessionTabRow | ||||||
| import org.thoughtcrime.securesms.ui.theme.h4 | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
|  |  | ||||||
| private val TITLES = listOf(R.string.sessionRecoveryPassword, R.string.qrScan) | private val TITLES = listOf(R.string.sessionRecoveryPassword, R.string.qrScan) | ||||||
|  |  | ||||||
| @@ -83,7 +82,7 @@ private fun RecoveryPassword(state: State, onChange: (String) -> Unit = {}, onCo | |||||||
|             Row { |             Row { | ||||||
|                 Text( |                 Text( | ||||||
|                     text = stringResource(R.string.sessionRecoveryPassword), |                     text = stringResource(R.string.sessionRecoveryPassword), | ||||||
|                     style = h4 |                     style = LocalType.current.h4 | ||||||
|                 ) |                 ) | ||||||
|                 Spacer(Modifier.width(LocalDimensions.current.xxsItemSpacing)) |                 Spacer(Modifier.width(LocalDimensions.current.xxsItemSpacing)) | ||||||
|                 Icon( |                 Icon( | ||||||
| @@ -95,7 +94,7 @@ private fun RecoveryPassword(state: State, onChange: (String) -> Unit = {}, onCo | |||||||
|             Spacer(Modifier.height(LocalDimensions.current.smallItemSpacing)) |             Spacer(Modifier.height(LocalDimensions.current.smallItemSpacing)) | ||||||
|             Text( |             Text( | ||||||
|                 stringResource(R.string.activity_link_enter_your_recovery_password_to_load_your_account_if_you_haven_t_saved_it_you_can_find_it_in_your_app_settings), |                 stringResource(R.string.activity_link_enter_your_recovery_password_to_load_your_account_if_you_haven_t_saved_it_you_can_find_it_in_your_app_settings), | ||||||
|                 style = base |                 style = LocalType.current.base | ||||||
|             ) |             ) | ||||||
|             Spacer(Modifier.height(LocalDimensions.current.itemSpacing)) |             Spacer(Modifier.height(LocalDimensions.current.itemSpacing)) | ||||||
|             SessionOutlinedTextField( |             SessionOutlinedTextField( | ||||||
|   | |||||||
| @@ -11,9 +11,8 @@ import androidx.compose.ui.res.stringResource | |||||||
| import network.loki.messenger.R | import network.loki.messenger.R | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
| import org.thoughtcrime.securesms.ui.ProgressArc | import org.thoughtcrime.securesms.ui.ProgressArc | ||||||
| import org.thoughtcrime.securesms.ui.theme.base |  | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
| import org.thoughtcrime.securesms.ui.theme.h7 | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
|  |  | ||||||
| @Composable | @Composable | ||||||
| internal fun LoadingScreen(progress: Float) { | internal fun LoadingScreen(progress: Float) { | ||||||
| @@ -25,12 +24,12 @@ internal fun LoadingScreen(progress: Float) { | |||||||
|         ) |         ) | ||||||
|         Text( |         Text( | ||||||
|             stringResource(R.string.waitOneMoment), |             stringResource(R.string.waitOneMoment), | ||||||
|             style = h7 |             style = LocalType.current.h7 | ||||||
|         ) |         ) | ||||||
|         Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsItemSpacing)) |         Spacer(modifier = Modifier.height(LocalDimensions.current.xxxsItemSpacing)) | ||||||
|         Text( |         Text( | ||||||
|             stringResource(R.string.loadAccountProgressMessage), |             stringResource(R.string.loadAccountProgressMessage), | ||||||
|             style = base |             style = LocalType.current.base | ||||||
|         ) |         ) | ||||||
|         Spacer(modifier = Modifier.weight(2f)) |         Spacer(modifier = Modifier.weight(2f)) | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -25,16 +25,12 @@ import org.thoughtcrime.securesms.onboarding.ui.ContinuePrimaryOutlineButton | |||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | ||||||
| import org.thoughtcrime.securesms.ui.theme.base |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.ThemeColors | import org.thoughtcrime.securesms.ui.theme.ThemeColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
| import org.thoughtcrime.securesms.ui.components.CircularProgressIndicator | import org.thoughtcrime.securesms.ui.components.CircularProgressIndicator | ||||||
| import org.thoughtcrime.securesms.ui.components.RadioButton | import org.thoughtcrime.securesms.ui.components.RadioButton | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
| import org.thoughtcrime.securesms.ui.theme.h4 | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.h8 |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.h9 |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.small |  | ||||||
|  |  | ||||||
| @Composable | @Composable | ||||||
| internal fun MessageNotificationsScreen( | internal fun MessageNotificationsScreen( | ||||||
| @@ -61,9 +57,9 @@ internal fun MessageNotificationsScreen( | |||||||
|         Spacer(Modifier.weight(1f)) |         Spacer(Modifier.weight(1f)) | ||||||
|  |  | ||||||
|         Column(modifier = Modifier.padding(horizontal = LocalDimensions.current.onboardingMargin)) { |         Column(modifier = Modifier.padding(horizontal = LocalDimensions.current.onboardingMargin)) { | ||||||
|             Text(stringResource(R.string.notificationsMessage), style = h4) |             Text(stringResource(R.string.notificationsMessage), style = LocalType.current.h4) | ||||||
|             Spacer(Modifier.height(LocalDimensions.current.xsMargin)) |             Spacer(Modifier.height(LocalDimensions.current.xsMargin)) | ||||||
|             Text(stringResource(R.string.onboardingMessageNotificationExplaination), style = base) |             Text(stringResource(R.string.onboardingMessageNotificationExplaination), style = LocalType.current.base) | ||||||
|             Spacer(Modifier.height(LocalDimensions.current.itemSpacing)) |             Spacer(Modifier.height(LocalDimensions.current.itemSpacing)) | ||||||
|         } |         } | ||||||
|  |  | ||||||
| @@ -119,15 +115,15 @@ private fun NotificationRadioButton( | |||||||
|             Column(modifier = Modifier |             Column(modifier = Modifier | ||||||
|                 .padding(horizontal = 15.dp) |                 .padding(horizontal = 15.dp) | ||||||
|                 .padding(top = 10.dp, bottom = 11.dp)) { |                 .padding(top = 10.dp, bottom = 11.dp)) { | ||||||
|                 Text(stringResource(title), style = h8) |                 Text(stringResource(title), style = LocalType.current.h8) | ||||||
|  |  | ||||||
|                 Text(stringResource(explanation), style = small, modifier = Modifier.padding(top = 7.dp)) |                 Text(stringResource(explanation), style = LocalType.current.small, modifier = Modifier.padding(top = 7.dp)) | ||||||
|                 tag?.let { |                 tag?.let { | ||||||
|                     Text( |                     Text( | ||||||
|                         stringResource(it), |                         stringResource(it), | ||||||
|                         modifier = Modifier.padding(top = 6.dp), |                         modifier = Modifier.padding(top = 6.dp), | ||||||
|                         color = LocalColors.current.primary, |                         color = LocalColors.current.primary, | ||||||
|                         style = h9 |                         style = LocalType.current.h9 | ||||||
|                     ) |                     ) | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|   | |||||||
| @@ -19,9 +19,8 @@ import org.thoughtcrime.securesms.onboarding.OnboardingBackPressAlertDialog | |||||||
| import org.thoughtcrime.securesms.onboarding.ui.ContinuePrimaryOutlineButton | import org.thoughtcrime.securesms.onboarding.ui.ContinuePrimaryOutlineButton | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.base |  | ||||||
| import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField | import org.thoughtcrime.securesms.ui.components.SessionOutlinedTextField | ||||||
| import org.thoughtcrime.securesms.ui.theme.h4 | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
|  |  | ||||||
| @Preview | @Preview | ||||||
| @Composable | @Composable | ||||||
| @@ -57,11 +56,11 @@ internal fun PickDisplayName( | |||||||
|         Column( |         Column( | ||||||
|             modifier = Modifier.padding(horizontal = LocalDimensions.current.largeMargin) |             modifier = Modifier.padding(horizontal = LocalDimensions.current.largeMargin) | ||||||
|         ) { |         ) { | ||||||
|             Text(stringResource(state.title), style = h4) |             Text(stringResource(state.title), style = LocalType.current.h4) | ||||||
|             Spacer(Modifier.height(LocalDimensions.current.smallItemSpacing)) |             Spacer(Modifier.height(LocalDimensions.current.smallItemSpacing)) | ||||||
|             Text( |             Text( | ||||||
|                 stringResource(state.description), |                 stringResource(state.description), | ||||||
|                 style = base, |                 style = LocalType.current.base, | ||||||
|                 modifier = Modifier.padding(bottom = LocalDimensions.current.xsItemSpacing)) |                 modifier = Modifier.padding(bottom = LocalDimensions.current.xsItemSpacing)) | ||||||
|             Spacer(Modifier.height(LocalDimensions.current.itemSpacing)) |             Spacer(Modifier.height(LocalDimensions.current.itemSpacing)) | ||||||
|             SessionOutlinedTextField( |             SessionOutlinedTextField( | ||||||
|   | |||||||
| @@ -32,7 +32,7 @@ import org.thoughtcrime.securesms.ui.components.QrImage | |||||||
| import org.thoughtcrime.securesms.ui.components.SessionTabRow | import org.thoughtcrime.securesms.ui.components.SessionTabRow | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
| import org.thoughtcrime.securesms.ui.setComposeContent | import org.thoughtcrime.securesms.ui.setComposeContent | ||||||
| import org.thoughtcrime.securesms.ui.theme.small | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.util.start | import org.thoughtcrime.securesms.util.start | ||||||
|  |  | ||||||
| private val TITLES = listOf(R.string.view, R.string.scan) | private val TITLES = listOf(R.string.view, R.string.scan) | ||||||
| @@ -109,7 +109,7 @@ fun QrPage(string: String) { | |||||||
|             text = stringResource(R.string.this_is_your_account_id_other_users_can_scan_it_to_start_a_conversation_with_you), |             text = stringResource(R.string.this_is_your_account_id_other_users_can_scan_it_to_start_a_conversation_with_you), | ||||||
|             color = LocalColors.current.textSecondary, |             color = LocalColors.current.textSecondary, | ||||||
|             textAlign = TextAlign.Center, |             textAlign = TextAlign.Center, | ||||||
|             style = small |             style = LocalType.current.small | ||||||
|         ) |         ) | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -30,7 +30,6 @@ import org.thoughtcrime.securesms.ui.theme.LocalDimensions | |||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | ||||||
| import org.thoughtcrime.securesms.ui.SessionShieldIcon | import org.thoughtcrime.securesms.ui.SessionShieldIcon | ||||||
| import org.thoughtcrime.securesms.ui.theme.base |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.ThemeColors | import org.thoughtcrime.securesms.ui.theme.ThemeColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
| import org.thoughtcrime.securesms.ui.components.QrImage | import org.thoughtcrime.securesms.ui.components.QrImage | ||||||
| @@ -38,8 +37,8 @@ import org.thoughtcrime.securesms.ui.components.SlimOutlineButton | |||||||
| import org.thoughtcrime.securesms.ui.components.SlimOutlineCopyButton | import org.thoughtcrime.securesms.ui.components.SlimOutlineCopyButton | ||||||
| import org.thoughtcrime.securesms.ui.components.border | import org.thoughtcrime.securesms.ui.components.border | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
| import org.thoughtcrime.securesms.ui.theme.extraSmallMonospace | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.h8 | import org.thoughtcrime.securesms.ui.theme.monospace | ||||||
|  |  | ||||||
| @Composable | @Composable | ||||||
| internal fun RecoveryPasswordScreen( | internal fun RecoveryPasswordScreen( | ||||||
| @@ -75,7 +74,7 @@ private fun RecoveryPasswordCell( | |||||||
|             Row { |             Row { | ||||||
|                 Text( |                 Text( | ||||||
|                     stringResource(R.string.sessionRecoveryPassword), |                     stringResource(R.string.sessionRecoveryPassword), | ||||||
|                     style = h8 |                     style = LocalType.current.h8 | ||||||
|                 ) |                 ) | ||||||
|                 Spacer(Modifier.width(LocalDimensions.current.xxsItemSpacing)) |                 Spacer(Modifier.width(LocalDimensions.current.xxsItemSpacing)) | ||||||
|                 SessionShieldIcon() |                 SessionShieldIcon() | ||||||
| @@ -85,7 +84,7 @@ private fun RecoveryPasswordCell( | |||||||
|  |  | ||||||
|             Text( |             Text( | ||||||
|                 stringResource(R.string.recoveryPasswordDescription), |                 stringResource(R.string.recoveryPasswordDescription), | ||||||
|                 style = base |                 style = LocalType.current.base | ||||||
|             ) |             ) | ||||||
|  |  | ||||||
|             AnimatedVisibility(!showQr) { |             AnimatedVisibility(!showQr) { | ||||||
| @@ -142,7 +141,7 @@ private fun RecoveryPassword(mnemonic: String) { | |||||||
|             .border() |             .border() | ||||||
|             .padding(LocalDimensions.current.smallMargin), |             .padding(LocalDimensions.current.smallMargin), | ||||||
|         textAlign = TextAlign.Center, |         textAlign = TextAlign.Center, | ||||||
|         style = extraSmallMonospace, |         style = LocalType.current.extraSmall.monospace(), | ||||||
|         color = LocalColors.current.run { if (isLight) text else primary }, |         color = LocalColors.current.run { if (isLight) text else primary }, | ||||||
|     ) |     ) | ||||||
| } | } | ||||||
| @@ -156,11 +155,11 @@ private fun HideRecoveryPasswordCell(onHide: () -> Unit = {}) { | |||||||
|             ) { |             ) { | ||||||
|                 Text( |                 Text( | ||||||
|                     stringResource(R.string.recoveryPasswordHideRecoveryPassword), |                     stringResource(R.string.recoveryPasswordHideRecoveryPassword), | ||||||
|                     style = h8 |                     style = LocalType.current.h8 | ||||||
|                 ) |                 ) | ||||||
|                 Text( |                 Text( | ||||||
|                     stringResource(R.string.recoveryPasswordHideRecoveryPasswordDescription), |                     stringResource(R.string.recoveryPasswordHideRecoveryPasswordDescription), | ||||||
|                     style = base |                     style = LocalType.current.base | ||||||
|                 ) |                 ) | ||||||
|             } |             } | ||||||
|             Spacer(modifier = Modifier.width(LocalDimensions.current.xxsMargin)) |             Spacer(modifier = Modifier.width(LocalDimensions.current.xxsMargin)) | ||||||
|   | |||||||
| @@ -1,6 +1,5 @@ | |||||||
| package org.thoughtcrime.securesms.ui | package org.thoughtcrime.securesms.ui | ||||||
|  |  | ||||||
| import androidx.compose.foundation.background |  | ||||||
| import androidx.compose.foundation.layout.Box | import androidx.compose.foundation.layout.Box | ||||||
| import androidx.compose.foundation.layout.Column | import androidx.compose.foundation.layout.Column | ||||||
| import androidx.compose.foundation.layout.IntrinsicSize | import androidx.compose.foundation.layout.IntrinsicSize | ||||||
| @@ -24,14 +23,12 @@ import androidx.compose.ui.res.painterResource | |||||||
| import androidx.compose.ui.res.stringResource | import androidx.compose.ui.res.stringResource | ||||||
| import androidx.compose.ui.text.style.TextAlign | import androidx.compose.ui.text.style.TextAlign | ||||||
| import androidx.compose.ui.tooling.preview.Preview | import androidx.compose.ui.tooling.preview.Preview | ||||||
| import androidx.compose.ui.unit.dp |  | ||||||
| import network.loki.messenger.R | import network.loki.messenger.R | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.h7 | import org.thoughtcrime.securesms.ui.theme.bold | ||||||
| import org.thoughtcrime.securesms.ui.theme.large |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.largeBold |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class DialogButtonModel( | class DialogButtonModel( | ||||||
| @@ -83,7 +80,7 @@ fun AlertDialog( | |||||||
|                             Text( |                             Text( | ||||||
|                                 it, |                                 it, | ||||||
|                                 textAlign = TextAlign.Center, |                                 textAlign = TextAlign.Center, | ||||||
|                                 style = h7, |                                 style = LocalType.current.h7, | ||||||
|                                 modifier = Modifier.padding(bottom = LocalDimensions.current.xxsItemSpacing) |                                 modifier = Modifier.padding(bottom = LocalDimensions.current.xxsItemSpacing) | ||||||
|                             ) |                             ) | ||||||
|                         } |                         } | ||||||
| @@ -91,7 +88,7 @@ fun AlertDialog( | |||||||
|                             Text( |                             Text( | ||||||
|                                 it, |                                 it, | ||||||
|                                 textAlign = TextAlign.Center, |                                 textAlign = TextAlign.Center, | ||||||
|                                 style = large, |                                 style = LocalType.current.large, | ||||||
|                                 modifier = Modifier.padding(bottom = LocalDimensions.current.xxsItemSpacing) |                                 modifier = Modifier.padding(bottom = LocalDimensions.current.xxsItemSpacing) | ||||||
|                             ) |                             ) | ||||||
|                         } |                         } | ||||||
| @@ -130,7 +127,7 @@ fun DialogButton(text: String, modifier: Modifier, color: Color = Color.Unspecif | |||||||
|         Text( |         Text( | ||||||
|             text, |             text, | ||||||
|             color = color.takeOrElse { LocalColors.current.text }, |             color = color.takeOrElse { LocalColors.current.text }, | ||||||
|             style = largeBold, |             style = LocalType.current.large.bold(), | ||||||
|             textAlign = TextAlign.Center, |             textAlign = TextAlign.Center, | ||||||
|             modifier = Modifier.padding( |             modifier = Modifier.padding( | ||||||
|                 top = LocalDimensions.current.smallItemSpacing, |                 top = LocalDimensions.current.smallItemSpacing, | ||||||
|   | |||||||
| @@ -67,15 +67,10 @@ import org.thoughtcrime.securesms.conversation.disappearingmessages.ui.OptionsCa | |||||||
| import org.thoughtcrime.securesms.ui.components.SmallCircularProgressIndicator | import org.thoughtcrime.securesms.ui.components.SmallCircularProgressIndicator | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
| import org.thoughtcrime.securesms.ui.theme.base | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.divider | import org.thoughtcrime.securesms.ui.theme.divider | ||||||
| import org.thoughtcrime.securesms.ui.theme.extraSmall |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.h2 |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.h8 |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.large |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.radioButtonColors | import org.thoughtcrime.securesms.ui.theme.radioButtonColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.transparentButtonColors | import org.thoughtcrime.securesms.ui.theme.transparentButtonColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.xl |  | ||||||
| import kotlin.math.min | import kotlin.math.min | ||||||
| import kotlin.math.roundToInt | import kotlin.math.roundToInt | ||||||
|  |  | ||||||
| @@ -102,7 +97,7 @@ data class RadioOption<T>( | |||||||
| fun <T> OptionsCard(card: OptionsCard<T>, callbacks: Callbacks<T>) { | fun <T> OptionsCard(card: OptionsCard<T>, callbacks: Callbacks<T>) { | ||||||
|     Text( |     Text( | ||||||
|         card.title(), |         card.title(), | ||||||
|         style = base |         style = LocalType.current.base | ||||||
|     ) |     ) | ||||||
|     CellNoMargin { |     CellNoMargin { | ||||||
|         LazyColumn( |         LazyColumn( | ||||||
| @@ -124,7 +119,10 @@ fun LargeItemButtonWithDrawable( | |||||||
|     colors: ButtonColors = transparentButtonColors(), |     colors: ButtonColors = transparentButtonColors(), | ||||||
|     onClick: () -> Unit |     onClick: () -> Unit | ||||||
| ) { | ) { | ||||||
|     ItemButtonWithDrawable(textId, icon, modifier.heightIn(min = LocalDimensions.current.minLargeItemButtonHeight), h8, colors, onClick) |     ItemButtonWithDrawable( | ||||||
|  |         textId, icon, modifier.heightIn(min = LocalDimensions.current.minLargeItemButtonHeight), | ||||||
|  |         LocalType.current.h8, colors, onClick | ||||||
|  |     ) | ||||||
| } | } | ||||||
|  |  | ||||||
| @Composable | @Composable | ||||||
| @@ -132,7 +130,7 @@ fun ItemButtonWithDrawable( | |||||||
|     @StringRes textId: Int, |     @StringRes textId: Int, | ||||||
|     @DrawableRes icon: Int, |     @DrawableRes icon: Int, | ||||||
|     modifier: Modifier = Modifier, |     modifier: Modifier = Modifier, | ||||||
|     textStyle: TextStyle = xl, |     textStyle: TextStyle = LocalType.current.xl, | ||||||
|     colors: ButtonColors = transparentButtonColors(), |     colors: ButtonColors = transparentButtonColors(), | ||||||
|     onClick: () -> Unit |     onClick: () -> Unit | ||||||
| ) { | ) { | ||||||
| @@ -162,7 +160,10 @@ fun LargeItemButton( | |||||||
|     colors: ButtonColors = transparentButtonColors(), |     colors: ButtonColors = transparentButtonColors(), | ||||||
|     onClick: () -> Unit |     onClick: () -> Unit | ||||||
| ) { | ) { | ||||||
|     ItemButton(textId, icon, modifier.heightIn(min = LocalDimensions.current.minLargeItemButtonHeight), h8, colors, onClick) |     ItemButton( | ||||||
|  |         textId, icon, modifier.heightIn(min = LocalDimensions.current.minLargeItemButtonHeight), | ||||||
|  |         LocalType.current.h8, colors, onClick | ||||||
|  |     ) | ||||||
| } | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -173,7 +174,7 @@ fun ItemButton( | |||||||
|     @StringRes textId: Int, |     @StringRes textId: Int, | ||||||
|     @DrawableRes icon: Int, |     @DrawableRes icon: Int, | ||||||
|     modifier: Modifier = Modifier, |     modifier: Modifier = Modifier, | ||||||
|     textStyle: TextStyle = xl, |     textStyle: TextStyle = LocalType.current.xl, | ||||||
|     colors: ButtonColors = transparentButtonColors(), |     colors: ButtonColors = transparentButtonColors(), | ||||||
|     onClick: () -> Unit |     onClick: () -> Unit | ||||||
| ) { | ) { | ||||||
| @@ -203,7 +204,7 @@ fun ItemButton( | |||||||
|     text: String, |     text: String, | ||||||
|     icon: @Composable BoxScope.() -> Unit, |     icon: @Composable BoxScope.() -> Unit, | ||||||
|     modifier: Modifier = Modifier, |     modifier: Modifier = Modifier, | ||||||
|     textStyle: TextStyle = xl, |     textStyle: TextStyle = LocalType.current.xl, | ||||||
|     colors: ButtonColors = transparentButtonColors(), |     colors: ButtonColors = transparentButtonColors(), | ||||||
|     onClick: () -> Unit |     onClick: () -> Unit | ||||||
| ) { | ) { | ||||||
| @@ -281,13 +282,13 @@ fun <T> TitledRadioButton(option: RadioOption<T>, onClick: () -> Unit) { | |||||||
|             Column { |             Column { | ||||||
|                 Text( |                 Text( | ||||||
|                     text = option.title(), |                     text = option.title(), | ||||||
|                     style = large, |                     style = LocalType.current.large, | ||||||
|                     color = color |                     color = color | ||||||
|                 ) |                 ) | ||||||
|                 option.subtitle?.let { |                 option.subtitle?.let { | ||||||
|                     Text( |                     Text( | ||||||
|                         text = it(), |                         text = it(), | ||||||
|                         style = extraSmall, |                         style = LocalType.current.extraSmall, | ||||||
|                         color = color |                         color = color | ||||||
|                     ) |                     ) | ||||||
|                 } |                 } | ||||||
| @@ -399,7 +400,7 @@ fun ProgressArc(progress: Float, modifier: Modifier = Modifier) { | |||||||
|             "${text}%", |             "${text}%", | ||||||
|             color = Color.White, |             color = Color.White, | ||||||
|             modifier = Modifier.align(Alignment.Center), |             modifier = Modifier.align(Alignment.Center), | ||||||
|             style = h2 |             style = LocalType.current.h2 | ||||||
|         ) |         ) | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -16,10 +16,10 @@ import androidx.compose.ui.tooling.preview.Preview | |||||||
| import androidx.compose.ui.tooling.preview.PreviewParameter | import androidx.compose.ui.tooling.preview.PreviewParameter | ||||||
| import network.loki.messenger.R | import network.loki.messenger.R | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | ||||||
| import org.thoughtcrime.securesms.ui.theme.ThemeColors | import org.thoughtcrime.securesms.ui.theme.ThemeColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.h4 |  | ||||||
|  |  | ||||||
| @Preview | @Preview | ||||||
| @Composable | @Composable | ||||||
| @@ -42,7 +42,7 @@ fun AppBar(title: String, onClose: () -> Unit = {}, onBack: (() -> Unit)? = null | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         Spacer(modifier = Modifier.weight(1f)) |         Spacer(modifier = Modifier.weight(1f)) | ||||||
|         Text(text = title, style = h4) |         Text(text = title, style = LocalType.current.h4) | ||||||
|         Spacer(modifier = Modifier.weight(1f)) |         Spacer(modifier = Modifier.weight(1f)) | ||||||
|         Box(contentAlignment = Alignment.Center, modifier = Modifier.size(LocalDimensions.current.appBarHeight)) { |         Box(contentAlignment = Alignment.Center, modifier = Modifier.size(LocalDimensions.current.appBarHeight)) { | ||||||
|             IconButton(onClick = onClose) { |             IconButton(onClick = onClose) { | ||||||
|   | |||||||
| @@ -37,13 +37,14 @@ import kotlinx.coroutines.flow.collectLatest | |||||||
| import kotlinx.coroutines.flow.filter | import kotlinx.coroutines.flow.filter | ||||||
| import network.loki.messenger.R | import network.loki.messenger.R | ||||||
| import org.thoughtcrime.securesms.ui.LaunchedEffectAsync | import org.thoughtcrime.securesms.ui.LaunchedEffectAsync | ||||||
|  | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | ||||||
| import org.thoughtcrime.securesms.ui.theme.baseBold |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.buttonShape |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.ThemeColors | import org.thoughtcrime.securesms.ui.theme.ThemeColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.bold | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.theme.buttonShape | ||||||
| import kotlin.time.Duration | import kotlin.time.Duration | ||||||
| import kotlin.time.Duration.Companion.seconds | import kotlin.time.Duration.Companion.seconds | ||||||
|  |  | ||||||
| @@ -257,7 +258,7 @@ fun BorderlessButtonWithIcon( | |||||||
|     text: String, |     text: String, | ||||||
|     @DrawableRes iconRes: Int, |     @DrawableRes iconRes: Int, | ||||||
|     modifier: Modifier = Modifier, |     modifier: Modifier = Modifier, | ||||||
|     style: TextStyle = baseBold, |     style: TextStyle = LocalType.current.base.bold(), | ||||||
|     color: Color = LocalColors.current.text, |     color: Color = LocalColors.current.text, | ||||||
|     onClick: () -> Unit |     onClick: () -> Unit | ||||||
| ) { | ) { | ||||||
|   | |||||||
| @@ -10,9 +10,8 @@ import androidx.compose.ui.text.TextStyle | |||||||
| import androidx.compose.ui.text.style.TextAlign | import androidx.compose.ui.text.style.TextAlign | ||||||
| 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 org.thoughtcrime.securesms.ui.theme.baseBold | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.extraSmall | import org.thoughtcrime.securesms.ui.theme.bold | ||||||
| import org.thoughtcrime.securesms.ui.theme.extraSmallBold |  | ||||||
|  |  | ||||||
| interface ButtonStyle { | interface ButtonStyle { | ||||||
|     @OptIn(ExperimentalMaterialApi::class) |     @OptIn(ExperimentalMaterialApi::class) | ||||||
| @@ -27,26 +26,34 @@ interface ButtonStyle { | |||||||
|     @SuppressLint("ComposableNaming") |     @SuppressLint("ComposableNaming") | ||||||
|     @Composable fun applyTextConstraints(content: @Composable () -> Unit) { |     @Composable fun applyTextConstraints(content: @Composable () -> Unit) { | ||||||
|         CompositionLocalProvider( |         CompositionLocalProvider( | ||||||
|             LocalTextStyle provides textStyle, |             LocalTextStyle provides textStyle(), | ||||||
|             content = content |             content = content | ||||||
|         ) |         ) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     val textStyle: TextStyle |     @Composable | ||||||
|  |     fun textStyle() : TextStyle | ||||||
|  |  | ||||||
|     val minHeight: Dp |     val minHeight: Dp | ||||||
|  |  | ||||||
|     object Large: ButtonStyle { |     object Large: ButtonStyle { | ||||||
|         override val textStyle = baseBold.copy(textAlign = TextAlign.Center) |         @Composable | ||||||
|  |         override fun textStyle() = LocalType.current.base.bold() | ||||||
|  |             .copy(textAlign = TextAlign.Center) | ||||||
|         override val minHeight = 41.dp |         override val minHeight = 41.dp | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     object Slim: ButtonStyle { |     object Slim: ButtonStyle { | ||||||
|         override val textStyle = extraSmallBold.copy(textAlign = TextAlign.Center) |         @Composable | ||||||
|  |         override fun textStyle() = LocalType.current.extraSmall.bold() | ||||||
|  |             .copy(textAlign = TextAlign.Center) | ||||||
|         override val minHeight = 29.dp |         override val minHeight = 29.dp | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     object Borderless: ButtonStyle { |     object Borderless: ButtonStyle { | ||||||
|         override val textStyle = extraSmall.copy(textAlign = TextAlign.Center) |         @Composable | ||||||
|  |         override fun textStyle() = LocalType.current.extraSmall | ||||||
|  |             .copy(textAlign = TextAlign.Center) | ||||||
|         override val minHeight = 37.dp |         override val minHeight = 37.dp | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -57,9 +57,8 @@ import kotlinx.coroutines.launch | |||||||
| import network.loki.messenger.R | import network.loki.messenger.R | ||||||
| import org.session.libsignal.utilities.Log | import org.session.libsignal.utilities.Log | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
| import org.thoughtcrime.securesms.ui.theme.base |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.xl | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import java.util.concurrent.Executors | import java.util.concurrent.Executors | ||||||
|  |  | ||||||
| private const val TAG = "NewMessageFragment" | private const val TAG = "NewMessageFragment" | ||||||
| @@ -94,7 +93,7 @@ fun MaybeScanQrCode( | |||||||
|             ) { |             ) { | ||||||
|                 Text( |                 Text( | ||||||
|                     stringResource(R.string.activity_link_camera_permission_permanently_denied_configure_in_settings), |                     stringResource(R.string.activity_link_camera_permission_permanently_denied_configure_in_settings), | ||||||
|                     style = base, |                     style = LocalType.current.base, | ||||||
|                     textAlign = TextAlign.Center |                     textAlign = TextAlign.Center | ||||||
|                 ) |                 ) | ||||||
|                 Spacer(modifier = Modifier.size(LocalDimensions.current.itemSpacing)) |                 Spacer(modifier = Modifier.size(LocalDimensions.current.itemSpacing)) | ||||||
| @@ -113,7 +112,8 @@ fun MaybeScanQrCode( | |||||||
|                 horizontalAlignment = Alignment.CenterHorizontally |                 horizontalAlignment = Alignment.CenterHorizontally | ||||||
|             ) { |             ) { | ||||||
|                 Spacer(modifier = Modifier.weight(1f)) |                 Spacer(modifier = Modifier.weight(1f)) | ||||||
|                 Text(stringResource(R.string.fragment_scan_qr_code_camera_access_explanation), style = xl, textAlign = TextAlign.Center) |                 Text(stringResource(R.string.fragment_scan_qr_code_camera_access_explanation), | ||||||
|  |                     style = LocalType.current.xl, textAlign = TextAlign.Center) | ||||||
|                 Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacing)) |                 Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacing)) | ||||||
|                 PrimaryOutlineButton( |                 PrimaryOutlineButton( | ||||||
|                     stringResource(R.string.cameraGrantAccess), |                     stringResource(R.string.cameraGrantAccess), | ||||||
|   | |||||||
| @@ -19,13 +19,13 @@ import androidx.compose.ui.tooling.preview.PreviewParameter | |||||||
| import androidx.compose.ui.unit.dp | import androidx.compose.ui.unit.dp | ||||||
| import kotlinx.coroutines.launch | import kotlinx.coroutines.launch | ||||||
| import network.loki.messenger.R | import network.loki.messenger.R | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.ThemeColors |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | import org.thoughtcrime.securesms.ui.theme.SessionColorsParameterProvider | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.ThemeColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.divider | import org.thoughtcrime.securesms.ui.theme.divider | ||||||
| import org.thoughtcrime.securesms.ui.theme.h8 |  | ||||||
|  |  | ||||||
| private val TITLES = listOf(R.string.sessionRecoveryPassword, R.string.qrScan) | private val TITLES = listOf(R.string.sessionRecoveryPassword, R.string.qrScan) | ||||||
|  |  | ||||||
| @@ -58,7 +58,7 @@ fun SessionTabRow(pagerState: PagerState, titles: List<Int>) { | |||||||
|             ) { |             ) { | ||||||
|                 Text( |                 Text( | ||||||
|                     stringResource(id = it), |                     stringResource(id = it), | ||||||
|                     style = h8 |                     style = LocalType.current.h8 | ||||||
|                 ) |                 ) | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -39,13 +39,13 @@ import androidx.compose.ui.unit.sp | |||||||
| import network.loki.messenger.R | import network.loki.messenger.R | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalDimensions | import org.thoughtcrime.securesms.ui.theme.LocalDimensions | ||||||
| import org.thoughtcrime.securesms.ui.theme.PreviewTheme | import org.thoughtcrime.securesms.ui.theme.PreviewTheme | ||||||
| import org.thoughtcrime.securesms.ui.theme.base |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.baseBold |  | ||||||
| import org.thoughtcrime.securesms.ui.theme.LocalColors | import org.thoughtcrime.securesms.ui.theme.LocalColors | ||||||
| import org.thoughtcrime.securesms.ui.theme.borders | import org.thoughtcrime.securesms.ui.theme.borders | ||||||
| import org.thoughtcrime.securesms.ui.theme.text | import org.thoughtcrime.securesms.ui.theme.text | ||||||
| import org.thoughtcrime.securesms.ui.theme.textSecondary | import org.thoughtcrime.securesms.ui.theme.textSecondary | ||||||
| import org.thoughtcrime.securesms.ui.contentDescription | import org.thoughtcrime.securesms.ui.contentDescription | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.LocalType | ||||||
|  | import org.thoughtcrime.securesms.ui.theme.bold | ||||||
|  |  | ||||||
| @Preview | @Preview | ||||||
| @Composable | @Composable | ||||||
| @@ -85,7 +85,7 @@ fun SessionOutlinedTextField( | |||||||
|     modifier: Modifier = Modifier, |     modifier: Modifier = Modifier, | ||||||
|     contentDescription: String? = null, |     contentDescription: String? = null, | ||||||
|     onChange: (String) -> Unit = {}, |     onChange: (String) -> Unit = {}, | ||||||
|     textStyle: TextStyle = base, |     textStyle: TextStyle = LocalType.current.base, | ||||||
|     placeholder: String = "", |     placeholder: String = "", | ||||||
|     onContinue: () -> Unit = {}, |     onContinue: () -> Unit = {}, | ||||||
|     error: String? = null, |     error: String? = null, | ||||||
| @@ -106,7 +106,7 @@ fun SessionOutlinedTextField( | |||||||
|             if (text.isEmpty()) { |             if (text.isEmpty()) { | ||||||
|                 Text( |                 Text( | ||||||
|                     text = placeholder, |                     text = placeholder, | ||||||
|                     style = base, |                     style = LocalType.current.base, | ||||||
|                     color = LocalColors.current.textSecondary(isTextErrorColor), |                     color = LocalColors.current.textSecondary(isTextErrorColor), | ||||||
|                     modifier = Modifier.wrapContentSize() |                     modifier = Modifier.wrapContentSize() | ||||||
|                         .align(Alignment.CenterStart) |                         .align(Alignment.CenterStart) | ||||||
| @@ -136,7 +136,7 @@ fun SessionOutlinedTextField( | |||||||
|                 modifier = Modifier.fillMaxWidth() |                 modifier = Modifier.fillMaxWidth() | ||||||
|                     .contentDescription(R.string.AccessibilityId_error_message), |                     .contentDescription(R.string.AccessibilityId_error_message), | ||||||
|                 textAlign = TextAlign.Center, |                 textAlign = TextAlign.Center, | ||||||
|                 style = baseBold, |                 style = LocalType.current.base.bold(), | ||||||
|                 color = LocalColors.current.danger |                 color = LocalColors.current.danger | ||||||
|             ) |             ) | ||||||
|         } |         } | ||||||
| @@ -148,7 +148,7 @@ fun AnnotatedTextWithIcon( | |||||||
|     text: String, |     text: String, | ||||||
|     @DrawableRes iconRes: Int, |     @DrawableRes iconRes: Int, | ||||||
|     modifier: Modifier = Modifier, |     modifier: Modifier = Modifier, | ||||||
|     style: TextStyle = base, |     style: TextStyle = LocalType.current.base, | ||||||
|     color: Color = Color.Unspecified, |     color: Color = Color.Unspecified, | ||||||
|     iconSize: TextUnit = 12.sp |     iconSize: TextUnit = 12.sp | ||||||
| ) { | ) { | ||||||
|   | |||||||
| @@ -1,6 +1,7 @@ | |||||||
| package org.thoughtcrime.securesms.ui.theme | package org.thoughtcrime.securesms.ui.theme | ||||||
|  |  | ||||||
| import androidx.compose.material.Typography | import androidx.compose.material.Typography | ||||||
|  | import androidx.compose.runtime.Composable | ||||||
| import androidx.compose.ui.text.TextStyle | import androidx.compose.ui.text.TextStyle | ||||||
| import androidx.compose.ui.text.font.FontFamily | import androidx.compose.ui.text.font.FontFamily | ||||||
| import androidx.compose.ui.text.font.FontFamily.Companion.Monospace | import androidx.compose.ui.text.font.FontFamily.Companion.Monospace | ||||||
| @@ -8,52 +9,158 @@ import androidx.compose.ui.text.font.FontWeight | |||||||
| import androidx.compose.ui.unit.TextUnit | import androidx.compose.ui.unit.TextUnit | ||||||
| import androidx.compose.ui.unit.sp | import androidx.compose.ui.unit.sp | ||||||
|  |  | ||||||
| fun boldStyle(size: TextUnit) = TextStyle.Default.copy( |  | ||||||
|     fontSize = size, |  | ||||||
|     lineHeight = size * 1.2, | fun TextStyle.bold() = TextStyle.Default.copy( | ||||||
|     fontWeight = FontWeight.Bold, |     fontWeight = FontWeight.Bold | ||||||
| ) | ) | ||||||
|  |  | ||||||
| fun defaultStyle(size: TextUnit, fontFamily: FontFamily? = TextStyle.Default.fontFamily) = TextStyle.Default.copy( | fun TextStyle.monospace() = TextStyle.Default.copy( | ||||||
|     fontSize = size, |     fontFamily = FontFamily.Monospace | ||||||
|     lineHeight = size * 1.2, |  | ||||||
|     fontFamily = fontFamily |  | ||||||
| ) | ) | ||||||
|  |  | ||||||
| val xl = defaultStyle(18.sp) | val sessionTypography = SessionTypography() | ||||||
|  |  | ||||||
| val large = defaultStyle(16.sp) | data class SessionTypography( | ||||||
| val largeBold = boldStyle(16.sp) |     // Body | ||||||
|  |     val xl: TextStyle = TextStyle( | ||||||
|  |         fontSize = 18.sp, | ||||||
|  |         lineHeight = 21.6.sp, | ||||||
|  |         fontWeight = FontWeight.Normal | ||||||
|  |     ), | ||||||
|  |  | ||||||
| val base = defaultStyle(14.sp) |     val large: TextStyle = TextStyle( | ||||||
| val baseBold = boldStyle(14.sp) |         fontSize = 16.sp, | ||||||
| val baseMonospace = defaultStyle(14.sp, fontFamily = Monospace) |         lineHeight = 19.2.sp, | ||||||
|  |         fontWeight = FontWeight.Normal | ||||||
|  |     ), | ||||||
|  |  | ||||||
| val small = defaultStyle(12.sp) |     val base: TextStyle = TextStyle( | ||||||
| val smallBold = boldStyle(12.sp) |         fontSize = 14.sp, | ||||||
| val smallMonospace = defaultStyle(12.sp, fontFamily = Monospace) |         lineHeight = 16.8.sp, | ||||||
|  |         fontWeight = FontWeight.Normal | ||||||
|  |     ), | ||||||
|  |  | ||||||
| val extraSmall = defaultStyle(11.sp) |     val small: TextStyle = TextStyle( | ||||||
| val extraSmallBold = boldStyle(11.sp) |         fontSize = 12.sp, | ||||||
| val extraSmallMonospace = defaultStyle(11.sp, fontFamily = Monospace) |         lineHeight = 14.4.sp, | ||||||
|  |         fontWeight = FontWeight.Normal | ||||||
|  |     ), | ||||||
|  |  | ||||||
| val fine = defaultStyle(9.sp) |     val extraSmall: TextStyle = TextStyle( | ||||||
|  |         fontSize = 11.sp, | ||||||
|  |         lineHeight = 13.2.sp, | ||||||
|  |         fontWeight = FontWeight.Normal | ||||||
|  |     ), | ||||||
|  |  | ||||||
| val h1 = boldStyle(36.sp) |     val fine: TextStyle = TextStyle( | ||||||
| val h2 = boldStyle(32.sp) |         fontSize = 9.sp, | ||||||
| val h3 = boldStyle(29.sp) |         lineHeight = 10.8.sp, | ||||||
| val h4 = boldStyle(26.sp) |         fontWeight = FontWeight.Normal | ||||||
| val h5 = boldStyle(23.sp) |     ), | ||||||
| val h6 = boldStyle(20.sp) |  | ||||||
| val h7 = boldStyle(18.sp) |  | ||||||
| val h8 = boldStyle(16.sp) |  | ||||||
| val h9 = boldStyle(14.sp) |  | ||||||
|  |  | ||||||
| val sessionTypography = Typography( |     // Headings | ||||||
|  |     val h1: TextStyle = TextStyle( | ||||||
|  |         fontSize = 36.sp, | ||||||
|  |         lineHeight = 43.2.sp, | ||||||
|  |         fontWeight = FontWeight.Bold | ||||||
|  |     ), | ||||||
|  |  | ||||||
|  |     val h2: TextStyle = TextStyle( | ||||||
|  |         fontSize = 32.sp, | ||||||
|  |         lineHeight = 38.4.sp, | ||||||
|  |         fontWeight = FontWeight.Bold | ||||||
|  |     ), | ||||||
|  |  | ||||||
|  |     val h3: TextStyle = TextStyle( | ||||||
|  |         fontSize = 29.sp, | ||||||
|  |         lineHeight = 34.8.sp, | ||||||
|  |         fontWeight = FontWeight.Bold | ||||||
|  |     ), | ||||||
|  |  | ||||||
|  |     val h4: TextStyle = TextStyle( | ||||||
|  |         fontSize = 26.sp, | ||||||
|  |         lineHeight = 31.2.sp, | ||||||
|  |         fontWeight = FontWeight.Bold | ||||||
|  |     ), | ||||||
|  |  | ||||||
|  |     val h5: TextStyle = TextStyle( | ||||||
|  |         fontSize = 23.sp, | ||||||
|  |         lineHeight = 27.6.sp, | ||||||
|  |         fontWeight = FontWeight.Bold | ||||||
|  |     ), | ||||||
|  |  | ||||||
|  |     val h6: TextStyle = TextStyle( | ||||||
|  |         fontSize = 20.sp, | ||||||
|  |         lineHeight = 24.sp, | ||||||
|  |         fontWeight = FontWeight.Bold | ||||||
|  |     ), | ||||||
|  |  | ||||||
|  |     val h7: TextStyle = TextStyle( | ||||||
|  |         fontSize = 18.sp, | ||||||
|  |         lineHeight = 21.6.sp, | ||||||
|  |         fontWeight = FontWeight.Bold | ||||||
|  |     ), | ||||||
|  |  | ||||||
|  |     val h8: TextStyle = TextStyle( | ||||||
|  |         fontSize = 16.sp, | ||||||
|  |         lineHeight = 19.2.sp, | ||||||
|  |         fontWeight = FontWeight.Bold | ||||||
|  |     ), | ||||||
|  |  | ||||||
|  |     val h9: TextStyle = TextStyle( | ||||||
|  |         fontSize = 14.sp, | ||||||
|  |         lineHeight = 16.8.sp, | ||||||
|  |         fontWeight = FontWeight.Bold | ||||||
|  |     ) | ||||||
|  | ) { | ||||||
|  |     //todo ready to go when we switch to Material3 | ||||||
|  |  | ||||||
|  |     // An opinionated override of Material's defaults | ||||||
|  |     /*@Composable | ||||||
|  |     fun asMaterialTypography() = Typography( | ||||||
|  |         // Display | ||||||
|  |         displayLarge = h1, | ||||||
|  |         displayMedium = h1, | ||||||
|  |         displaySmall = h1, | ||||||
|  |  | ||||||
|  |         // Headline | ||||||
|  |         headlineLarge = h2, | ||||||
|  |         headlineMedium = h3, | ||||||
|  |         headlineSmall = h4, | ||||||
|  |  | ||||||
|  |         // Title | ||||||
|  |         titleLarge = h5, | ||||||
|  |         titleMedium = h6, | ||||||
|  |         titleSmall = h7, | ||||||
|  |  | ||||||
|  |         // Body | ||||||
|  |         bodyLarge = large, | ||||||
|  |         bodyMedium = base, | ||||||
|  |         bodySmall = small, | ||||||
|  |  | ||||||
|  |         // Label | ||||||
|  |         labelLarge = extraSmall, | ||||||
|  |         labelMedium = fine, | ||||||
|  |         labelSmall = fine | ||||||
|  |     )*/ | ||||||
|  |  | ||||||
|  |     @Composable | ||||||
|  |     fun asMaterialTypography() = Typography( | ||||||
|         h1 = h1, |         h1 = h1, | ||||||
|         h2 = h2, |         h2 = h2, | ||||||
|         h3 = h3, |         h3 = h3, | ||||||
|         h4 = h4, |         h4 = h4, | ||||||
|         h5 = h5, |         h5 = h5, | ||||||
|         h6 = h6, |         h6 = h6, | ||||||
| ) |         subtitle1 = h7, | ||||||
|  |         subtitle2 = h8, | ||||||
|  |         body1 = base, | ||||||
|  |         body2 = small, | ||||||
|  |         button = base, | ||||||
|  |         caption = small, | ||||||
|  |         overline = fine | ||||||
|  |     ) | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -163,29 +163,26 @@ fun PreviewThemeColors( | |||||||
| @Composable | @Composable | ||||||
| private fun ThemeColors() { | private fun ThemeColors() { | ||||||
|     Column { |     Column { | ||||||
|         Box(Modifier.background(MaterialTheme.colors.primary)) { |         Box(Modifier.background(LocalColors.current.primary)) { | ||||||
|             Text("primary", style = base) |             Text("primary", style = LocalType.current.base) | ||||||
|         } |         } | ||||||
|         Box(Modifier.background(MaterialTheme.colors.primaryVariant)) { |         Box(Modifier.background(LocalColors.current.background)) { | ||||||
|             Text("primaryVariant", style = base) |             Text("background", style = LocalType.current.base) | ||||||
|         } |         } | ||||||
|         Box(Modifier.background(MaterialTheme.colors.secondary)) { |         Box(Modifier.background(LocalColors.current.backgroundSecondary)) { | ||||||
|             Text("secondary", style = base) |             Text("backgroundSecondary", style = LocalType.current.base) | ||||||
|         } |         } | ||||||
|         Box(Modifier.background(MaterialTheme.colors.secondaryVariant)) { |         Box(Modifier.background(LocalColors.current.text)) { | ||||||
|             Text("secondaryVariant", style = base) |             Text("text", style = LocalType.current.base) | ||||||
|         } |         } | ||||||
|         Box(Modifier.background(MaterialTheme.colors.surface)) { |         Box(Modifier.background(LocalColors.current.textSecondary)) { | ||||||
|             Text("surface", style = base) |             Text("textSecondary", style = LocalType.current.base) | ||||||
|         } |         } | ||||||
|         Box(Modifier.background(MaterialTheme.colors.primarySurface)) { |         Box(Modifier.background(LocalColors.current.danger)) { | ||||||
|             Text("primarySurface", style = base) |             Text("danger", style = LocalType.current.base) | ||||||
|         } |         } | ||||||
|         Box(Modifier.background(MaterialTheme.colors.background)) { |         Box(Modifier.background(LocalColors.current.borders)) { | ||||||
|             Text("background", style = base) |             Text("border", style = LocalType.current.base) | ||||||
|         } |  | ||||||
|         Box(Modifier.background(MaterialTheme.colors.error)) { |  | ||||||
|             Text("error", style = base) |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -21,6 +21,8 @@ import org.session.libsession.utilities.AppTextSecurePreferences | |||||||
|  |  | ||||||
| // Globally accessible composition local objects | // Globally accessible composition local objects | ||||||
| val LocalColors = compositionLocalOf <ThemeColors> { ClassicDark() } | val LocalColors = compositionLocalOf <ThemeColors> { ClassicDark() } | ||||||
|  | val LocalType = compositionLocalOf { sessionTypography } | ||||||
|  |  | ||||||
| var selectedTheme: ThemeColors? = null | var selectedTheme: ThemeColors? = null | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -51,11 +53,12 @@ fun SessionMaterialTheme( | |||||||
| ) { | ) { | ||||||
|     MaterialTheme( |     MaterialTheme( | ||||||
|         colors = colors.toMaterialColors(), |         colors = colors.toMaterialColors(), | ||||||
|         typography = sessionTypography, |         typography = sessionTypography.asMaterialTypography(), | ||||||
|         shapes = sessionShapes, |         shapes = sessionShapes, | ||||||
|     ) { |     ) { | ||||||
|         CompositionLocalProvider( |         CompositionLocalProvider( | ||||||
|             LocalColors provides colors, |             LocalColors provides colors, | ||||||
|  |             LocalType provides sessionTypography, | ||||||
|             LocalContentColor provides colors.text, |             LocalContentColor provides colors.text, | ||||||
|             LocalTextSelectionColors provides colors.textSelectionColors, |             LocalTextSelectionColors provides colors.textSelectionColors, | ||||||
|         ) { |         ) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 ThomasSession
					ThomasSession