Skip to content

Commit 1ed0741

Browse files
Jim MillerAndroid (Google) Code Review
authored andcommitted
Merge "Fix 6398209: Add custom transition animation for swipe to search" into jb-dev
2 parents f406286 + c150b19 commit 1ed0741

File tree

3 files changed

+59
-2
lines changed

3 files changed

+59
-2
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
** Copyright 2012, The Android Open Source Project
5+
**
6+
** Licensed under the Apache License, Version 2.0 (the "License");
7+
** you may not use this file except in compliance with the License.
8+
** You may obtain a copy of the License at
9+
**
10+
** http://www.apache.org/licenses/LICENSE-2.0
11+
**
12+
** Unless required by applicable law or agreed to in writing, software
13+
** distributed under the License is distributed on an "AS IS" BASIS,
14+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
** See the License for the specific language governing permissions and
16+
** limitations under the License.
17+
*/
18+
-->
19+
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:shareInterpolator="false" android:zAdjustment="top">
22+
23+
<alpha android:fromAlpha="0" android:toAlpha="1.0"
24+
android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
25+
android:interpolator="@android:interpolator/decelerate_quad"
26+
android:duration="300"/>
27+
28+
<translate android:fromYDelta="200" android:toYDelta="0"
29+
android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
30+
android:interpolator="@android:interpolator/decelerate_cubic"
31+
android:duration="300" />
32+
</set>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
** Copyright 2012, The Android Open Source Project
5+
**
6+
** Licensed under the Apache License, Version 2.0 (the "License");
7+
** you may not use this file except in compliance with the License.
8+
** You may obtain a copy of the License at
9+
**
10+
** http://www.apache.org/licenses/LICENSE-2.0
11+
**
12+
** Unless required by applicable law or agreed to in writing, software
13+
** distributed under the License is distributed on an "AS IS" BASIS,
14+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
** See the License for the specific language governing permissions and
16+
** limitations under the License.
17+
*/
18+
-->
19+
20+
<translate xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:interpolator="@android:anim/accelerate_interpolator"
22+
android:fromXDelta="0" android:toXDelta="0"
23+
android:duration="300" />

packages/SystemUI/src/com/android/systemui/SearchPanelView.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@ private SearchManager getSearchManager() {
107107

108108
private void startAssistActivity() {
109109
Intent intent = getAssistIntent();
110-
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
111110
try {
112-
mContext.startActivity(intent);
111+
ActivityOptions opts = ActivityOptions.makeCustomAnimation(mContext,
112+
R.anim.search_launch_enter, R.anim.search_launch_exit);
113+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
114+
mContext.startActivity(intent, opts.toBundle());
113115
} catch (ActivityNotFoundException e) {
114116
Slog.w(TAG, "Activity not found for " + intent.getAction());
115117
}

0 commit comments

Comments
 (0)