diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-05-02 20:56:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-05-02 20:56:28 +0000 |
commit | 4ec8209c38d205ecbb819ab90a4a6ce060c74406 (patch) | |
tree | 83bef8039d7065eefad5e1d001b33503e7066f5f /go | |
parent | b0d9ef6cdce4794e58bdf547b47f173118a529ec (diff) | |
parent | b731c07e0463f37c63d34b39eed329decac1a931 (diff) | |
download | android_packages_apps_Trebuchet-4ec8209c38d205ecbb819ab90a4a6ce060c74406.tar.gz android_packages_apps_Trebuchet-4ec8209c38d205ecbb819ab90a4a6ce060c74406.tar.bz2 android_packages_apps_Trebuchet-4ec8209c38d205ecbb819ab90a4a6ce060c74406.zip |
Merge "Check orientation changes on task item attaching" into ub-launcher3-qt-dev
Diffstat (limited to 'go')
-rw-r--r-- | go/quickstep/src/com/android/quickstep/views/TaskItemView.java | 17 |
1 files changed, 16 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 a5f572898..6db801322 100644 --- a/go/quickstep/src/com/android/quickstep/views/TaskItemView.java +++ b/go/quickstep/src/com/android/quickstep/views/TaskItemView.java @@ -49,6 +49,7 @@ public final class TaskItemView extends LinearLayout { private ImageView mIconView; private ImageView mThumbnailView; private float mContentTransitionProgress; + private int mDisplayedOrientation; /** * Property representing the content transition progress of the view. 1.0f represents that the @@ -179,13 +180,27 @@ public final class TaskItemView extends LinearLayout { } @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + onOrientationChanged(getResources().getConfiguration().orientation); + } + + @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); + onOrientationChanged(newConfig.orientation); + } + + private void onOrientationChanged(int newOrientation) { + if (mDisplayedOrientation == newOrientation) { + return; + } + mDisplayedOrientation = newOrientation; int layerCount = mThumbnailDrawable.getNumberOfLayers(); for (int i = 0; i < layerCount; i++) { Drawable drawable = mThumbnailDrawable.getDrawable(i); if (drawable instanceof ThumbnailDrawable) { - ((ThumbnailDrawable) drawable).setRequestedOrientation(newConfig.orientation); + ((ThumbnailDrawable) drawable).setRequestedOrientation(newOrientation); } } mTaskIconThumbnailView.forceLayout(); |