IconKt

Added in 1.0.0-alpha01

public final class IconKt


Summary

Public methods

static final void
@Composable
Icon(
    @NonNull ImageBitmap bitmap,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws bitmap, with a default size of LocalIconSize, and applies a content color tint.

static final void
@Composable
Icon(
    @NonNull ImageVector imageVector,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws imageVector, with a default size of LocalIconSize, and applies a content color tint.

static final void
@Composable
Icon(
    @NonNull Painter painter,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws painter, with a default size of LocalIconSize, and applies a content color tint.

static final void
@Composable
Icon(
    @NonNull ImageBitmap bitmap,
    @NonNull Color tint,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws bitmap, with a default size of LocalIconSize, and applies a tint of tint.

static final void
@Composable
Icon(
    @NonNull ImageVector imageVector,
    @NonNull Color tint,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws imageVector, with a default size of LocalIconSize, and applies a tint of tint.

static final void
@Composable
Icon(
    @NonNull Painter painter,
    ColorProducer tint,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws painter, with a default size of LocalIconSize, and applies a tint of tint.

static final @NonNull ProvidableCompositionLocal<@NonNull Dp>

CompositionLocal containing the preferred size of an icon.

Public methods

@Composable
public static final void Icon(
    @NonNull ImageBitmap bitmap,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws bitmap, with a default size of LocalIconSize, and applies a content color tint. Icon is an opinionated component designed to be used with single-color icons so that they can be tinted correctly for the component they are placed in. The recommended icon sizes can be retrieved using GlimmerTheme.Companion.iconSizes. A size can be set explicitly using size, and components can use LocalIconSize to set the preferred size for any Icons inside the component. The content color used to tint this icon is provided by surface. To set a custom tint color, use the Icon overload with a tint parameter. For multicolored icons and icons that should not be tinted, use the overload and set Color.Unspecified as the tint color. For generic images that should not be tinted, and should not use the provided icon size, use the generic androidx.compose.foundation.Image instead.

Parameters
@NonNull ImageBitmap bitmap

ImageBitmap to draw inside this icon

String contentDescription

text used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar

@NonNull Modifier modifier

the Modifier to be applied to this icon

@Composable
public static final void Icon(
    @NonNull ImageVector imageVector,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws imageVector, with a default size of LocalIconSize, and applies a content color tint. Icon is an opinionated component designed to be used with single-color icons so that they can be tinted correctly for the component they are placed in. The recommended icon sizes can be retrieved using GlimmerTheme.Companion.iconSizes. A size can be set explicitly using size, and components can use LocalIconSize to set the preferred size for any Icons inside the component. The content color used to tint this icon is provided by surface. To set a custom tint color, use the Icon overload with a tint parameter. For multicolored icons and icons that should not be tinted, use the overload and set Color.Unspecified as the tint color. For generic images that should not be tinted, and should not use the provided icon size, use the generic androidx.compose.foundation.Image instead.

Parameters
@NonNull ImageVector imageVector

ImageVector to draw inside this icon

String contentDescription

text used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar

@NonNull Modifier modifier

the Modifier to be applied to this icon

@Composable
public static final void Icon(
    @NonNull Painter painter,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws painter, with a default size of LocalIconSize, and applies a content color tint. Icon is an opinionated component designed to be used with single-color icons so that they can be tinted correctly for the component they are placed in. The recommended icon sizes can be retrieved using GlimmerTheme.Companion.iconSizes. A size can be set explicitly using size, and components can use LocalIconSize to set the preferred size for any Icons inside the component. The content color used to tint this icon is provided by surface. To set a custom tint color, use the Icon overload with a tint parameter. For multicolored icons and icons that should not be tinted, use the overload and set null for the tint parameter. For generic images that should not be tinted, and should not use the provided icon size, use the generic androidx.compose.foundation.Image instead.

Parameters
@NonNull Painter painter

Painter to draw inside this icon

String contentDescription

text used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar

@NonNull Modifier modifier

the Modifier to be applied to this icon

@Composable
public static final void Icon(
    @NonNull ImageBitmap bitmap,
    @NonNull Color tint,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws bitmap, with a default size of LocalIconSize, and applies a tint of tint. Icon is an opinionated component designed to be used with single-color icons so that they can be tinted correctly for the component they are placed in. The recommended icon sizes can be retrieved using GlimmerTheme.Companion.iconSizes. A size can be set explicitly using size, and components can use LocalIconSize to set the preferred size for any Icons inside the component. Use the other overload of Icon without a tint parameter to apply the recommended content color provided by a surface. For multicolored icons and icons that should not be tinted, set tint to Color.Unspecified. For generic images that should not be tinted, and should not use the provided icon size, use the generic androidx.compose.foundation.Image instead.

Parameters
@NonNull ImageBitmap bitmap

ImageBitmap to draw inside this icon

@NonNull Color tint

tint to be applied to bitmap. If Color.Unspecified is provided, then no tint is applied.

String contentDescription

text used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar

@NonNull Modifier modifier

the Modifier to be applied to this icon

@Composable
public static final void Icon(
    @NonNull ImageVector imageVector,
    @NonNull Color tint,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws imageVector, with a default size of LocalIconSize, and applies a tint of tint. Icon is an opinionated component designed to be used with single-color icons so that they can be tinted correctly for the component they are placed in. The recommended icon sizes can be retrieved using GlimmerTheme.Companion.iconSizes. A size can be set explicitly using size, and components can use LocalIconSize to set the preferred size for any Icons inside the component. Use the other overload of Icon without a tint parameter to apply the recommended content color provided by a surface. For multicolored icons and icons that should not be tinted, set tint to Color.Unspecified. For generic images that should not be tinted, and should not use the provided icon size, use the generic androidx.compose.foundation.Image instead.

Parameters
@NonNull ImageVector imageVector

ImageVector to draw inside this icon

@NonNull Color tint

tint to be applied to imageVector. If Color.Unspecified is provided, then no tint is applied.

String contentDescription

text used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar

@NonNull Modifier modifier

the Modifier to be applied to this icon

@Composable
public static final void Icon(
    @NonNull Painter painter,
    ColorProducer tint,
    String contentDescription,
    @NonNull Modifier modifier
)

An icon component that draws painter, with a default size of LocalIconSize, and applies a tint of tint. Icon is an opinionated component designed to be used with single-color icons so that they can be tinted correctly for the component they are placed in. The recommended icon sizes can be retrieved using GlimmerTheme.Companion.iconSizes. A size can be set explicitly using size, and components can use LocalIconSize to set the preferred size for any Icons inside the component. Use the other overload of Icon without a tint parameter to apply the recommended content color provided by a surface. For multicolored icons and icons that should not be tinted, set tint to null. For generic images that should not be tinted, and should not use the provided icon size, use the generic androidx.compose.foundation.Image instead.

Parameters
@NonNull Painter painter

Painter to draw inside this icon

ColorProducer tint

tint to be applied to painter. If null, then no tint is applied.

String contentDescription

text used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar

@NonNull Modifier modifier

the Modifier to be applied to this icon

getLocalIconSize

public static final @NonNull ProvidableCompositionLocal<@NonNull DpgetLocalIconSize()

CompositionLocal containing the preferred size of an icon. This value will be used by Icon by default - it can be overridden with a size modifier.