summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Selim Cinek <cinek@google.com> 2017-10-06 16:09:29 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-10-06 16:09:29 +0000
commit942aaf5ae89b21795fef76ea54b156bc8b646b9f (patch)
treef0208c0a3254d6f832cbaa6eb4a2a7152f885dce
parent5bd051d98109aedb453bfabd263b85fd1c7e09f3 (diff)
parent138590588bebfccae93543176ad1d38386d3fd3b (diff)
Merge "Fixed a bug where the order of the icons was wrong" into oc-mr1-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index 2cff79df47d7..561fbb2b4aba 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -796,6 +796,24 @@ public class StatusBarIconView extends AnimatedImageView {
}
}
+ /**
+ * This method returns the drawing rect for the view which is different from the regular
+ * drawing rect, since we layout all children at position 0 and usually the translation is
+ * neglected. The standard implementation doesn't account for translation.
+ *
+ * @param outRect The (scrolled) drawing bounds of the view.
+ */
+ @Override
+ public void getDrawingRect(Rect outRect) {
+ super.getDrawingRect(outRect);
+ float translationX = getTranslationX();
+ float translationY = getTranslationY();
+ outRect.left += translationX;
+ outRect.right += translationX;
+ outRect.top += translationY;
+ outRect.bottom += translationY;
+ }
+
public void setIsInShelf(boolean isInShelf) {
mIsInShelf = isInShelf;
}