Example usage for android.app WallpaperManager COMMAND_SECONDARY_TAP

List of usage examples for android.app WallpaperManager COMMAND_SECONDARY_TAP

Introduction

In this page you can find the example usage for android.app WallpaperManager COMMAND_SECONDARY_TAP.

Prototype

String COMMAND_SECONDARY_TAP

To view the source code for android.app WallpaperManager COMMAND_SECONDARY_TAP.

Click Source Link

Document

Command for #sendWallpaperCommand : reported by the wallpaper host when the user releases a secondary pointer on an empty area (not performing an action in the host).

Usage

From source file:cc.flydev.launcher.Workspace.java

protected void onWallpaperTap(MotionEvent ev) {
    final int[] position = mTempCell;
    getLocationOnScreen(position);//from   ww w . jav  a2 s .  com

    int pointerIndex = ev.getActionIndex();
    position[0] += (int) ev.getX(pointerIndex);
    position[1] += (int) ev.getY(pointerIndex);

    mWallpaperManager.sendWallpaperCommand(getWindowToken(),
            ev.getAction() == MotionEvent.ACTION_UP ? WallpaperManager.COMMAND_TAP
                    : WallpaperManager.COMMAND_SECONDARY_TAP,
            position[0], position[1], 0, null);
}