Remove fontSize parameter. Must use style only.
This commit is contained in:
parent
b31a449338
commit
2844dee6d2
19 changed files with 37 additions and 31 deletions
|
|
@ -81,7 +81,7 @@ fun LoadingRoomNodeView(
|
|||
Text(
|
||||
text = stringResource(id = CommonStrings.error_unknown),
|
||||
color = ElementTheme.colors.textSecondary,
|
||||
fontSize = 14.sp,
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
)
|
||||
} else {
|
||||
CircularProgressIndicator()
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ fun AddPeopleViewTopBar(
|
|||
val textActionResId = if (hasSelectedUsers) CommonStrings.action_next else CommonStrings.action_skip
|
||||
Text(
|
||||
text = stringResource(id = textActionResId),
|
||||
fontSize = 16.sp,
|
||||
style = ElementTheme.typography.fontBodyLgMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ fun RoomPrivacyOption(
|
|||
) {
|
||||
Text(
|
||||
text = roomPrivacyItem.title,
|
||||
fontSize = 16.sp,
|
||||
style = ElementTheme.typography.fontBodyLgRegular,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
Spacer(Modifier.size(3.dp))
|
||||
|
|
|
|||
|
|
@ -43,11 +43,9 @@ import androidx.compose.ui.focus.FocusManager
|
|||
import androidx.compose.ui.input.pointer.pointerInput
|
||||
import androidx.compose.ui.platform.LocalFocusManager
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import io.element.android.features.createroom.impl.R
|
||||
import io.element.android.features.createroom.impl.components.RoomPrivacyOption
|
||||
import io.element.android.libraries.architecture.Async
|
||||
|
|
@ -199,7 +197,7 @@ fun ConfigureRoomToolbar(
|
|||
) {
|
||||
Text(
|
||||
text = stringResource(CommonStrings.action_create),
|
||||
fontSize = 16.sp,
|
||||
style = ElementTheme.typography.fontBodyLgMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ import io.element.android.libraries.designsystem.R
|
|||
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.designsystem.utils.OnLifecycleEvent
|
||||
import io.element.android.libraries.theme.ElementTheme
|
||||
import me.saket.telephoto.zoomable.ZoomSpec
|
||||
import me.saket.telephoto.zoomable.ZoomableState
|
||||
import me.saket.telephoto.zoomable.coil.ZoomableAsyncImage
|
||||
|
|
@ -238,7 +239,7 @@ fun MediaFileView(
|
|||
Text(
|
||||
text = info.name,
|
||||
maxLines = 2,
|
||||
fontSize = 16.sp,
|
||||
style = ElementTheme.typography.fontBodyLgRegular,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
textAlign = TextAlign.Center,
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
|
|
@ -246,7 +247,7 @@ fun MediaFileView(
|
|||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
text = formatFileExtensionAndSize(info.fileExtension, info.formattedFileSize),
|
||||
fontSize = 14.sp,
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
|||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.theme.ElementTheme
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
|
|
@ -105,8 +106,10 @@ fun EmojiPicker(
|
|||
),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(text = item.unicode, fontSize = 20.sp)
|
||||
}
|
||||
Text(
|
||||
text = item.unicode,
|
||||
style = ElementTheme.typography.fontHeadingSmRegular,
|
||||
) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,8 +163,8 @@ private fun ContentToPreview(state: BubbleState) {
|
|||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Text(
|
||||
fontSize = 10.sp,
|
||||
text = "${state.groupPosition.javaClass.simpleName} m:${state.isMine.to01()} h:${state.isHighlighted.to01()}"
|
||||
text = "${state.groupPosition.javaClass.simpleName} m:${state.isMine.to01()} h:${state.isHighlighted.to01()}",
|
||||
style = ElementTheme.typography.fontBodyXsRegular,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ private fun ReactionContent(
|
|||
Text(
|
||||
text = reaction.count.toString(),
|
||||
color = if (reaction.isHighlighted) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.secondary,
|
||||
fontSize = 14.sp,
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -336,9 +336,8 @@ private fun MessageSenderInformation(
|
|||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Text(
|
||||
text = sender,
|
||||
fontSize = 14.sp,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
style = ElementTheme.typography.fontBodyMdMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,13 +75,13 @@ fun TimelineItemFileView(
|
|||
text = content.body,
|
||||
color = ElementTheme.materialColors.primary,
|
||||
maxLines = 2,
|
||||
fontSize = 16.sp,
|
||||
style = ElementTheme.typography.fontBodyLgRegular,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
Text(
|
||||
text = content.fileExtensionAndSize + extraPadding.getStr(12.sp),
|
||||
color = ElementTheme.materialColors.secondary,
|
||||
fontSize = 12.sp,
|
||||
style = ElementTheme.typography.fontBodySmRegular,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
|||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.theme.ElementTheme
|
||||
|
||||
@Composable
|
||||
fun TimelineItemInformativeView(
|
||||
|
|
@ -58,7 +59,7 @@ fun TimelineItemInformativeView(
|
|||
Text(
|
||||
fontStyle = FontStyle.Italic,
|
||||
color = MaterialTheme.colorScheme.secondary,
|
||||
fontSize = 14.sp,
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
text = text + extraPadding.getStr(14.sp)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.sp
|
||||
import io.element.android.features.messages.impl.timeline.model.event.TimelineItemStateContent
|
||||
import io.element.android.features.messages.impl.timeline.model.event.aTimelineItemStateEventContent
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.theme.ElementTheme
|
||||
|
||||
@Composable
|
||||
fun TimelineItemStateView(
|
||||
|
|
@ -36,7 +36,7 @@ fun TimelineItemStateView(
|
|||
Text(
|
||||
modifier = modifier,
|
||||
color = MaterialTheme.colorScheme.secondary,
|
||||
fontSize = 13.sp,
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
text = content.body,
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
|||
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||
import io.element.android.libraries.designsystem.theme.components.Surface
|
||||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.theme.ElementTheme
|
||||
|
||||
private val CORNER_RADIUS = 8.dp
|
||||
|
||||
|
|
@ -76,7 +77,7 @@ fun GroupHeaderView(
|
|||
Text(
|
||||
text = text,
|
||||
color = MaterialTheme.colorScheme.secondary,
|
||||
fontSize = 13.sp
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
)
|
||||
val icon = if (isExpanded) {
|
||||
Icons.Default.ExpandLess
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ fun RoomDetailsEditView(
|
|||
) {
|
||||
Text(
|
||||
text = stringResource(CommonStrings.action_save),
|
||||
fontSize = 16.sp,
|
||||
style = ElementTheme.typography.fontBodyLgMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ private fun RoomMemberListTopBar(
|
|||
) {
|
||||
Text(
|
||||
text = stringResource(CommonStrings.action_invite),
|
||||
fontSize = 16.sp,
|
||||
style = ElementTheme.typography.fontBodyLgMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,7 +158,10 @@ internal fun ContentVerifying(verificationFlowStep: FlowStep.Verifying, modifier
|
|||
@Composable
|
||||
internal fun EmojiItemView(emoji: VerificationEmoji, modifier: Modifier = Modifier) {
|
||||
Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = modifier) {
|
||||
Text(emoji.code, fontSize = 34.sp)
|
||||
Text(
|
||||
text = emoji.code,
|
||||
style = ElementTheme.typography.fontBodyMdRegular.copy(fontSize = 34.sp),
|
||||
)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Text(
|
||||
emoji.name,
|
||||
|
|
@ -227,7 +230,10 @@ internal fun BottomMenu(screenState: VerifySelfSessionState, goBack: () -> Unit)
|
|||
onClick = negativeButtonCallback,
|
||||
enabled = negativeButtonEnabled,
|
||||
) {
|
||||
Text(stringResource(negativeButtonTitle), fontSize = 16.sp)
|
||||
Text(
|
||||
text = stringResource(negativeButtonTitle),
|
||||
style = ElementTheme.typography.fontBodyLgMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ private fun InitialsAvatar(
|
|||
Text(
|
||||
modifier = Modifier.align(Alignment.Center),
|
||||
text = avatarData.initial,
|
||||
fontSize = avatarData.size.dp.toSp() / 2,
|
||||
style = ElementTheme.typography.fontBodyMdRegular.copy(fontSize = avatarData.size.dp.toSp() / 2),
|
||||
color = Color.White,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,8 +56,6 @@ fun Text(
|
|||
text: String,
|
||||
modifier: Modifier = Modifier,
|
||||
color: Color = Color.Unspecified,
|
||||
// Will be removed, only style should be used
|
||||
fontSize: TextUnit = TextUnit.Unspecified,
|
||||
fontStyle: FontStyle? = null,
|
||||
textDecoration: TextDecoration? = null,
|
||||
textAlign: TextAlign? = null,
|
||||
|
|
@ -72,7 +70,6 @@ fun Text(
|
|||
text = text,
|
||||
modifier = modifier,
|
||||
color = color,
|
||||
fontSize = fontSize,
|
||||
fontStyle = fontStyle,
|
||||
textDecoration = textDecoration,
|
||||
textAlign = textAlign,
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@ import androidx.compose.runtime.rememberCoroutineScope
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.sp
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||
import io.element.android.libraries.designsystem.theme.components.ModalBottomSheetLayout
|
||||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.matrix.ui.media.AvatarAction
|
||||
import io.element.android.libraries.theme.ElementTheme
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.coroutines.launch
|
||||
|
|
@ -93,7 +93,7 @@ private fun AvatarActionBottomSheetContent(
|
|||
headlineContent = {
|
||||
Text(
|
||||
text = stringResource(action.titleResId),
|
||||
fontSize = 16.sp,
|
||||
style = ElementTheme.typography.fontBodyLgRegular,
|
||||
color = if (action.destructive) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue