summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-11-29 23:51:38 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-11-29 23:51:38 +0000
commitfb19b383bf2335ef81a1912987543e764adc62fc (patch)
treea00a4567d22add6c5cc14ba3ffc6f6328e81278e
parent4d2ec90742f8ba7b27b212fb0f6eeabbf625f2d5 (diff)
parentbdd2c25ef69148e52dd406615efbd4e5ad41b335 (diff)
Merge "Fix horizontal position of tooltip in a Dialog"
-rw-r--r--core/java/com/android/internal/view/TooltipPopup.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/com/android/internal/view/TooltipPopup.java b/core/java/com/android/internal/view/TooltipPopup.java
index d38ea2c19af4..24f0b0cc91c5 100644
--- a/core/java/com/android/internal/view/TooltipPopup.java
+++ b/core/java/com/android/internal/view/TooltipPopup.java
@@ -142,7 +142,7 @@ public class TooltipPopup {
mTmpAnchorPos[1] -= mTmpAppPos[1];
// mTmpAnchorPos is now relative to the main app window.
- outParams.x = mTmpAnchorPos[0] + offsetX - mTmpDisplayFrame.width() / 2;
+ outParams.x = mTmpAnchorPos[0] + offsetX - appView.getWidth() / 2;
final int spec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
mContentView.measure(spec, spec);
@@ -157,6 +157,9 @@ public class TooltipPopup {
outParams.y = yBelow;
}
} else {
+ // Use mTmpDisplayFrame.height() as the lower boundary instead of appView.getHeight(),
+ // as the latter includes the navigation bar, and tooltips do not look good over
+ // the navigation bar.
if (yBelow + tooltipHeight <= mTmpDisplayFrame.height()) {
outParams.y = yBelow;
} else {