summaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
authorKevin <kevhan@google.com>2019-04-16 10:24:12 -0700
committerKevin Han <kevhan@google.com>2019-04-23 19:24:22 +0000
commit9c91de5a9ddb483e100ea69b9b5a967974e17e3a (patch)
treeffcc17f3166fbe03318d1c743c1ca2ce2f471fcb /go
parent3f343b7b5394595640d3467f4049a0fe92f21520 (diff)
downloadandroid_packages_apps_Trebuchet-9c91de5a9ddb483e100ea69b9b5a967974e17e3a.tar.gz
android_packages_apps_Trebuchet-9c91de5a9ddb483e100ea69b9b5a967974e17e3a.tar.bz2
android_packages_apps_Trebuchet-9c91de5a9ddb483e100ea69b9b5a967974e17e3a.zip
Fix views not being visible on Recents Go.
If we bind the loading task views but then on the tasks being loaded realize there are no items, it's possible to animate from the empty content view to the regular content view and then back. Currently, this leads to updateContentView not being called properly the second time since both views are still visible during the animation, so this CL fixes that and cancels any on-going crossfade animations. Bug: 114136250 Fixes: 130580680 Test: Remove last item from recents, go to recents again, empty view shown Change-Id: If1a4caab15f9b6d7ccd3abbc06f5866e06650db8 (cherry picked from commit cce954f334c31847cb49a8aaaa9731dcf88a9229)
Diffstat (limited to 'go')
-rw-r--r--go/quickstep/src/com/android/quickstep/views/IconRecentsView.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
index 712b9dc11..6075b35e0 100644
--- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
@@ -107,6 +107,7 @@ public final class IconRecentsView extends FrameLayout {
private RecentsToActivityHelper mActivityHelper;
private RecyclerView mTaskRecyclerView;
+ private View mShowingContentView;
private View mEmptyView;
private View mContentView;
private View mClearAllView;
@@ -355,11 +356,13 @@ public final class IconRecentsView extends FrameLayout {
*/
private void updateContentViewVisibility() {
int taskListSize = mTaskAdapter.getItemCount();
- if (mEmptyView.getVisibility() != VISIBLE && taskListSize == 0) {
+ if (mShowingContentView != mEmptyView && taskListSize == 0) {
+ mShowingContentView = mEmptyView;
crossfadeViews(mEmptyView, mContentView);
mActivityHelper.leaveRecents();
}
- if (mContentView.getVisibility() != VISIBLE && taskListSize > 0) {
+ if (mShowingContentView != mContentView && taskListSize > 0) {
+ mShowingContentView = mContentView;
crossfadeViews(mContentView, mEmptyView);
}
}
@@ -371,6 +374,7 @@ public final class IconRecentsView extends FrameLayout {
* @param fadeOutView view that should fade out
*/
private void crossfadeViews(View fadeInView, View fadeOutView) {
+ fadeInView.animate().cancel();
fadeInView.setVisibility(VISIBLE);
fadeInView.setAlpha(0f);
fadeInView.animate()
@@ -378,6 +382,7 @@ public final class IconRecentsView extends FrameLayout {
.setDuration(CROSSFADE_DURATION)
.setListener(null);
+ fadeOutView.animate().cancel();
fadeOutView.animate()
.alpha(0f)
.setDuration(CROSSFADE_DURATION)