diff options
| -rw-r--r-- | core/java/com/android/internal/widget/ImageFloatingTextView.java | 18 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/core/java/com/android/internal/widget/ImageFloatingTextView.java b/core/java/com/android/internal/widget/ImageFloatingTextView.java index 926ebd158b50..358be604f847 100644 --- a/core/java/com/android/internal/widget/ImageFloatingTextView.java +++ b/core/java/com/android/internal/widget/ImageFloatingTextView.java @@ -40,6 +40,9 @@ public class ImageFloatingTextView extends TextView { /** Number of lines from the top to indent */ private int mIndentLines; + /** Resolved layout direction */ + private int mResolvedDirection = LAYOUT_DIRECTION_UNDEFINED; + public ImageFloatingTextView(Context context) { this(context, null); } @@ -82,7 +85,7 @@ public class ImageFloatingTextView extends TextView { margins[i] = endMargin; } } - if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) { + if (mResolvedDirection == LAYOUT_DIRECTION_RTL) { builder.setIndents(margins, null); } else { builder.setIndents(null, margins); @@ -91,6 +94,19 @@ public class ImageFloatingTextView extends TextView { return builder.build(); } + @Override + public void onRtlPropertiesChanged(int layoutDirection) { + super.onRtlPropertiesChanged(layoutDirection); + + if (layoutDirection != mResolvedDirection && isLayoutDirectionResolved()) { + mResolvedDirection = layoutDirection; + if (mIndentLines > 0) { + // Invalidate layout. + setHint(getHint()); + } + } + } + @RemotableViewMethod public void setHasImage(boolean hasImage) { setNumIndentLines(hasImage ? 2 : 0); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index e2ec95eb600d..3e339d8b2940 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -130,7 +130,7 @@ public class NotificationStackScrollLayout extends ViewGroup private boolean mIsBeingDragged; private int mLastMotionY; private int mDownX; - private int mActivePointerId; + private int mActivePointerId = INVALID_POINTER; private boolean mTouchIsClick; private float mInitialTouchX; private float mInitialTouchY; |