mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
955 B
Java
39 lines
955 B
Java
14 years ago
|
package com.todoroo.andlib.widget;
|
||
|
|
||
|
|
||
|
import android.app.Activity;
|
||
|
|
||
|
import com.todoroo.andlib.utility.AndroidUtilities;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/**
|
||
|
* All API versions-friendly gesture detector. On SDK < 4, nothing happens
|
||
|
* @author Tim Su <tim@todoroo.com>
|
||
|
*
|
||
|
*/
|
||
|
public class GestureService {
|
||
|
|
||
|
public interface GestureInterface {
|
||
|
public void gesturePerformed(String gesture);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Register gesture detector. If android SDK version is not correct,
|
||
|
* a {@link VerifyError} will be throw. Catch this explicitly.
|
||
|
*
|
||
|
* @param activity
|
||
|
* @param view
|
||
|
* @param gestureLibrary
|
||
|
* @param listener
|
||
|
* @throws VerifyError
|
||
|
*/
|
||
|
public static void registerGestureDetector(Activity activity, int view,
|
||
|
int gestureLibrary, GestureInterface listener) throws VerifyError {
|
||
|
if(AndroidUtilities.getSdkVersion() > 3)
|
||
|
new Api4GestureDetector(activity, view, gestureLibrary, listener);
|
||
|
}
|
||
|
|
||
|
}
|