summaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
authorKevin <kevhan@google.com>2019-04-29 15:47:37 -0700
committerKevin <kevhan@google.com>2019-04-29 17:15:20 -0700
commit27831e1b01834310f0a177b503c7d36a7beb8a66 (patch)
treebcae80743ec15d1cf3f6546de714e11c9fa48c18 /go
parentee8caf680afbf2d4b7a980fb11738f5547d23a13 (diff)
downloadandroid_packages_apps_Trebuchet-27831e1b01834310f0a177b503c7d36a7beb8a66.tar.gz
android_packages_apps_Trebuchet-27831e1b01834310f0a177b503c7d36a7beb8a66.tar.bz2
android_packages_apps_Trebuchet-27831e1b01834310f0a177b503c7d36a7beb8a66.zip
Fix thumbnail views not rotating w/ orientation
View has an optimization where it will not measure again if it is exact and the measurement has not changed. This means that when an onMeasure pass starts off for each task view on orientation change, it does not get passed down to the view holding the thumbnail and icon as its measure specs have not changed. This causes an issue as we use this measure call to react to orientation changes and re-measure the thumbnail view to match the orientation of the device. To fix this, we call forceLayout on the child explicitly on orientation change to ensure that we get the measure call. This sets the flag to force a re-measure in the next layout. Bug: 131427332 Test: Do repro in bug, view rotates correctly Change-Id: I0ef84dfcd0b3883582c8903d99d5e8a757ae8e74
Diffstat (limited to 'go')
-rw-r--r--go/quickstep/src/com/android/quickstep/views/TaskItemView.java3
-rw-r--r--go/quickstep/src/com/android/quickstep/views/TaskThumbnailIconView.java1
2 files changed, 3 insertions, 1 deletions
diff --git a/go/quickstep/src/com/android/quickstep/views/TaskItemView.java b/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
index 1b61a10ef..a5f572898 100644
--- a/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
+++ b/go/quickstep/src/com/android/quickstep/views/TaskItemView.java
@@ -44,6 +44,7 @@ public final class TaskItemView extends LinearLayout {
private final Drawable mDefaultThumbnail;
private final TaskLayerDrawable mIconDrawable;
private final TaskLayerDrawable mThumbnailDrawable;
+ private View mTaskIconThumbnailView;
private TextView mLabelView;
private ImageView mIconView;
private ImageView mThumbnailView;
@@ -79,6 +80,7 @@ public final class TaskItemView extends LinearLayout {
protected void onFinishInflate() {
super.onFinishInflate();
mLabelView = findViewById(R.id.task_label);
+ mTaskIconThumbnailView = findViewById(R.id.task_icon_and_thumbnail);
mThumbnailView = findViewById(R.id.task_thumbnail);
mIconView = findViewById(R.id.task_icon);
@@ -186,5 +188,6 @@ public final class TaskItemView extends LinearLayout {
((ThumbnailDrawable) drawable).setRequestedOrientation(newConfig.orientation);
}
}
+ mTaskIconThumbnailView.forceLayout();
}
}
diff --git a/go/quickstep/src/com/android/quickstep/views/TaskThumbnailIconView.java b/go/quickstep/src/com/android/quickstep/views/TaskThumbnailIconView.java
index 0bad77b60..eaefa2167 100644
--- a/go/quickstep/src/com/android/quickstep/views/TaskThumbnailIconView.java
+++ b/go/quickstep/src/com/android/quickstep/views/TaskThumbnailIconView.java
@@ -56,7 +56,6 @@ final class TaskThumbnailIconView extends ViewGroup {
int width = height;
setMeasuredDimension(width, height);
-
int subItemSize = (int) (SUBITEM_FRAME_RATIO * height);
if (mThumbnailView.getVisibility() != GONE) {
boolean isPortrait =