Merge "Fix regression: recents did not dismiss after launching apps (5252649)"
This commit is contained in:
committed by
Android (Google) Code Review
commit
f7315dd192
@@ -37,7 +37,6 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
|
||||
android:scaleType="center"
|
||||
android:clickable="true"
|
||||
android:background="@drawable/recents_thumbnail_overlay">
|
||||
<ImageView android:id="@+id/app_thumbnail_image"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:clickable="true"
|
||||
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
|
||||
android:scaleType="center"
|
||||
android:background="@drawable/recents_thumbnail_overlay">
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
android:orientation="horizontal"
|
||||
android:clipChildren="false"
|
||||
android:layout_marginTop="@*android:dimen/status_bar_height">
|
||||
|
||||
<com.android.systemui.recent.RecentsVerticalScrollView
|
||||
android:id="@+id/recents_container"
|
||||
android:layout_width="match_parent"
|
||||
@@ -62,7 +63,6 @@
|
||||
|
||||
</com.android.systemui.recent.RecentsVerticalScrollView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:clickable="true"
|
||||
android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
|
||||
android:scaleType="center"
|
||||
android:background="@drawable/recents_thumbnail_overlay">
|
||||
|
||||
@@ -196,7 +196,11 @@ public class SwipeHelper {
|
||||
final View animView = mCallback.getChildContentView(view);
|
||||
final boolean canAnimViewBeDismissed = mCallback.canChildBeDismissed(view);
|
||||
float newPos;
|
||||
if (velocity < 0 || (velocity == 0 && getTranslation(animView) < 0)) {
|
||||
|
||||
if (velocity < 0
|
||||
|| (velocity == 0 && getTranslation(animView) < 0)
|
||||
// if we use the Menu to dismiss an item in landscape, animate up
|
||||
|| (velocity == 0 && getTranslation(animView) == 0 && mSwipeDirection == Y)) {
|
||||
newPos = -getSize(animView);
|
||||
} else {
|
||||
newPos = getSize(animView);
|
||||
|
||||
@@ -28,6 +28,7 @@ public interface RecentsCallback {
|
||||
void handleSwipe(View selectedView);
|
||||
void handleLongPress(View selectedView, View anchorView);
|
||||
void handleShowBackground(boolean show);
|
||||
void dismiss();
|
||||
|
||||
// TODO: find another way to get this info from RecentsPanelView
|
||||
boolean isRecentsVisible();
|
||||
|
||||
@@ -243,8 +243,11 @@ public class RecentsPanelView extends RelativeLayout
|
||||
}
|
||||
}
|
||||
|
||||
public void dismiss() {
|
||||
hide(true);
|
||||
}
|
||||
|
||||
public void hide(boolean animate) {
|
||||
mShowing = false;
|
||||
if (!animate) {
|
||||
setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@@ -84,15 +84,26 @@ public class RecentsVerticalScrollView extends ScrollView implements SwipeHelper
|
||||
if (old == null) {
|
||||
view.setClickable(true);
|
||||
view.setOnLongClickListener(mOnLongClick);
|
||||
|
||||
final View thumbnail = view.findViewById(R.id.app_thumbnail);
|
||||
// thumbnail is set to clickable in the layout file
|
||||
thumbnail.setOnClickListener(new OnClickListener() {
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
mCallback.handleOnClick(view);
|
||||
mCallback.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
OnClickListener launchAppListener = new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
mCallback.handleOnClick(view);
|
||||
}
|
||||
};
|
||||
final View thumbnail = view.findViewById(R.id.app_thumbnail);
|
||||
thumbnail.setClickable(true);
|
||||
thumbnail.setOnClickListener(launchAppListener);
|
||||
final View appTitle = view.findViewById(R.id.app_label);
|
||||
appTitle.setClickable(true);
|
||||
appTitle.setOnClickListener(launchAppListener);
|
||||
final View calloutLine = view.findViewById(R.id.recents_callout_line);
|
||||
calloutLine.setClickable(true);
|
||||
calloutLine.setOnClickListener(launchAppListener);
|
||||
mLinearLayout.addView(view);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user