diff --git a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/addpeople/AddPeopleView.kt b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/addpeople/AddPeopleView.kt index acbccff791..f9516ea019 100644 --- a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/addpeople/AddPeopleView.kt +++ b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/addpeople/AddPeopleView.kt @@ -43,6 +43,7 @@ import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.TextButton import io.element.android.libraries.designsystem.theme.components.TopAppBar import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.ui.strings.CommonStrings @OptIn(ExperimentalLayoutApi::class) @@ -98,7 +99,7 @@ fun AddPeopleViewTopBar( title = { Text( text = stringResource(id = R.string.screen_create_room_add_people_title), - style = ElementTheme.typography.fontHeadingSmMedium + style = ElementTheme.typography.aliasScreenTitle ) }, navigationIcon = { BackButton(onClick = onBackPressed) }, diff --git a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomView.kt b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomView.kt index 3e11a0b465..ba71f4a7c6 100644 --- a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomView.kt +++ b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomView.kt @@ -64,6 +64,7 @@ import io.element.android.libraries.matrix.ui.components.AvatarActionBottomSheet import io.element.android.libraries.matrix.ui.components.SelectedUsersList import io.element.android.libraries.matrix.ui.components.UnsavedAvatar import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.ui.strings.CommonStrings import kotlinx.coroutines.launch @@ -185,7 +186,7 @@ fun ConfigureRoomToolbar( title = { Text( text = stringResource(R.string.screen_create_room_title), - style = ElementTheme.typography.fontHeadingSmMedium, + style = ElementTheme.typography.aliasScreenTitle, ) }, navigationIcon = { BackButton(onClick = onBackPressed) }, diff --git a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootView.kt b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootView.kt index a4b6b50c95..437498b553 100644 --- a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootView.kt +++ b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootView.kt @@ -53,6 +53,7 @@ import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.TopAppBar import io.element.android.libraries.matrix.api.core.RoomId import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.ui.strings.CommonStrings import io.element.android.libraries.designsystem.R as DrawableR @@ -137,7 +138,7 @@ fun CreateRoomRootViewTopBar( title = { Text( text = stringResource(id = CommonStrings.action_start_chat), - style = ElementTheme.typography.fontHeadingSmMedium, + style = ElementTheme.typography.aliasScreenTitle, ) }, navigationIcon = { diff --git a/features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/InviteListView.kt b/features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/InviteListView.kt index 7c94b2d015..d4895360c6 100644 --- a/features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/InviteListView.kt +++ b/features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/InviteListView.kt @@ -48,6 +48,7 @@ import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.TopAppBar import io.element.android.libraries.matrix.api.core.RoomId import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.ui.strings.CommonStrings @Composable @@ -127,7 +128,7 @@ fun InviteListContent( title = { Text( text = stringResource(CommonStrings.action_invites_list), - style = ElementTheme.typography.fontHeadingSmMedium, + style = ElementTheme.typography.aliasScreenTitle, ) } ) diff --git a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/SendLocationView.kt b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/SendLocationView.kt index 7ceaea860e..c75ce175ca 100644 --- a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/SendLocationView.kt +++ b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/SendLocationView.kt @@ -52,6 +52,7 @@ import io.element.android.libraries.designsystem.theme.components.Icon import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.TopAppBar import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.ui.strings.CommonStrings import io.element.android.libraries.designsystem.R as DesignSystemR @@ -96,7 +97,7 @@ fun SendLocationView( title = { Text( text = stringResource(CommonStrings.screen_share_location_title), - style = ElementTheme.typography.fontHeadingSmMedium, + style = ElementTheme.typography.aliasScreenTitle, ) }, navigationIcon = { diff --git a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt index e5ed29bad9..108228cb00 100644 --- a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt +++ b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt @@ -45,6 +45,7 @@ import io.element.android.libraries.designsystem.theme.components.Scaffold import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.TopAppBar import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.theme.compound.generated.TypographyTokens import io.element.android.libraries.ui.strings.CommonStrings @@ -66,7 +67,7 @@ fun ShowLocationView( title = { Text( text = stringResource(CommonStrings.screen_view_location_title), - style = ElementTheme.typography.fontHeadingSmMedium, + style = ElementTheme.typography.aliasScreenTitle, ) }, navigationIcon = { diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/forward/ForwardMessagesView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/forward/ForwardMessagesView.kt index 2397485370..148f440e33 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/forward/ForwardMessagesView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/forward/ForwardMessagesView.kt @@ -65,6 +65,7 @@ import io.element.android.libraries.matrix.api.core.RoomId import io.element.android.libraries.matrix.api.room.RoomSummaryDetails import io.element.android.libraries.matrix.ui.components.SelectedRoom import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.ui.strings.CommonStrings import kotlinx.collections.immutable.ImmutableList @@ -113,7 +114,7 @@ fun ForwardMessagesView( title = { Text( text = stringResource(CommonStrings.common_forward_message), - style = ElementTheme.typography.fontHeadingSmMedium + style = ElementTheme.typography.aliasScreenTitle ) }, navigationIcon = { diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/report/ReportMessageView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/report/ReportMessageView.kt index 187ce393c2..6b4351738a 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/report/ReportMessageView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/report/ReportMessageView.kt @@ -53,6 +53,7 @@ import io.element.android.libraries.designsystem.theme.components.Scaffold import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.TopAppBar import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.ui.strings.CommonStrings @OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class) @@ -86,7 +87,7 @@ fun ReportMessageView( title = { Text( stringResource(CommonStrings.action_report_content), - style = ElementTheme.typography.fontHeadingSmMedium, + style = ElementTheme.typography.aliasScreenTitle, ) }, navigationIcon = { diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/debug/EventDebugInfoView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/debug/EventDebugInfoView.kt index 03ba2d6eb9..1d51fdf2b4 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/debug/EventDebugInfoView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/debug/EventDebugInfoView.kt @@ -62,6 +62,7 @@ import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.TopAppBar import io.element.android.libraries.matrix.api.core.EventId import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle /** * Screen used to display debug info for events. @@ -85,7 +86,7 @@ fun EventDebugInfoView( title = { Text( text = "Debug event info", - style = ElementTheme.typography.fontHeadingSmMedium, + style = ElementTheme.typography.aliasScreenTitle, ) }, navigationIcon = { BackButton(onClick = onBackPressed) } diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/edit/RoomDetailsEditView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/edit/RoomDetailsEditView.kt index 0b4ad4527a..5fd1e87a19 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/edit/RoomDetailsEditView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/edit/RoomDetailsEditView.kt @@ -76,6 +76,7 @@ import io.element.android.libraries.designsystem.theme.components.TopAppBar import io.element.android.libraries.matrix.ui.components.AvatarActionBottomSheet import io.element.android.libraries.matrix.ui.components.UnsavedAvatar import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.ui.strings.CommonStrings import kotlinx.coroutines.launch @@ -107,7 +108,7 @@ fun RoomDetailsEditView( title = { Text( text = stringResource(id = R.string.screen_room_details_edit_room_title), - style = ElementTheme.typography.fontHeadingSmMedium, + style = ElementTheme.typography.aliasScreenTitle, ) }, navigationIcon = { BackButton(onClick = onBackPressed) }, diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/invite/RoomInviteMembersView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/invite/RoomInviteMembersView.kt index ab9d14bfd9..9b7a4bca51 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/invite/RoomInviteMembersView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/invite/RoomInviteMembersView.kt @@ -53,6 +53,7 @@ import io.element.android.libraries.matrix.ui.components.SelectedUsersList import io.element.android.libraries.matrix.ui.model.getAvatarData import io.element.android.libraries.matrix.ui.model.getBestName import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.ui.strings.CommonStrings import kotlinx.collections.immutable.ImmutableList @@ -123,7 +124,7 @@ fun RoomInviteMembersTopBar( title = { Text( text = stringResource(R.string.screen_room_details_invite_people_title), - style = ElementTheme.typography.fontHeadingSmMedium, + style = ElementTheme.typography.aliasScreenTitle, ) }, navigationIcon = { BackButton(onClick = onBackPressed) }, diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/RoomMemberListView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/RoomMemberListView.kt index 0cb02668db..faa122e489 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/RoomMemberListView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/RoomMemberListView.kt @@ -60,6 +60,7 @@ import io.element.android.libraries.matrix.api.room.RoomMember import io.element.android.libraries.matrix.api.user.MatrixUser import io.element.android.libraries.matrix.ui.components.MatrixUserRow import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.ui.strings.CommonStrings import kotlinx.collections.immutable.ImmutableList @@ -206,7 +207,7 @@ private fun RoomMemberListTopBar( title = { Text( text = stringResource(R.string.screen_room_details_people_title), - style = ElementTheme.typography.fontHeadingSmMedium, + style = ElementTheme.typography.aliasScreenTitle, ) }, navigationIcon = { BackButton(onClick = onBackPressed) }, diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomListTopBar.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomListTopBar.kt index 956b3c140f..bb511c32ab 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomListTopBar.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomListTopBar.kt @@ -57,6 +57,7 @@ import io.element.android.libraries.matrix.ui.model.getAvatarData import io.element.android.libraries.testtags.TestTags import io.element.android.libraries.testtags.testTag import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle import io.element.android.libraries.ui.strings.CommonStrings @OptIn(ExperimentalMaterial3Api::class) @@ -111,7 +112,7 @@ private fun DefaultRoomListTopBar( .nestedScroll(scrollBehavior.nestedScrollConnection), title = { val fontStyle = if (scrollBehavior.state.collapsedFraction > 0.5) - ElementTheme.typography.fontHeadingSmMedium + ElementTheme.typography.aliasScreenTitle else ElementTheme.typography.fontHeadingLgBold Text( diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt index 5c44d48f24..e4aad1d151 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceScreen.kt @@ -43,6 +43,7 @@ import io.element.android.libraries.designsystem.theme.components.Scaffold import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.TopAppBar import io.element.android.libraries.theme.ElementTheme +import io.element.android.libraries.theme.aliasScreenTitle @OptIn(ExperimentalLayoutApi::class) @Composable @@ -94,7 +95,7 @@ fun PreferenceTopAppBar( title = { Text( text = title, - style = ElementTheme.typography.fontHeadingSmMedium, + style = ElementTheme.typography.aliasScreenTitle, maxLines = 1, overflow = TextOverflow.Ellipsis ) diff --git a/libraries/theme/src/main/kotlin/io/element/android/libraries/theme/TypographyAliases.kt b/libraries/theme/src/main/kotlin/io/element/android/libraries/theme/TypographyAliases.kt new file mode 100644 index 0000000000..1f886a37c0 --- /dev/null +++ b/libraries/theme/src/main/kotlin/io/element/android/libraries/theme/TypographyAliases.kt @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2023 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.libraries.theme + +import androidx.compose.ui.text.TextStyle +import io.element.android.libraries.theme.compound.generated.TypographyTokens + +/* + * This file contains aliases for TypographyTokens. + */ + +val TypographyTokens.aliasScreenTitle: TextStyle + get() = fontHeadingSmMedium