WebFeature


public static class WebFeature


Utility class for checking which Web features are supported on the device.

Summary

Constants

static final @NonNull String

Feature for WebContent.

static final @NonNull String

Feature for WebSurface.

Public fields

static @NonNull WebFeature

Public methods

static final boolean

Returns whether feature is supported at runtime.

Constants

WEB_CONTENT

Added in 1.0.0-alpha02
public static final @NonNull String WEB_CONTENT

Feature for WebContent.

WEB_SURFACE

Added in 1.0.0-alpha02
public static final @NonNull String WEB_SURFACE

Feature for WebSurface.

Public fields

INSTANCE

Added in 1.0.0-alpha02
public static @NonNull WebFeature INSTANCE

Public methods

isFeatureSupported

Added in 1.0.0-alpha02
public static final boolean isFeatureSupported(@NonNull String feature)

Returns whether feature is supported at runtime.

APIs annotated with androidx.annotation.RequiresFeature throw UnsupportedOperationException on devices where this returns false.

Parameters
@NonNull String feature

the feature to check, either WEB_CONTENT or WEB_SURFACE

Value is one of the following:

  • WEB_CONTENT
  • WEB_SURFACE

Returns
boolean

true if feature is supported by the current WebView, false otherwise