问题
I have defined my own gestures in an Android app. Is this the only way to define gestures?
Are there any standard opensource libraries which will already have the gesture's raw file?
回答1:
I have been developing a library to support basic 1 nad 2 finger gestures on Android with a very very simple drop in functionality.
Most gestures can be set as easily as:
view.setOn2FingerGestureListener (new On2FingerGestureListener () {
@Override
onSwipeup() {
}
onSwipedown() {
}
});
The library is opensource and can also be downloaded as a JAR file (.jar).
I haven't decided upon a license yet (will most probably be Apache), so currently it is under NO License.
回答2:
This is the Android documentation which will describe the Gestures. GestureDetector
class contains methods for most of the simple gestures that we need for our small applications.
回答3:
Pretty much all the libraries that have an extended Android touch UI are proprietary... HTC has HTC Sense, Samsung has TouchWiz, etc.
Apple holds a lot of patents for multi-touch things, and I think that their current battles against HTC and other phone manufacturers have discouraged the development of open source solutions. For a developer who invests their time on open source libraries with the hope to create a community around it and then maybe offer it commercially, to expect to receive "cease and desist letters" is not a good incentive.
But, you can always implement multi-touch gestures by yourself.
A good tutorial is How to use multi-touch in Android 2.
来源:https://stackoverflow.com/questions/9120499/are-there-open-source-gesture-libraries-in-android