Skip to content

ShadowGadgets

zed-alpha edited this page May 10, 2026 · 1 revision

Package: com.zedalpha.shadowgadgets.view


ShadowGadgets

(docs)

public object ShadowGadgets

A helper object to hold properties and other miscellanea that affect the library as a whole.


isPrimaryDrawMethodAvailable

(docs)

public val isPrimaryDrawMethodAvailable: Boolean

Indicates whether the library is able to use the primary draw method in the current environment.

isPrimaryDrawMethodEnabled

(docs)

public val isPrimaryDrawMethodEnabled: Boolean

Indicates whether the library is using the primary draw method.

Shadows are assigned a method during their initializations, so this value does not necessarily mean that all current shadows are using the same method. If this is toggled at runtime, the shadows must be as well.

This is affected by forceFallbackDrawMethod; i.e., if that is true, this is false, regardless of isPrimaryDrawMethodAvailable's value.

forceFallbackDrawMethod

(docs)

public var forceFallbackDrawMethod: Boolean = false

Forces the library to use the fallback draw method, for easy testing and debugging.

Normally, the fallback method is used only on API levels 21..28 if the library is unable to access the (hidden) classes and methods for the primary method in the current environment.

throwOnUnhandledErrors

(docs)

public var throwOnUnhandledErrors: Boolean = false

The library is now pro-Exception in lieu of failing silently, but that's a hefty change to drop suddenly, so it will sit behind this flag for the time being. This should be set as early as possible, like in an Application subclass, as is shown in the example linked below.

When this is true, known error states will throw ShadowExceptions if the target View has no doOnShadowModeChange handler set. If it does, it's assumed that ShadowMode.Errors will be handled there.

suppressLogs

(docs)

public var suppressLogs: Boolean = false

This turns off debug logs for known error states. There are no release logs.


Examples

The demo app's DemoApplication has examples of enabling throwOnUnhandledErrors and forceFallbackDrawMethod.

Clone this wiki locally