UserStyleSetting.ListUserStyleSetting.ListOption

public final class UserStyleSetting.ListUserStyleSetting.ListOption extends UserStyleSetting.Option


Represents choice within a ListUserStyleSetting, these must be enumerated up front.

Summary

Public fields

final @NonNull CharSequence

Localized human readable name for the setting, used in the style selection UI.

final @Nullable Icon

Icon for use in the style selection UI.

final @NonNull UserStyleSetting.Option.Id

Machine readable Id for the style setting.

Public constructors

ListOption(
    @NonNull UserStyleSetting.Option.Id id,
    @NonNull Resources resources,
    @StringRes int displayNameResourceId,
    @Nullable Icon icon
)

Constructs a ListOption.

Inherited methods

From class UserStyleSetting.Option
boolean
int
@NonNull String

Public fields

displayName

@NonNull
public final @NonNull CharSequence displayName

Localized human readable name for the setting, used in the style selection UI.

icon

@Nullable
public final @Nullable Icon icon

Icon for use in the style selection UI.

id

@NonNull
public final @NonNull UserStyleSetting.Option.Id id

Machine readable Id for the style setting. Identifier for the option (or the option itself for CustomValueUserStyleSetting.CustomValueOption), must be unique within the UserStyleSetting. Short ids are encouraged.

Public constructors

ListOption

public final ListOption(
    @NonNull UserStyleSetting.Option.Id id,
    @NonNull Resources resources,
    @StringRes int displayNameResourceId,
    @Nullable Icon icon
)

Constructs a ListOption.

Parameters
@NonNull UserStyleSetting.Option.Id id

The Id of this ListOption, must be unique within the ListUserStyleSetting.

@NonNull Resources resources

The Resources used to load displayNameResourceId.

@StringRes int displayNameResourceId

String resource id for a human readable name for the setting, used in the style selection UI.

@Nullable Icon icon

Icon for use in the style selection UI. This gets sent to the companion over bluetooth and should be small (ideally a few kb in size).