Merge pull request #7817 from thunderbird/update_icon_naming

Change naming format of properties in `Icons.Filled` and `Icons.Outlined`
This commit is contained in:
Wolf-Martell Montwé 2024-05-08 12:40:07 +00:00 committed by GitHub
commit d155501590
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 49 additions and 53 deletions

View file

@ -77,8 +77,8 @@ fun LazyGridScope.buttonItems() {
horizontalArrangement = Arrangement.spacedBy(MainTheme.spacings.default), horizontalArrangement = Arrangement.spacedBy(MainTheme.spacings.default),
modifier = Modifier.itemDefaultPadding(), modifier = Modifier.itemDefaultPadding(),
) { ) {
ButtonIcon(onClick = { }, imageVector = Icons.Outlined.celebration) ButtonIcon(onClick = { }, imageVector = Icons.Outlined.Celebration)
ButtonIcon(onClick = { }, imageVector = Icons.Outlined.celebration, enabled = false) ButtonIcon(onClick = { }, imageVector = Icons.Outlined.Celebration, enabled = false)
} }
} }
} }

View file

@ -160,7 +160,7 @@ private fun LazyGridScope.textFieldOutlinedItems() {
onValueChange = { state.value = state.value.copy(input = it) }, onValueChange = { state.value = state.value.copy(input = it) },
trailingIcon = { trailingIcon = {
if (state.value.showTrailingIcon) { if (state.value.showTrailingIcon) {
Icon(imageVector = Icons.Filled.user) Icon(imageVector = Icons.Filled.User)
} }
}, },
isEnabled = !state.value.isDisabled, isEnabled = !state.value.isDisabled,

View file

@ -20,7 +20,7 @@ fun LazyGridScope.appBarItems() {
ItemOutlined { ItemOutlined {
TopAppBarItem( TopAppBarItem(
title = "Title", title = "Title",
actionIcon = Icons.Outlined.celebration, actionIcon = Icons.Outlined.Celebration,
) )
} }
} }
@ -57,7 +57,7 @@ fun TopAppBarItem(
navIcon?.let { navIcon?.let {
ButtonIcon( ButtonIcon(
onClick = {}, onClick = {},
imageVector = Icons.Outlined.menu, imageVector = Icons.Outlined.Menu,
) )
} }
}, },

View file

@ -11,7 +11,7 @@ internal fun ButtonIconPreview() {
PreviewWithThemes { PreviewWithThemes {
ButtonIcon( ButtonIcon(
onClick = { }, onClick = { },
imageVector = Icons.Outlined.info, imageVector = Icons.Outlined.Info,
) )
} }
} }
@ -22,7 +22,7 @@ internal fun ButtonIconFilledPreview() {
PreviewWithThemes { PreviewWithThemes {
ButtonIcon( ButtonIcon(
onClick = { }, onClick = { },
imageVector = Icons.Filled.cancel, imageVector = Icons.Filled.Cancel,
) )
} }
} }

View file

