summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher/LauncherSettings.java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2009-06-09 12:57:21 -0700
committerRomain Guy <romainguy@android.com>2009-06-10 02:21:15 -0700
commit73b979d8c141c7ceac82dad7c5b271a6a42afa67 (patch)
tree1d73ba2b6d72282b116f2130b9f58536e46fd27f /src/com/android/launcher/LauncherSettings.java
parentcbb89e4fc253a5fc3f24162dfb4e29fc6a815c2b (diff)
downloadandroid_packages_apps_Trebuchet-73b979d8c141c7ceac82dad7c5b271a6a42afa67.tar.gz
android_packages_apps_Trebuchet-73b979d8c141c7ceac82dad7c5b271a6a42afa67.tar.bz2
android_packages_apps_Trebuchet-73b979d8c141c7ceac82dad7c5b271a6a42afa67.zip
Add gestures to Home.
Press the Home key while in Home to enable the gestures pad.
Diffstat (limited to 'src/com/android/launcher/LauncherSettings.java')
-rw-r--r--src/com/android/launcher/LauncherSettings.java168
1 files changed, 98 insertions, 70 deletions
diff --git a/src/com/android/launcher/LauncherSettings.java b/src/com/android/launcher/LauncherSettings.java
index 60ea0df6a..062c8a6ef 100644
--- a/src/com/android/launcher/LauncherSettings.java
+++ b/src/com/android/launcher/LauncherSettings.java
@@ -23,16 +23,79 @@ import android.net.Uri;
* Settings related utilities.
*/
class LauncherSettings {
- /**
- * Favorites. When changing these values, be sure to update
- * {@link com.android.settings.LauncherAppWidgetBinder} as needed.
- */
- static final class Favorites implements BaseColumns {
+ static interface BaseLauncherColumns extends BaseColumns {
+ /**
+ * Descriptive name of the gesture that can be displayed to the user.
+ * <P>Type: TEXT</P>
+ */
+ static final String TITLE = "title";
+
/**
+ * The Intent URL of the gesture, describing what it points to. This
+ * value is given to {@link android.content.Intent#getIntent} to create
+ * an Intent that can be launched.
+ * <P>Type: TEXT</P>
+ */
+ static final String INTENT = "intent";
+
+ /**
+ * The type of the gesture
+ *
+ * <P>Type: INTEGER</P>
+ */
+ static final String ITEM_TYPE = "itemType";
+
+ /**
+ * The gesture is an application
+ */
+ static final int ITEM_TYPE_APPLICATION = 0;
+
+ /**
+ * The gesture is an application created shortcut
+ */
+ static final int ITEM_TYPE_SHORTCUT = 1;
+
+ /**
+ * The icon type.
+ * <P>Type: INTEGER</P>
+ */
+ static final String ICON_TYPE = "iconType";
+
+ /**
+ * The icon is a resource identified by a package name and an integer id.
+ */
+ static final int ICON_TYPE_RESOURCE = 0;
+
+ /**
+ * The icon is a bitmap.
+ */
+ static final int ICON_TYPE_BITMAP = 1;
+
+ /**
+ * The icon package name, if icon type is ICON_TYPE_RESOURCE.
+ * <P>Type: TEXT</P>
+ */
+ static final String ICON_PACKAGE = "iconPackage";
+
+ /**
+ * The icon resource id, if icon type is ICON_TYPE_RESOURCE.
+ * <P>Type: TEXT</P>
+ */
+ static final String ICON_RESOURCE = "iconResource";
+
+ /**
+ * The custom icon bitmap, if icon type is ICON_TYPE_BITMAP.
+ * <P>Type: BLOB</P>
+ */
+ static final String ICON = "icon";
+ }
+
+ static final class Gestures implements BaseLauncherColumns {
+ /**
* The content:// style URL for this table
*/
static final Uri CONTENT_URI = Uri.parse("content://" +
- LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
+ LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_GESTURES +
"?" + LauncherProvider.PARAMETER_NOTIFY + "=true");
/**
@@ -40,7 +103,7 @@ class LauncherSettings {
* sent if the content changes.
*/
static final Uri CONTENT_URI_NO_NOTIFICATION = Uri.parse("content://" +
- LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
+ LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_GESTURES +
"?" + LauncherProvider.PARAMETER_NOTIFY + "=false");
/**
@@ -53,29 +116,44 @@ class LauncherSettings {
*/
static Uri getContentUri(long id, boolean notify) {
return Uri.parse("content://" + LauncherProvider.AUTHORITY +
- "/" + LauncherProvider.TABLE_FAVORITES + "/" + id + "?" +
+ "/" + LauncherProvider.TABLE_GESTURES + "/" + id + "?" +
LauncherProvider.PARAMETER_NOTIFY + "=" + notify);
}
+ }
+ /**
+ * Favorites. When changing these values, be sure to update
+ * {@link com.android.settings.LauncherAppWidgetBinder} as needed.
+ */
+ static final class Favorites implements BaseLauncherColumns {
/**
- * The row ID.
- * <p>Type: INTEGER</p>
+ * The content:// style URL for this table
*/
- static final String ID = "_id";
+ static final Uri CONTENT_URI = Uri.parse("content://" +
+ LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
+ "?" + LauncherProvider.PARAMETER_NOTIFY + "=true");
/**
- * Descriptive name of the favorite that can be displayed to the user.
- * <P>Type: TEXT</P>
+ * The content:// style URL for this table. When this Uri is used, no notification is
+ * sent if the content changes.
*/
- static final String TITLE = "title";
+ static final Uri CONTENT_URI_NO_NOTIFICATION = Uri.parse("content://" +
+ LauncherProvider.AUTHORITY + "/" + LauncherProvider.TABLE_FAVORITES +
+ "?" + LauncherProvider.PARAMETER_NOTIFY + "=false");
/**
- * The Intent URL of the favorite, describing what it points to. This
- * value is given to {@link android.content.Intent#getIntent} to create
- * an Intent that can be launched.
- * <P>Type: TEXT</P>
+ * The content:// style URL for a given row, identified by its id.
+ *
+ * @param id The row id.
+ * @param notify True to send a notification is the content changes.
+ *
+ * @return The unique content URL for the specified row.
*/
- static final String INTENT = "intent";
+ static Uri getContentUri(long id, boolean notify) {
+ return Uri.parse("content://" + LauncherProvider.AUTHORITY +
+ "/" + LauncherProvider.TABLE_FAVORITES + "/" + id + "?" +
+ LauncherProvider.PARAMETER_NOTIFY + "=" + notify);
+ }
/**
* The container holding the favorite
@@ -121,23 +199,6 @@ class LauncherSettings {
static final String SPANY = "spanY";
/**
- * The type of the favorite
- *
- * <P>Type: INTEGER</P>
- */
- static final String ITEM_TYPE = "itemType";
-
- /**
- * The favorite is an application
- */
- static final int ITEM_TYPE_APPLICATION = 0;
-
- /**
- * The favorite is an application created shortcut
- */
- static final int ITEM_TYPE_SHORTCUT = 1;
-
- /**
* The favorite is a user created folder
*/
static final int ITEM_TYPE_USER_FOLDER = 2;
@@ -180,43 +241,10 @@ class LauncherSettings {
* value is 1, it is an application-created shortcut.
* <P>Type: INTEGER</P>
*/
+ @Deprecated
static final String IS_SHORTCUT = "isShortcut";
/**
- * The icon type.
- * <P>Type: INTEGER</P>
- */
- static final String ICON_TYPE = "iconType";
-
- /**
- * The icon is a resource identified by a package name and an integer id.
- */
- static final int ICON_TYPE_RESOURCE = 0;
-
- /**
- * The icon is a bitmap.
- */
- static final int ICON_TYPE_BITMAP = 1;
-
- /**
- * The icon package name, if icon type is ICON_TYPE_RESOURCE.
- * <P>Type: TEXT</P>
- */
- static final String ICON_PACKAGE = "iconPackage";
-
- /**
- * The icon resource id, if icon type is ICON_TYPE_RESOURCE.
- * <P>Type: TEXT</P>
- */
- static final String ICON_RESOURCE = "iconResource";
-
- /**
- * The custom icon bitmap, if icon type is ICON_TYPE_BITMAP.
- * <P>Type: BLOB</P>
- */
- static final String ICON = "icon";
-
- /**
* The URI associated with the favorite. It is used, for instance, by
* live folders to find the content provider.
* <P>Type: TEXT</P>