UserStyleSetting.BooleanUserStyleSetting.Builder


public final class UserStyleSetting.BooleanUserStyleSetting.Builder


A Builder for BooleanUserStyleSetting.

Summary

Public constructors

Builder(
    @NonNull UserStyleSetting.Id id,
    @NonNull Collection<@NonNull WatchFaceLayer> affectsWatchFaceLayers,
    boolean defaultValue,
    @NonNull Resources resources,
    @StringRes int displayNameResourceId,
    @StringRes int descriptionResourceId
)

This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Public methods

final @NonNull UserStyleSetting.BooleanUserStyleSetting

This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

final @NonNull UserStyleSetting.BooleanUserStyleSetting.Builder

This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

final @NonNull UserStyleSetting.BooleanUserStyleSetting.Builder
setIcon(@NonNull Function0<Icon> iconProvider)

This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

final @NonNull UserStyleSetting.BooleanUserStyleSetting.Builder

This method is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Public constructors

Builder

public Builder(
    @NonNull UserStyleSetting.Id id,
    @NonNull Collection<@NonNull WatchFaceLayer> affectsWatchFaceLayers,
    boolean defaultValue,
    @NonNull Resources resources,
    @StringRes int displayNameResourceId,
    @StringRes int descriptionResourceId
)

Constructs a builder for BooleanUserStyleSetting.

Parameters
@NonNull UserStyleSetting.Id id

Id for the BooleanUserStyleSetting, must be unique.

@NonNull Collection<@NonNull WatchFaceLayer> affectsWatchFaceLayers

Used by the style configuration UI. Describes which watch face rendering layers this style affects.

boolean defaultValue

The default value of the BooleanUserStyleSetting.

@NonNull Resources resources

The Resources from which displayNameResourceId and descriptionResourceId are loaded.

@StringRes int displayNameResourceId

String resource id for a human readable name for the BooleanUserStyleSetting, used in the userStyle selection UI.

@StringRes int descriptionResourceId

String resource id for a human readable description displayed under the displayName in the userStyle selection UI.

Public methods

build

Added in 1.3.0-alpha06
Deprecated in 1.3.0-alpha06
public final @NonNull UserStyleSetting.BooleanUserStyleSetting build()

Constructs the BooleanUserStyleSetting.

setIcon

Added in 1.3.0-alpha06
Deprecated in 1.3.0-alpha06
public final @NonNull UserStyleSetting.BooleanUserStyleSetting.Builder setIcon(@NonNull Icon icon)

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

setIcon

Added in 1.3.0-alpha06
Deprecated in 1.3.0-alpha06
public final @NonNull UserStyleSetting.BooleanUserStyleSetting.Builder setIcon(@NonNull Function0<Icon> iconProvider)

Sets a provider of an Icon for use in the companion userStyle selection UI. This gets lazily evaluated and is sent to the companion over bluetooth and should be small (ideally a few kb in size). Note this is not guaranteed to be called on the calling thread. Note it will be called shortly after watch face initialization completes.

setWatchFaceEditorData

Added in 1.3.0-alpha06
Deprecated in 1.3.0-alpha06
public final @NonNull UserStyleSetting.BooleanUserStyleSetting.Builder setWatchFaceEditorData(
    @NonNull UserStyleSetting.WatchFaceEditorData watchFaceEditorData
)

Sets optional data for an on watch face editor, this will not be sent to the companion and its contents may be used in preference to other fields by an on watch face editor.