Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df6ee1ec authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev
Browse files

Fix tooltips for views in a popup window

The current implementation is using the anchor view's getWindowToken to
construct the TooltipPopup instance. This does not work if the anchor
view is in a popup window.

Using getApplicationWindowToken fixes the problem.

Bug: 64595364
Test: android.view.cts.TooltipTest#testTooltipInPopup
Change-Id: I1a887c9ae6ac00f2412891f316367acfc56cef94
parent 45fb339d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ public class TooltipPopup {

    private void computePosition(View anchorView, int anchorX, int anchorY, boolean fromTouch,
            WindowManager.LayoutParams outParams) {
        outParams.token = anchorView.getWindowToken();
        outParams.token = anchorView.getApplicationWindowToken();

        final int tooltipPreciseAnchorThreshold = mContext.getResources().getDimensionPixelOffset(
                com.android.internal.R.dimen.tooltip_precise_anchor_threshold);