Example usage for android.app StatusBarManager CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP

List of usage examples for android.app StatusBarManager CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP

Introduction

In this page you can find the example usage for android.app StatusBarManager CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP.

Prototype

int CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP

To view the source code for android.app StatusBarManager CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP.

Click Source Link

Usage

From source file:com.android.systemui.statusbar.phone.NotificationPanelView.java

public void launchCamera(boolean animate, int source) {
    if (source == StatusBarManager.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP) {
        mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP;
    } else if (source == StatusBarManager.CAMERA_LAUNCH_SOURCE_WIGGLE) {
        mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_WIGGLE;
    } else {//from  w w w . ja v a 2 s  . c o m

        // Default.
        mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_AFFORDANCE;
    }

    // If we are launching it when we are occluded already we don't want it to animate,
    // nor setting these flags, since the occluded state doesn't change anymore, hence it's
    // never reset.
    if (!isFullyCollapsed()) {
        mLaunchingAffordance = true;
        setLaunchingAffordance(true);
    } else {
        animate = false;
    }
    mAfforanceHelper.launchAffordance(animate, getLayoutDirection() == LAYOUT_DIRECTION_RTL);
}