1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.videoeditor.widgets; 18 19 import android.view.MotionEvent; 20 import android.view.View; 21 22 /** 23 * A simple gesture listener which listens to taps and long presses 24 */ 25 interface ItemSimpleGestureListener { 26 // Area tapped 27 public static final int LEFT_AREA = 0; 28 public static final int CENTER_AREA = 1; 29 public static final int RIGHT_AREA = 2; 30 31 /** 32 * This method will only be called after the detector is confident 33 * that the user's first tap is not followed by a second tap leading 34 * to a double-tap gesture. 35 * 36 * @param view The view which received the event 37 * @param area The area tapped 38 * @param e The down motion event of the single-tap. 39 * 40 * @return true if the event is consumed, else false 41 */ 42 public boolean onSingleTapConfirmed(View view, int area, MotionEvent e); 43 44 /** 45 * Notified when a long press occurs with the initial on down 46 * MotionEvent that triggered it. 47 * 48 * @param view The view which received the event 49 * @param e The initial on down motion event that started the 50 * long press. 51 */ 52 public void onLongPress(View view, MotionEvent e); 53 } 54