Skip to content

Commit f7315dd

Browse files
mikejurkaAndroid (Google) Code Review
authored andcommitted
Merge "Fix regression: recents did not dismiss after launching apps (5252649)"
2 parents 572527f + c6461ca commit f7315dd

File tree

8 files changed

+27
-11
lines changed

8 files changed

+27
-11
lines changed

packages/SystemUI/res/layout-land/status_bar_recent_item.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
android:layout_alignParentTop="true"
3838
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
3939
android:scaleType="center"
40-
android:clickable="true"
4140
android:background="@drawable/recents_thumbnail_overlay">
4241
<ImageView android:id="@+id/app_thumbnail_image"
4342
android:layout_width="match_parent"

packages/SystemUI/res/layout-port/status_bar_recent_item.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
android:layout_height="wrap_content"
3434
android:layout_alignParentLeft="true"
3535
android:layout_alignParentTop="true"
36-
android:clickable="true"
3736
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
3837
android:scaleType="center"
3938
android:background="@drawable/recents_thumbnail_overlay">

packages/SystemUI/res/layout-port/status_bar_recent_panel.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
android:orientation="horizontal"
3939
android:clipChildren="false"
4040
android:layout_marginTop="@*android:dimen/status_bar_height">
41+
4142
<com.android.systemui.recent.RecentsVerticalScrollView
4243
android:id="@+id/recents_container"
4344
android:layout_width="match_parent"
@@ -62,7 +63,6 @@
6263

6364
</com.android.systemui.recent.RecentsVerticalScrollView>
6465

65-
6666
</LinearLayout>
6767

6868
</FrameLayout>

packages/SystemUI/res/layout-sw600dp/status_bar_recent_item.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
android:layout_height="wrap_content"
3030
android:layout_alignParentLeft="true"
3131
android:layout_alignParentTop="true"
32-
android:clickable="true"
3332
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
3433
android:scaleType="center"
3534
android:background="@drawable/recents_thumbnail_overlay">

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ public void dismissChild(final View view, float velocity) {
196196
final View animView = mCallback.getChildContentView(view);
197197
final boolean canAnimViewBeDismissed = mCallback.canChildBeDismissed(view);
198198
float newPos;
199-
if (velocity < 0 || (velocity == 0 && getTranslation(animView) < 0)) {
199+
200+
if (velocity < 0
201+
|| (velocity == 0 && getTranslation(animView) < 0)
202+
// if we use the Menu to dismiss an item in landscape, animate up
203+
|| (velocity == 0 && getTranslation(animView) == 0 && mSwipeDirection == Y)) {
200204
newPos = -getSize(animView);
201205
} else {
202206
newPos = getSize(animView);

packages/SystemUI/src/com/android/systemui/recent/RecentsCallback.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public interface RecentsCallback {
2828
void handleSwipe(View selectedView);
2929
void handleLongPress(View selectedView, View anchorView);
3030
void handleShowBackground(boolean show);
31+
void dismiss();
3132

3233
// TODO: find another way to get this info from RecentsPanelView
3334
boolean isRecentsVisible();

packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,11 @@ public void show(boolean show, boolean animate) {
243243
}
244244
}
245245

246+
public void dismiss() {
247+
hide(true);
248+
}
249+
246250
public void hide(boolean animate) {
247-
mShowing = false;
248251
if (!animate) {
249252
setVisibility(View.GONE);
250253
}

packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,26 @@ private void update() {
8484
if (old == null) {
8585
view.setClickable(true);
8686
view.setOnLongClickListener(mOnLongClick);
87-
88-
final View thumbnail = view.findViewById(R.id.app_thumbnail);
89-
// thumbnail is set to clickable in the layout file
90-
thumbnail.setOnClickListener(new OnClickListener() {
87+
view.setOnClickListener(new OnClickListener() {
9188
public void onClick(View v) {
92-
mCallback.handleOnClick(view);
89+
mCallback.dismiss();
9390
}
9491
});
9592

93+
OnClickListener launchAppListener = new OnClickListener() {
94+
public void onClick(View v) {
95+
mCallback.handleOnClick(view);
96+
}
97+
};
98+
final View thumbnail = view.findViewById(R.id.app_thumbnail);
99+
thumbnail.setClickable(true);
100+
thumbnail.setOnClickListener(launchAppListener);
101+
final View appTitle = view.findViewById(R.id.app_label);
102+
appTitle.setClickable(true);
103+
appTitle.setOnClickListener(launchAppListener);
104+
final View calloutLine = view.findViewById(R.id.recents_callout_line);
105+
calloutLine.setClickable(true);
106+
calloutLine.setOnClickListener(launchAppListener);
96107
mLinearLayout.addView(view);
97108
}
98109
}

0 commit comments

Comments
 (0)