Example usage for android.media AudioManager FX_FOCUS_NAVIGATION_RIGHT

List of usage examples for android.media AudioManager FX_FOCUS_NAVIGATION_RIGHT

Introduction

In this page you can find the example usage for android.media AudioManager FX_FOCUS_NAVIGATION_RIGHT.

Prototype

int FX_FOCUS_NAVIGATION_RIGHT

To view the source code for android.media AudioManager FX_FOCUS_NAVIGATION_RIGHT.

Click Source Link

Document

Focus has moved right

Usage

From source file:edu.ucdavis.glass.sepsis.support.OverviewActivity.java

private GestureDetector createGestureDetector(Context context) {
    GestureDetector gestureDetector = new GestureDetector(context);

    // create a base listener for generic gestures
    gestureDetector.setBaseListener(new GestureDetector.BaseListener() {
        @Override//  w  w w .  j  a va  2s  .co  m
        public boolean onGesture(Gesture gesture) {
            if (gesture == Gesture.TAP) {
                mAudioManager.playSoundEffect(AudioManager.FX_KEY_CLICK);

                // set up AsyncTask
                AsyncTask<String, Void, JSONObject> JSON = new LoadJSONAsyncTask((Context) mContext,
                        "Updating all patient's info...", mContext);

                // run AsyncTask
                JSON.execute(Global.recentPatients.peek().id);
                return true;
            } else if (gesture == Gesture.SWIPE_RIGHT) {
                finish();
                mAudioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_RIGHT);
                startActivity(new Intent(getApplicationContext(), VitalsActivity.class));
                return true;
            } else if (gesture == Gesture.SWIPE_LEFT) {
                finish();
                mAudioManager.playSoundEffect(AudioManager.FX_FOCUS_NAVIGATION_LEFT);
                startActivity(new Intent(getApplicationContext(), SupportActivity.class));
                return true;
            }
            return false;
        }
    });

    return gestureDetector;
}