@ -10,7 +10,7 @@ import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes
internal fun IconPreview() { internal fun IconPreview() {
PreviewWithThemes { PreviewWithThemes {
Icon( Icon(
imageVector = Icons.Filled.error, imageVector = Icons.Filled.Error,
) )
} }
} }
@ -20,7 +20,7 @@ internal fun IconPreview() {
internal fun IconTintedPreview() { internal fun IconTintedPreview() {
PreviewWithThemes { PreviewWithThemes {
Icon( Icon(
imageVector = Icons.Filled.error, imageVector = Icons.Filled.Error,
tint = Color.Magenta, tint = Color.Magenta,
) )
} }

View file

@ -73,7 +73,7 @@ internal fun TextFieldOutlinedWithTrailingIconPreview() {
TextFieldOutlined( TextFieldOutlined(
value = "", value = "",
onValueChange = {}, onValueChange = {},
trailingIcon = { Icon(imageVector = Icons.Filled.user) }, trailingIcon = { Icon(imageVector = Icons.Filled.User) },
isRequired = true, isRequired = true,
) )
} }

View file

@ -25,15 +25,15 @@ internal fun TopAppBarWithActionsPreview() {
actions = { actions = {
ButtonIcon( ButtonIcon(
onClick = {}, onClick = {},
imageVector = Icons.Outlined.info, imageVector = Icons.Outlined.Info,
) )
ButtonIcon( ButtonIcon(
onClick = {}, onClick = {},
imageVector = Icons.Outlined.check, imageVector = Icons.Outlined.Check,
) )
ButtonIcon( ButtonIcon(
onClick = {}, onClick = {},
imageVector = Icons.Outlined.celebration, imageVector = Icons.Outlined.Celebration,
) )
}, },
) )

View file

@ -70,7 +70,7 @@ internal fun ScaffoldWitFabPreview() {
floatingActionButton = { floatingActionButton = {
ButtonIcon( ButtonIcon(
onClick = { }, onClick = { },
imageVector = Icons.Outlined.check, imageVector = Icons.Outlined.Check,
) )
}, },
) { contentPadding -> ) { contentPadding ->

View file

@ -18,70 +18,66 @@ import androidx.compose.material.icons.outlined.ExpandLess
import androidx.compose.material.icons.outlined.ExpandMore import androidx.compose.material.icons.outlined.ExpandMore
import androidx.compose.material.icons.outlined.Info import androidx.compose.material.icons.outlined.Info
import androidx.compose.material.icons.outlined.Menu import androidx.compose.material.icons.outlined.Menu
import androidx.compose.material.icons.outlined.WarningAmber
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.material.icons.Icons as MaterialIcons import androidx.compose.material.icons.Icons as MaterialIcons
// We're using getters so not all icons are loaded into memory as soon as one of the nested objects is accessed. // We're using getters so not all icons are loaded into memory as soon as one of the nested objects is accessed.
object Icons { object Icons {
object Filled { object Filled {
val error: ImageVector val Error: ImageVector
get() = MaterialIcons.Filled.Error get() = MaterialIcons.Filled.Error
val inbox: ImageVector val Inbox: ImageVector
get() = MaterialIcons.Filled.MoveToInbox get() = MaterialIcons.Filled.MoveToInbox
val outbox: ImageVector val Outbox: ImageVector
get() = MaterialIcons.Filled.Outbox get() = MaterialIcons.Filled.Outbox
val security: ImageVector val Security: ImageVector
get() = MaterialIcons.Filled.Security get() = MaterialIcons.Filled.Security
val passwordVisibility: ImageVector val PasswordVisibility: ImageVector
get() = MaterialIcons.Filled.Visibility get() = MaterialIcons.Filled.Visibility
val passwordVisibilityOff: ImageVector val PasswordVisibilityOff: ImageVector
get() = MaterialIcons.Filled.VisibilityOff get() = MaterialIcons.Filled.VisibilityOff
val user: ImageVector val User: ImageVector
get() = MaterialIcons.Filled.AccountCircle get() = MaterialIcons.Filled.AccountCircle
val check: ImageVector val Check: ImageVector
get() = MaterialIcons.Filled.CheckCircle get() = MaterialIcons.Filled.CheckCircle
val cancel: ImageVector val Cancel: ImageVector
get() = MaterialIcons.Filled.Cancel get() = MaterialIcons.Filled.Cancel
} }
object Outlined { object Outlined {
val arrowBack: ImageVector val ArrowBack: ImageVector
get() = MaterialIcons.AutoMirrored.Outlined.ArrowBack get() = MaterialIcons.AutoMirrored.Outlined.ArrowBack
val arrowDropDown: ImageVector val ArrowDropDown: ImageVector
get() = MaterialIcons.Outlined.ArrowDropDown get() = MaterialIcons.Outlined.ArrowDropDown
val celebration: ImageVector val Celebration: ImageVector
get() = MaterialIcons.Outlined.Celebration get() = MaterialIcons.Outlined.Celebration
val menu: ImageVector val Menu: ImageVector
get() = MaterialIcons.Outlined.Menu get() = MaterialIcons.Outlined.Menu
val check: ImageVector val Check: ImageVector
get() = MaterialIcons.Outlined.Check get() = MaterialIcons.Outlined.Check
val info: ImageVector val Info: ImageVector
get() = MaterialIcons.Outlined.Info get() = MaterialIcons.Outlined.Info
val warning: ImageVector val Error: ImageVector
get() = MaterialIcons.Outlined.WarningAmber
val error: ImageVector
get() = MaterialIcons.Outlined.ErrorOutline get() = MaterialIcons.Outlined.ErrorOutline
val expandMore: ImageVector val ExpandMore: ImageVector
get() = MaterialIcons.Outlined.ExpandMore get() = MaterialIcons.Outlined.ExpandMore
val expandLess: ImageVector val ExpandLess: ImageVector
get() = MaterialIcons.Outlined.ExpandLess get() = MaterialIcons.Outlined.ExpandLess
} }
} }

View file

@ -27,7 +27,7 @@ fun TextFieldOutlinedFakeSelect(
.then(modifier), .then(modifier),
readOnly = true, readOnly = true,
label = optionalLabel(label), label = optionalLabel(label),
trailingIcon = { Icon(Icons.Outlined.arrowDropDown) }, trailingIcon = { Icon(Icons.Outlined.ArrowDropDown) },
singleLine = true, singleLine = true,
interactionSource = remember { MutableInteractionSource() } interactionSource = remember { MutableInteractionSource() }
.also { interactionSource -> .also { interactionSource ->

View file

@ -97,9 +97,9 @@ private fun selectTrailingIcon(
return if (hasTrailingIcon) { return if (hasTrailingIcon) {
{ {
val image = if (isShowPasswordAllowed(isEnabled, isPasswordVisible)) { val image = if (isShowPasswordAllowed(isEnabled, isPasswordVisible)) {
Icons.Filled.passwordVisibility Icons.Filled.PasswordVisibility
} else { } else {
Icons.Filled.passwordVisibilityOff Icons.Filled.PasswordVisibilityOff
} }
val description = if (isShowPasswordAllowed(isEnabled, isPasswordVisible)) { val description = if (isShowPasswordAllowed(isEnabled, isPasswordVisible)) {

View file

@ -45,7 +45,7 @@ fun ErrorView(
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
) { ) {
Icon( Icon(
imageVector = Icons.Filled.error, imageVector = Icons.Filled.Error,
tint = MainTheme.colors.error, tint = MainTheme.colors.error,
) )
Spacer(modifier = Modifier.height(MainTheme.spacings.double)) Spacer(modifier = Modifier.height(MainTheme.spacings.double))

View file

@ -43,7 +43,7 @@ fun TopAppBarWithMenuButton(
navigationIcon = { navigationIcon = {
ButtonIcon( ButtonIcon(
onClick = onMenuClick, onClick = onMenuClick,
imageVector = Icons.Outlined.menu, imageVector = Icons.Outlined.Menu,
) )
}, },
actions = actions, actions = actions,
@ -63,7 +63,7 @@ fun TopAppBarWithBackButton(
navigationIcon = { navigationIcon = {
ButtonIcon( ButtonIcon(
onClick = onBackClick, onClick = onBackClick,
imageVector = Icons.Outlined.arrowBack, imageVector = Icons.Outlined.ArrowBack,
) )
}, },
actions = actions, actions = actions,

View file

@ -36,7 +36,7 @@ fun SuccessView(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Icon( Icon(
imageVector = Icons.Outlined.celebration, imageVector = Icons.Outlined.Celebration,
tint = MainTheme.colors.secondary, tint = MainTheme.colors.secondary,
modifier = Modifier.requiredSize(MainTheme.sizes.large), modifier = Modifier.requiredSize(MainTheme.sizes.large),
) )

View file

@ -12,21 +12,21 @@ enum class AutoDiscoveryResultHeaderState(
val isExpandable: Boolean, val isExpandable: Boolean,
) { ) {
NoSettings( NoSettings(
icon = Icons.Outlined.info, icon = Icons.Outlined.Info,
titleResourceId = R.string.account_setup_auto_discovery_result_header_title_configuration_not_found, titleResourceId = R.string.account_setup_auto_discovery_result_header_title_configuration_not_found,
subtitleResourceId = R.string.account_setup_auto_discovery_result_header_subtitle_configuration_not_found, subtitleResourceId = R.string.account_setup_auto_discovery_result_header_subtitle_configuration_not_found,
isExpandable = false, isExpandable = false,
), ),
Trusted( Trusted(
icon = Icons.Outlined.check, icon = Icons.Outlined.Check,
titleResourceId = R.string.account_setup_auto_discovery_status_header_title_configuration_found, titleResourceId = R.string.account_setup_auto_discovery_status_header_title_configuration_found,
subtitleResourceId = R.string.account_setup_auto_discovery_result_header_subtitle_configuration_trusted, subtitleResourceId = R.string.account_setup_auto_discovery_result_header_subtitle_configuration_trusted,
isExpandable = true, isExpandable = true,
), ),
Untrusted( Untrusted(
icon = Icons.Outlined.info, icon = Icons.Outlined.Info,
titleResourceId = R.string.account_setup_auto_discovery_status_header_title_configuration_found, titleResourceId = R.string.account_setup_auto_discovery_status_header_title_configuration_found,
subtitleResourceId = R.string.account_setup_auto_discovery_result_header_subtitle_configuration_untrusted, subtitleResourceId = R.string.account_setup_auto_discovery_result_header_subtitle_configuration_untrusted,
isExpandable = true, isExpandable = true,

View file

@ -55,7 +55,7 @@ internal fun AutoDiscoveryResultHeaderView(
} }
if (state.isExpandable) { if (state.isExpandable) {
Icon( Icon(
imageVector = if (isExpanded) Icons.Outlined.expandLess else Icons.Outlined.expandMore, imageVector = if (isExpanded) Icons.Outlined.ExpandLess else Icons.Outlined.ExpandMore,
modifier = Modifier.padding(MainTheme.spacings.default), modifier = Modifier.padding(MainTheme.spacings.default),
) )
} }

View file

@ -53,7 +53,7 @@ internal fun AutoDiscoveryServerSettingsView(
) )
ServerSettingRow( ServerSettingRow(
icon = if (isIncoming) Icons.Filled.inbox else Icons.Filled.outbox, icon = if (isIncoming) Icons.Filled.Inbox else Icons.Filled.Outbox,
text = buildAnnotatedString { text = buildAnnotatedString {
append("Server") append("Server")
append(": ") append(": ")
@ -70,7 +70,7 @@ internal fun AutoDiscoveryServerSettingsView(
) )
ServerSettingRow( ServerSettingRow(
icon = Icons.Filled.security, icon = Icons.Filled.Security,
text = buildAnnotatedString { text = buildAnnotatedString {
append("Security: ") append("Security: ")
append(connectionSecurity.toAutoDiscoveryConnectionSecurityString(resources)) append(connectionSecurity.toAutoDiscoveryConnectionSecurityString(resources))
@ -79,7 +79,7 @@ internal fun AutoDiscoveryServerSettingsView(
if (username.isNotEmpty()) { if (username.isNotEmpty()) {
ServerSettingRow( ServerSettingRow(
icon = Icons.Filled.user, icon = Icons.Filled.User,
text = buildAnnotatedString { text = buildAnnotatedString {
append("Username: ") append("Username: ")
append(username) append(username)

View file

@ -101,7 +101,7 @@ private fun IconWithPermissionStateOverlay(
UiPermissionState.Unknown -> Unit UiPermissionState.Unknown -> Unit
UiPermissionState.Granted -> { UiPermissionState.Granted -> {
Icon( Icon(
imageVector = Icons.Filled.check, imageVector = Icons.Filled.Check,
tint = MainTheme.colors.success, tint = MainTheme.colors.success,
modifier = Modifier modifier = Modifier
.size(overlayIconSize) .size(overlayIconSize)
@ -114,7 +114,7 @@ private fun IconWithPermissionStateOverlay(
UiPermissionState.Denied -> { UiPermissionState.Denied -> {
Icon( Icon(
imageVector = Icons.Filled.cancel, imageVector = Icons.Filled.Cancel,
tint = MainTheme.colors.warning, tint = MainTheme.colors.warning,
modifier = Modifier modifier = Modifier
.size(overlayIconSize) .size(overlayIconSize)

View file

@ -30,7 +30,7 @@ fun SettingsImportScreen(
navigationIcon = { navigationIcon = {
ButtonIcon( ButtonIcon(
onClick = onBack, onClick = onBack,
imageVector = Icons.Outlined.arrowBack, imageVector = Icons.Outlined.ArrowBack,
) )
}, },
) )