summaryrefslogtreecommitdiffstats
path: root/core/res
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-05-22 02:02:57 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-05-22 02:02:57 -0700
commitf41c640d8424fbd90cb1751173ede1c9f5e848b4 (patch)
tree35da5dd44162dfb5c500556e2a1900476df93d54 /core/res
parent84ce47e64f9aa5600b6b3e205f8c6930a8095c7d (diff)
parentd6a463a9f23b3901bf729f2f27a6bb8f78b95248 (diff)
downloadframeworks_base-f41c640d8424fbd90cb1751173ede1c9f5e848b4.zip
frameworks_base-f41c640d8424fbd90cb1751173ede1c9f5e848b4.tar.gz
frameworks_base-f41c640d8424fbd90cb1751173ede1c9f5e848b4.tar.bz2
Merge change 2305 into donut
* changes: Add a new API to ListView: setGestures(int). This allows developers to enable gestures to jump inside the list or filter it. This change also introduces a new XML attribute to control this API. It also adds the ability to theme the GestureOverlayView from the gestures library. Finally, this adds a new VERSION header to the binary format used to store the letters for the recognizer.
Diffstat (limited to 'core/res')
-rw-r--r--core/res/res/layout/list_gestures_overlay.xml19
-rw-r--r--core/res/res/raw/latin_lowercasebin28494 -> 28496 bytes
-rw-r--r--core/res/res/values/attrs.xml34
-rw-r--r--core/res/res/values/public.xml8
-rw-r--r--core/res/res/values/styles.xml13
-rw-r--r--core/res/res/values/themes.xml4
6 files changed, 75 insertions, 3 deletions
diff --git a/core/res/res/layout/list_gestures_overlay.xml b/core/res/res/layout/list_gestures_overlay.xml
new file mode 100644
index 0000000..54d72c8
--- /dev/null
+++ b/core/res/res/layout/list_gestures_overlay.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<android.gesture.GestureOverlayView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" />
diff --git a/core/res/res/raw/latin_lowercase b/core/res/res/raw/latin_lowercase
index 5c38b91..fd67333 100644
--- a/core/res/res/raw/latin_lowercase
+++ b/core/res/res/raw/latin_lowercase
Binary files differ
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 052ab35..c4c2446 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -324,6 +324,8 @@
<attr name="expandableListViewStyle" format="reference" />
<!-- Default Gallery style. -->
<attr name="galleryStyle" format="reference" />
+ <!-- Default GestureOverlayView style. -->
+ <attr name="gestureOverlayViewStyle" format="reference" />
<!-- Default GridView style. -->
<attr name="gridViewStyle" format="reference" />
<!-- The style resource to use for an ImageButton -->
@@ -1379,6 +1381,19 @@
will use only the number of items in the adapter and the number of items visible
on screen to determine the scrollbar's properties. -->
<attr name="smoothScrollbar" format="boolean" />
+ <!-- Defines the type of gesture to enable for the widget. -->
+ <attr name="gestures">
+ <!-- No gesture -->
+ <enum name="none" value="0" />
+ <!-- Gestures jump to a specific position in the content. This requires
+ fast scroll to be enabled. If fast scroll is enabled from XML,
+ jump gestures will be enabled automatically. -->
+ <enum name="jump" value="1" />
+ <!-- Gestures filter the content. This requires text filtering to be enabled.
+ If text filtering is enabled from XML, filter gestures will be enabled
+ automatically. -->
+ <enum name="filter" value="2" />
+ </attr>
</declare-styleable>
<declare-styleable name="AbsSpinner">
<!-- Reference to an array resource that will populate the Spinner. For static content,
@@ -1581,7 +1596,7 @@
<!-- Height of the divider. Will use the intrinsic height of the divider if this
is not specified. -->
<attr name="dividerHeight" format="dimension" />
- <!-- Defines the choice behavior for the List. By default, Lists do not have
+ <!-- Defines the choice behavior for the ListView. By default, lists do not have
any choice behavior. By setting the choiceMode to singleChoice, the List
allows up to one item to be in a chosen state. By setting the choiceMode to
multipleChoice, the list allows any number of items to be chosen. -->
@@ -2061,6 +2076,23 @@
<attr name="animateOnClick" format="boolean" />
</declare-styleable>
+ <!-- GestureOverlayView specific attributes. These attributes are used to configure
+ a GestureOverlayView from XML. -->
+ <declare-styleable name="GestureOverlayView">
+ <!-- Width of the stroke used to draw the gesture. -->
+ <attr name="gestureStrokeWidth" format="float" />
+ <!-- Color used to draw a gesture. -->
+ <attr name="gestureColor" format="color" />
+ <!-- Color used to draw the user's strokes until we are sure it's a gesture. -->
+ <attr name="uncertainGestureColor" format="color" />
+ <!-- Time, in milliseconds, to wait before the gesture fades out after the user
+ is done drawing it. -->
+ <attr name="fadeOffset" format="integer" />
+ <!-- Duration, in milliseconds, of the fade out effect after the user is done
+ drawing a gesture. -->
+ <attr name="fadeDuration" format="integer" />
+ </declare-styleable>
+
<!-- ======================================= -->
<!-- Widget package parent layout attributes -->
<!-- ======================================= -->
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 07bb759..55aecc4 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1101,7 +1101,13 @@
<public type="attr" name="maxSdkVersion" />
<public type="attr" name="testOnly" />
<public type="attr" name="contentDescription" />
-
+ <public type="attr" name="gestureStrokeWidth" />
+ <public type="attr" name="gestureColor" />
+ <public type="attr" name="uncertainGestureColor" />
+ <public type="attr" name="fadeOffset" />
+ <public type="attr" name="fadeDuration" />
+ <public type="attr" name="gestures" />
+
<public-padding type="attr" name="donut_resource_pad" end="0x0101029f" />
<public-padding type="id" name="donut_resource_pad" end="0x01020040" />
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 8160c9c..09e299a 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -171,6 +171,19 @@
<item name="android:fadingEdge">vertical</item>
</style>
+ <style name="Widget.GestureOverlayView">
+ <item name="android:gestureStrokeWidth">12.0</item>
+ <item name="android:gestureColor">#ffffff00</item>
+ <item name="android:uncertainGestureColor">#3cffff00</item>
+ <item name="android:fadeOffset">300</item>
+ <item name="android:fadeDuration">300</item>
+ </style>
+
+ <style name="Widget.GestureOverlayView.White">
+ <item name="android:gestureColor">#ff00ff00</item>
+ <item name="android:uncertainGestureColor">#3c00ff00</item>
+ </style>
+
<style name="Widget.Button">
<item name="android:background">@android:drawable/btn_default</item>
<item name="android:focusable">true</item>
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index b168fb8..00dc6fa 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -142,7 +142,8 @@
<item name="editTextStyle">@android:style/Widget.EditText</item>
<item name="expandableListViewStyle">@android:style/Widget.ExpandableListView</item>
<item name="galleryStyle">@android:style/Widget.Gallery</item>
- <item name="gridViewStyle">@android:style/Widget.GridView</item>
+ <item name="gestureOverlayViewStyle">@android:style/Widget.GestureOverlayView</item>
+ <item name="gridViewStyle">@android:style/Widget.GridView</item>
<item name="imageButtonStyle">@android:style/Widget.ImageButton</item>
<item name="imageWellStyle">@android:style/Widget.ImageWell</item>
<item name="listViewStyle">@android:style/Widget.ListView</item>
@@ -225,6 +226,7 @@
<item name="textCheckMark">@android:drawable/indicator_check_mark_light</item>
<item name="textCheckMarkInverse">@android:drawable/indicator_check_mark_dark</item>
+ <item name="gestureOverlayViewStyle">@android:style/Widget.GestureOverlayView.White</item>
<item name="listViewStyle">@android:style/Widget.ListView.White</item>
<item name="listDivider">@drawable/divider_horizontal_bright</item>
<item name="listSeparatorTextViewStyle">@android:style/Widget.TextView.ListSeparator.White</item>