summaryrefslogtreecommitdiffstats
path: root/core/java/android/view
diff options
context:
space:
mode:
authorWill Haldean Brown <haldean@google.com>2014-02-12 10:23:41 -0800
committerWill Haldean Brown <haldean@google.com>2014-03-04 09:26:15 -0800
commitca6234e084a71e0c968cff404620298bcd971fcc (patch)
treebd5c5a5ba959637f34af9d70e97b5b60def2eb70 /core/java/android/view
parenta4bd2cbe509911729c9f185b045e54d7528d8836 (diff)
downloadframeworks_base-ca6234e084a71e0c968cff404620298bcd971fcc.zip
frameworks_base-ca6234e084a71e0c968cff404620298bcd971fcc.tar.gz
frameworks_base-ca6234e084a71e0c968cff404620298bcd971fcc.tar.bz2
Add swipe-to-dismiss support to PhoneWindow.
This adds a new window feature -- FEATURE_SWIPE_TO_DISMISS -- and a theme attribute to activate that feature. When the feature is activated, a SwipeDismissLayout is inflated as the DecorView layout. SwipeDismissLayout intercepts touch events and steals ones that are large swipes to the right if its children don't. PhoneWindow registers handlers that listen for these swipe events, translate the window when necessary, and finish the activity at the end of the gesture. Change-Id: I512e758f3c3ffd3b353dba3b911c0e80a88d6f5f
Diffstat (limited to 'core/java/android/view')
-rw-r--r--core/java/android/view/Window.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index b3a0699..c450f3c 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -91,10 +91,15 @@ public abstract class Window {
public static final int FEATURE_ACTION_MODE_OVERLAY = 10;
/**
+ * Flag for requesting a decoration-free window that is dismissed by swiping from the left.
+ */
+ public static final int FEATURE_SWIPE_TO_DISMISS = 11;
+
+ /**
* Max value used as a feature ID
* @hide
*/
- public static final int FEATURE_MAX = FEATURE_ACTION_MODE_OVERLAY;
+ public static final int FEATURE_MAX = FEATURE_SWIPE_TO_DISMISS;
/** Flag for setting the progress bar's visibility to VISIBLE */
public static final int PROGRESS_VISIBILITY_ON = -1;
@@ -385,6 +390,12 @@ public abstract class Window {
* @param mode The mode that was just finished.
*/
public void onActionModeFinished(ActionMode mode);
+
+ /**
+ * Called when a window is dismissed. This informs the callback that the
+ * window is gone, and it should finish itself.
+ */
+ public void onWindowDismissed();
}
public Window(Context context) {