summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-05-29 15:04:50 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-05-29 15:04:50 -0700
commit4a3cdb2f7bda0548c225e6b1aed1b073979ee75d (patch)
tree36ab1f349dbb2ac937626da07da652f38e139176
parent9176469702fac61846d6b2eab03bc2ea6c94241a (diff)
parent2d75410f20653858f358237ae9bd09b053fe8f8f (diff)
downloadframeworks_base-4a3cdb2f7bda0548c225e6b1aed1b073979ee75d.zip
frameworks_base-4a3cdb2f7bda0548c225e6b1aed1b073979ee75d.tar.gz
frameworks_base-4a3cdb2f7bda0548c225e6b1aed1b073979ee75d.tar.bz2
am 2d75410f: Merge change 2748 into donut
Merge commit '2d75410f20653858f358237ae9bd09b053fe8f8f' * commit '2d75410f20653858f358237ae9bd09b053fe8f8f': Fix the build.
-rw-r--r--api/current.xml486
-rwxr-xr-xcore/java/android/gesture/GestureOverlayView.java21
2 files changed, 442 insertions, 65 deletions
diff --git a/api/current.xml b/api/current.xml
index f7c12e7..860cce4 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -49580,10 +49580,75 @@
>
</field>
</class>
-<class name="GestureLibrary"
+<class name="GestureLibraries"
extends="java.lang.Object"
abstract="false"
static="false"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="fromFile"
+ return="android.gesture.GestureLibrary"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="path" type="java.lang.String">
+</parameter>
+</method>
+<method name="fromFile"
+ return="android.gesture.GestureLibrary"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="path" type="java.io.File">
+</parameter>
+</method>
+<method name="fromPrivateFile"
+ return="android.gesture.GestureLibrary"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="context" type="android.content.Context">
+</parameter>
+<parameter name="name" type="java.lang.String">
+</parameter>
+</method>
+<method name="fromRawResource"
+ return="android.gesture.GestureLibrary"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="context" type="android.content.Context">
+</parameter>
+<parameter name="resourceId" type="int">
+</parameter>
+</method>
+</class>
+<class name="GestureLibrary"
+ extends="java.lang.Object"
+ abstract="true"
+ static="false"
final="false"
deprecated="not deprecated"
visibility="public"
@@ -49593,10 +49658,8 @@
static="false"
final="false"
deprecated="not deprecated"
- visibility="public"
+ visibility="protected"
>
-<parameter name="path" type="java.lang.String">
-</parameter>
</constructor>
<method name="addGesture"
return="void"
@@ -49637,6 +49700,17 @@
<parameter name="entryName" type="java.lang.String">
</parameter>
</method>
+<method name="getLearner"
+ return="android.gesture.Learner"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="getOrientationStyle"
return="int"
abstract="false"
@@ -49659,7 +49733,7 @@
visibility="public"
>
</method>
-<method name="load"
+<method name="isReadOnly"
return="boolean"
abstract="false"
native="false"
@@ -49670,6 +49744,17 @@
visibility="public"
>
</method>
+<method name="load"
+ return="boolean"
+ abstract="true"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="recognize"
return="java.util.ArrayList&lt;android.gesture.Prediction&gt;"
abstract="false"
@@ -49713,7 +49798,7 @@
</method>
<method name="save"
return="boolean"
- abstract="false"
+ abstract="true"
native="false"
synchronized="false"
static="false"
@@ -49748,48 +49833,14 @@
<parameter name="type" type="int">
</parameter>
</method>
-<field name="ORIENTATION_INVARIANT"
- type="int"
- transient="false"
- volatile="false"
- value="1"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="ORIENTATION_SENSITIVE"
- type="int"
- transient="false"
- volatile="false"
- value="2"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="SEQUENCE_INVARIANT"
- type="int"
- transient="false"
- volatile="false"
- value="1"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="SEQUENCE_SENSITIVE"
- type="int"
+<field name="mStore"
+ type="android.gesture.GestureStore"
transient="false"
volatile="false"
- value="2"
- static="true"
+ static="false"
final="true"
deprecated="not deprecated"
- visibility="public"
+ visibility="protected"
>
</field>
</class>
@@ -50421,6 +50472,259 @@
>
</field>
</class>
+<class name="GestureStore"
+ extends="java.lang.Object"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="GestureStore"
+ type="android.gesture.GestureStore"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</constructor>
+<method name="addGesture"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="entryName" type="java.lang.String">
+</parameter>
+<parameter name="gesture" type="android.gesture.Gesture">
+</parameter>
+</method>
+<method name="getGestureEntries"
+ return="java.util.Set&lt;java.lang.String&gt;"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getGestures"
+ return="java.util.ArrayList&lt;android.gesture.Gesture&gt;"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="entryName" type="java.lang.String">
+</parameter>
+</method>
+<method name="getOrientationStyle"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getSequenceType"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="load"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="stream" type="java.io.InputStream">
+</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="load"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="stream" type="java.io.InputStream">
+</parameter>
+<parameter name="closeStream" type="boolean">
+</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="recognize"
+ return="java.util.ArrayList&lt;android.gesture.Prediction&gt;"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="gesture" type="android.gesture.Gesture">
+</parameter>
+</method>
+<method name="removeEntry"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="entryName" type="java.lang.String">
+</parameter>
+</method>
+<method name="removeGesture"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="entryName" type="java.lang.String">
+</parameter>
+<parameter name="gesture" type="android.gesture.Gesture">
+</parameter>
+</method>
+<method name="save"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="stream" type="java.io.OutputStream">
+</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="save"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="stream" type="java.io.OutputStream">
+</parameter>
+<parameter name="closeStream" type="boolean">
+</parameter>
+<exception name="IOException" type="java.io.IOException">
+</exception>
+</method>
+<method name="setOrientationStyle"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="style" type="int">
+</parameter>
+</method>
+<method name="setSequenceType"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="type" type="int">
+</parameter>
+</method>
+<field name="ORIENTATION_INVARIANT"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="1"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="ORIENTATION_SENSITIVE"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="2"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SEQUENCE_INVARIANT"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="1"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SEQUENCE_SENSITIVE"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="2"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</class>
<class name="GestureStroke"
extends="java.lang.Object"
abstract="false"
@@ -50521,6 +50825,15 @@
>
</field>
</class>
+<class name="Learner"
+ extends="java.lang.Object"
+ abstract="true"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility=""
+>
+</class>
<class name="LetterRecognizer"
extends="java.lang.Object"
abstract="false"
@@ -50529,19 +50842,17 @@
deprecated="not deprecated"
visibility="public"
>
-<method name="getLetterRecognizer"
- return="android.gesture.LetterRecognizer"
+<method name="recognize"
+ return="java.util.ArrayList&lt;android.gesture.Prediction&gt;"
abstract="false"
native="false"
synchronized="false"
- static="true"
+ static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
-<parameter name="context" type="android.content.Context">
-</parameter>
-<parameter name="type" type="int">
+<parameter name="gesture" type="android.gesture.Gesture">
</parameter>
</method>
<method name="recognize"
@@ -50556,20 +50867,85 @@
>
<parameter name="gesture" type="android.gesture.Gesture">
</parameter>
+<parameter name="predictions" type="java.util.ArrayList&lt;android.gesture.Prediction&gt;">
+</parameter>
</method>
-<method name="recognize"
- return="java.util.ArrayList&lt;android.gesture.Prediction&gt;"
+</class>
+<class name="LetterRecognizers"
+ extends="java.lang.Object"
+ abstract="false"
+ static="false"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="fromFile"
+ return="android.gesture.LetterRecognizer"
abstract="false"
native="false"
synchronized="false"
- static="false"
+ static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
-<parameter name="gesture" type="android.gesture.Gesture">
+<parameter name="path" type="java.lang.String">
</parameter>
-<parameter name="predictions" type="java.util.ArrayList&lt;android.gesture.Prediction&gt;">
+</method>
+<method name="fromFile"
+ return="android.gesture.LetterRecognizer"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="file" type="java.io.File">
+</parameter>
+</method>
+<method name="fromResource"
+ return="android.gesture.LetterRecognizer"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="context" type="android.content.Context">
+</parameter>
+<parameter name="resourceId" type="int">
+</parameter>
+</method>
+<method name="fromStream"
+ return="android.gesture.LetterRecognizer"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="stream" type="java.io.InputStream">
+</parameter>
+</method>
+<method name="fromType"
+ return="android.gesture.LetterRecognizer"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="context" type="android.content.Context">
+</parameter>
+<parameter name="type" type="int">
</parameter>
</method>
<field name="RECOGNIZER_LATIN_LOWERCASE"
diff --git a/core/java/android/gesture/GestureOverlayView.java b/core/java/android/gesture/GestureOverlayView.java
index cc58f1d..227cf3d 100755
--- a/core/java/android/gesture/GestureOverlayView.java
+++ b/core/java/android/gesture/GestureOverlayView.java
@@ -45,8 +45,9 @@ import java.util.ArrayList;
* @attr ref android.R.styleable#GestureOverlayView_gestureStrokeAngleThreshold
* @attr ref android.R.styleable#GestureOverlayView_gestureStrokeLengthThreshold
* @attr ref android.R.styleable#GestureOverlayView_gestureStrokeSquarenessThreshold
- * @attr ref android.R.styleable#GestureOverlayView_gestureStrokeType
+ * @attr ref android.R.styleable#GestureOverlayView_gestureStrokeType
* @attr ref android.R.styleable#GestureOverlayView_gestureColor
+ * @attr ref android.R.styleable#GestureOverlayView_orientation
* @attr ref android.R.styleable#GestureOverlayView_uncertainGestureColor
*/
public class GestureOverlayView extends FrameLayout {
@@ -86,7 +87,7 @@ public class GestureOverlayView extends FrameLayout {
private float mX;
private float mY;
-
+
private float mCurveEndX;
private float mCurveEndY;
@@ -516,12 +517,12 @@ public class GestureOverlayView extends FrameLayout {
final int count = listeners.size();
for (int i = 0; i < count; i++) {
listeners.get(i).onGestureStarted(this, event);
- }
+ }
}
private Rect touchMove(MotionEvent event) {
Rect areaToRefresh = null;
-
+
final float x = event.getX();
final float y = event.getY();
@@ -530,7 +531,7 @@ public class GestureOverlayView extends FrameLayout {
final float dx = Math.abs(x - previousX);
final float dy = Math.abs(y - previousY);
-
+
if (dx >= GestureStroke.TOUCH_TOLERANCE || dy >= GestureStroke.TOUCH_TOLERANCE) {
areaToRefresh = mInvalidRect;
@@ -538,16 +539,16 @@ public class GestureOverlayView extends FrameLayout {
final int border = mInvalidateExtraBorder;
areaToRefresh.set((int) mCurveEndX - border, (int) mCurveEndY - border,
(int) mCurveEndX + border, (int) mCurveEndY + border);
-
+
float cX = mCurveEndX = (x + previousX) / 2;
float cY = mCurveEndY = (y + previousY) / 2;
mPath.quadTo(previousX, previousY, cX, cY);
-
+
// union with the control point of the new curve
areaToRefresh.union((int) previousX - border, (int) previousY - border,
(int) previousX + border, (int) previousY + border);
-
+
// union with the end point of the new curve
areaToRefresh.union((int) cX - border, (int) cY - border,
(int) cX + border, (int) cY + border);
@@ -618,7 +619,7 @@ public class GestureOverlayView extends FrameLayout {
cancelGesture(event);
}
- mStrokeBuffer.clear();
+ mStrokeBuffer.clear();
mIsGesturing = false;
}
@@ -678,7 +679,7 @@ public class GestureOverlayView extends FrameLayout {
setPaintAlpha(255);
}
- invalidate();
+ invalidate();
}
}