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),
modifier = Modifier.itemDefaultPadding(),
) {
ButtonIcon(onClick = { }, imageVector = Icons.Outlined.celebration)
ButtonIcon(onClick = { }, imageVector = Icons.Outlined.celebration, enabled = false)
ButtonIcon(onClick = { }, imageVector = Icons.Outlined.Celebration)
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) },
trailingIcon = {
if (state.value.showTrailingIcon) {
Icon(imageVector = Icons.Filled.user)
Icon(imageVector = Icons.Filled.User)
}
},
isEnabled = !state.value.isDisabled,

View file

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

View file

@ -11,7 +11,7 @@ internal fun ButtonIconPreview() {
PreviewWithThemes {
ButtonIcon(
onClick = { },
imageVector = Icons.Outlined.info,
imageVector = Icons.Outlined.Info,
)
}
}
@ -22,7 +22,7 @@ internal fun ButtonIconFilledPreview() {
PreviewWithThemes {
ButtonIcon(
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() {
PreviewWithThemes {
Icon(
imageVector = Icons.Filled.error,
imageVector = Icons.Filled.Error,
)
}
}
@ -20,7 +20,7 @@ internal fun IconPreview() {
internal fun IconTintedPreview() {
PreviewWithThemes {
Icon(
imageVector = Icons.Filled.error,
imageVector = Icons.Filled.Error,
tint = Color.Magenta,
)
}

View file

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

View file

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

View file

@ -70,7 +70,7 @@ internal fun ScaffoldWitFabPreview() {
floatingActionButton = {
ButtonIcon(
onClick = { },
imageVector = Icons.Outlined.check,
imageVector = Icons.Outlined.Check,
)
},
) { 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.Info
import androidx.compose.material.icons.outlined.Menu
import androidx.compose.material.icons.outlined.WarningAmber
import androidx.compose.ui.graphics.vector.ImageVector
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.
object Icons {
object Filled {
val error: ImageVector
val Error: ImageVector
get() = MaterialIcons.Filled.Error
val inbox: ImageVector
val Inbox: ImageVector
get() = MaterialIcons.Filled.MoveToInbox
val outbox: ImageVector
val Outbox: ImageVector
get() = MaterialIcons.Filled.Outbox
val security: ImageVector
val Security: ImageVector
get() = MaterialIcons.Filled.Security
val passwordVisibility: ImageVector
val PasswordVisibility: ImageVector
get() = MaterialIcons.Filled.Visibility
val passwordVisibilityOff: ImageVector
val PasswordVisibilityOff: ImageVector
get() = MaterialIcons.Filled.VisibilityOff
val user: ImageVector
val User: ImageVector
get() = MaterialIcons.Filled.AccountCircle
val check: ImageVector
val Check: ImageVector
get() = MaterialIcons.Filled.CheckCircle
val cancel: ImageVector
val Cancel: ImageVector
get() = MaterialIcons.Filled.Cancel
}
object Outlined {
val arrowBack: ImageVector
val ArrowBack: ImageVector
get() = MaterialIcons.AutoMirrored.Outlined.ArrowBack
val arrowDropDown: ImageVector
val ArrowDropDown: ImageVector
get() = MaterialIcons.Outlined.ArrowDropDown
val celebration: ImageVector
val Celebration: ImageVector
get() = MaterialIcons.Outlined.Celebration
val menu: ImageVector
val Menu: ImageVector
get() = MaterialIcons.Outlined.Menu
val check: ImageVector
val Check: ImageVector
get() = MaterialIcons.Outlined.Check
val info: ImageVector
val Info: ImageVector
get() = MaterialIcons.Outlined.Info
val warning: ImageVector
get() = MaterialIcons.Outlined.WarningAmber
val error: ImageVector
val Error: ImageVector
get() = MaterialIcons.Outlined.ErrorOutline
val expandMore: ImageVector
val ExpandMore: ImageVector
get() = MaterialIcons.Outlined.ExpandMore
val expandLess: ImageVector
val ExpandLess: ImageVector
get() = MaterialIcons.Outlined.ExpandLess
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -55,7 +55,7 @@ internal fun AutoDiscoveryResultHeaderView(
}
if (state.isExpandable) {
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),
)
}

View file

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

View file

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

View file

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