ForegroundGestureSubscriptionParams.Builder

public static final class ForegroundGestureSubscriptionParams.Builder
extends Object

java.lang.Object
   ↳ com.google.wear.input.ForegroundGestureSubscriptionParams.Builder


Builder for ForegroundGestureSubscriptionParams.

Summary

Public constructors

Builder(int[] actions, View view)

Constructs a new instance of ForegroundGestureSubscriptionParams for a View-based subscription.

Builder(int[] actions, Window window)

Constructs a new instance of ForegroundGestureSubscriptionParams for a Window-based subscription.

Public methods

ForegroundGestureSubscriptionParams build()

Builds a new ForegroundGestureSubscriptionParams from this builder object.

ForegroundGestureSubscriptionParams.Builder setAmbientSupported(boolean ambientSupported)

Sets whether GestureEvents should be detected and dispatched in ambient mode.

Inherited methods

Public constructors

Builder

Added in API level 37
public Builder (int[] actions, 
                View view)

Constructs a new instance of ForegroundGestureSubscriptionParams for a View-based subscription.

Parameters
actions int: an array of all the actions to subscribe to. This must be NOT empty, and all actions in this array must be supported (see GestureInputManager.isActionSupported(int)).
Value is one of the following:
view View: the View on which received GestureEvents will be processed. Events are delivered only while the Window hosting this View has focus.

Builder

Added in API level 37
public Builder (int[] actions, 
                Window window)

Constructs a new instance of ForegroundGestureSubscriptionParams for a Window-based subscription.

Parameters
actions int: an array of all the actions to subscribe to. This must be NOT empty, and all actions in this array must be supported (see GestureInputManager.isActionSupported(int)).
Value is one of the following:
window Window: the Window on which received GestureEvents will be processed. This window should have a View attached (Window.peekDecorView() should not be null). Otherwise, an IllegalArgumentException will be thrown. Events are delivered to the listener only while this window has focus.

Public methods

build

Added in API level 37
public ForegroundGestureSubscriptionParams build ()

Builds a new ForegroundGestureSubscriptionParams from this builder object.

Returns
ForegroundGestureSubscriptionParams

setAmbientSupported

Added in API level 37
public ForegroundGestureSubscriptionParams.Builder setAmbientSupported (boolean ambientSupported)

Sets whether GestureEvents should be detected and dispatched in ambient mode. If false, this subscription will be only for when the display's state is Display.STATE_ON.

Parameters
ambientSupported boolean

Returns
ForegroundGestureSubscriptionParams.Builder