summaryrefslogtreecommitdiffstats
path: root/core/res
diff options
context:
space:
mode:
authorWill Haldean Brown <haldean@google.com>2014-03-04 15:54:13 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-04 15:54:13 -0800
commit8055195f992f4cdbea6172c18afe2f3809de7a39 (patch)
treec1da01127cb72eacc5bee724aa08623b34999854 /core/res
parentbd4c10f8d7069cfbd8bb9b1c6879f85074c471b9 (diff)
parent568628dc2cb92b3ec3a87cae9de3203fbdc5968c (diff)
downloadframeworks_base-8055195f992f4cdbea6172c18afe2f3809de7a39.zip
frameworks_base-8055195f992f4cdbea6172c18afe2f3809de7a39.tar.gz
frameworks_base-8055195f992f4cdbea6172c18afe2f3809de7a39.tar.bz2
am 568628dc: Manually merge commit \'2faf28cf\' into master
* commit '568628dc2cb92b3ec3a87cae9de3203fbdc5968c': Add swipe-to-dismiss support to PhoneWindow.
Diffstat (limited to 'core/res')
-rw-r--r--core/res/res/anim/swipe_window_enter.xml26
-rw-r--r--core/res/res/anim/swipe_window_exit.xml26
-rw-r--r--core/res/res/layout/screen_swipe_dismiss.xml27
-rw-r--r--core/res/res/values/attrs.xml5
-rw-r--r--core/res/res/values/styles.xml8
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--core/res/res/values/themes_micro.xml20
7 files changed, 113 insertions, 0 deletions
diff --git a/core/res/res/anim/swipe_window_enter.xml b/core/res/res/anim/swipe_window_enter.xml
new file mode 100644
index 0000000..e1617e2
--- /dev/null
+++ b/core/res/res/anim/swipe_window_enter.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2007, 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.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:interpolator="@interpolator/decelerate_quad" >
+ <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
+ android:fillEnabled="true" android:fillBefore="true"
+ android:fillAfter="true"
+ android:duration="@android:integer/config_activityDefaultDur" />
+</set>
diff --git a/core/res/res/anim/swipe_window_exit.xml b/core/res/res/anim/swipe_window_exit.xml
new file mode 100644
index 0000000..ed0c5d3
--- /dev/null
+++ b/core/res/res/anim/swipe_window_exit.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2007, 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.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:interpolator="@interpolator/decelerate_quad" >
+ <translate android:fromXDelta="0%" android:toXDelta="100%"
+ android:fillEnabled="true" android:fillBefore="true"
+ android:fillAfter="true"
+ android:duration="400" />
+</set>
diff --git a/core/res/res/layout/screen_swipe_dismiss.xml b/core/res/res/layout/screen_swipe_dismiss.xml
new file mode 100644
index 0000000..90e970f
--- /dev/null
+++ b/core/res/res/layout/screen_swipe_dismiss.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+
+<!--
+This is a layout for a window whose resident activity is finished when swiped away.
+-->
+
+<com.android.internal.widget.SwipeDismissLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@android:id/content"
+ android:fitsSystemWindows="true"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ />
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 039bd07..a78ce02 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -447,6 +447,10 @@
to {@link android.view.WindowManager.LayoutParams#FLAG_TRANSLUCENT_NAVIGATION}. -->
<attr name="windowTranslucentNavigation" format="boolean" />
+ <!-- Flag to indicate that a window can be swiped away to be dismissed.
+ Corresponds to {@link android.view.Window.FEATURE_SWIPE_TO_DISMISS} -->
+ <attr name="windowSwipeToDismiss" format="boolean" />
+
<!-- Flag indicating whether this window requests that content changes be performed
as scene changes with transitions. Corresponds to
{@link android.view.Window#FEATURE_CONTENT_TRANSITIONS}. -->
@@ -1629,6 +1633,7 @@
<attr name="windowCloseOnTouchOutside" />
<attr name="windowTranslucentStatus" />
<attr name="windowTranslucentNavigation" />
+ <attr name="windowSwipeToDismiss" />
<attr name="windowContentTransitions" />
<attr name="windowContentTransitionManager" />
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 1a6eacd..e525ef7 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -225,6 +225,14 @@ please see styles_device_defaults.xml.
<item name="windowExitAnimation">@anim/fast_fade_out</item>
</style>
+ <!-- Window animations for swipe-dismissable windows. {@hide} -->
+ <style name="Animation.SwipeDismiss">
+ <item name="taskOpenEnterAnimation">@anim/swipe_window_enter</item>
+ <item name="taskOpenExitAnimation">@anim/swipe_window_exit</item>
+ <item name="taskCloseEnterAnimation">@anim/swipe_window_enter</item>
+ <item name="taskCloseExitAnimation">@anim/swipe_window_exit</item>
+ </style>
+
<!-- Status Bar Styles -->
<style name="TextAppearance.StatusBar">
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 9f368c4..a4f9762 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1370,6 +1370,7 @@
<java-symbol type="layout" name="screen_progress" />
<java-symbol type="layout" name="screen_simple" />
<java-symbol type="layout" name="screen_simple_overlay_action_mode" />
+ <java-symbol type="layout" name="screen_swipe_dismiss" />
<java-symbol type="layout" name="screen_title" />
<java-symbol type="layout" name="screen_title_icons" />
<java-symbol type="string" name="system_ui_date_pattern" />
diff --git a/core/res/res/values/themes_micro.xml b/core/res/res/values/themes_micro.xml
index b174d22..42f64fe 100644
--- a/core/res/res/values/themes_micro.xml
+++ b/core/res/res/values/themes_micro.xml
@@ -16,22 +16,42 @@
<resources>
<style name="Theme.Micro" parent="Theme.Holo">
<item name="numberPickerStyle">@android:style/Widget.Micro.NumberPicker</item>
+ <item name="windowAnimationStyle">@android:style/Animation.SwipeDismiss</item>
+ <item name="windowIsFloating">false</item>
+ <item name="windowIsTranslucent">true</item>
+ <item name="windowSwipeToDismiss">true</item>
</style>
<style name="Theme.Micro.NoActionBar" parent="Theme.Holo.NoActionBar">
<item name="textViewStyle">@android:style/Widget.Micro.TextView</item>
<item name="numberPickerStyle">@android:style/Widget.Micro.NumberPicker</item>
+ <item name="windowAnimationStyle">@android:style/Animation.SwipeDismiss</item>
+ <item name="windowIsFloating">false</item>
+ <item name="windowIsTranslucent">true</item>
+ <item name="windowSwipeToDismiss">true</item>
</style>
<style name="Theme.Micro.Light" parent="Theme.Holo.Light">
<item name="numberPickerStyle">@android:style/Widget.Micro.NumberPicker</item>
+ <item name="windowAnimationStyle">@android:style/Animation.SwipeDismiss</item>
+ <item name="windowIsFloating">false</item>
+ <item name="windowIsTranslucent">true</item>
+ <item name="windowSwipeToDismiss">true</item>
</style>
<style name="Theme.Micro.Light.NoActionBar" parent="Theme.Holo.Light.NoActionBar">
<item name="textViewStyle">@android:style/Widget.Micro.TextView</item>
<item name="numberPickerStyle">@android:style/Widget.Micro.NumberPicker</item>
+ <item name="windowAnimationStyle">@android:style/Animation.SwipeDismiss</item>
+ <item name="windowIsFloating">false</item>
+ <item name="windowIsTranslucent">true</item>
+ <item name="windowSwipeToDismiss">true</item>
</style>
<style name="Theme.Micro.Light.DarkActionBar" parent="Theme.Holo.Light.DarkActionBar">
<item name="textViewStyle">@android:style/Widget.Micro.TextView</item>
<item name="numberPickerStyle">@android:style/Widget.Micro.NumberPicker</item>
+ <item name="windowAnimationStyle">@android:style/Animation.SwipeDismiss</item>
+ <item name="windowIsFloating">false</item>
+ <item name="windowIsTranslucent">true</item>
+ <item name="windowSwipeToDismiss">true</item>
</style>
</resources>