Lines Matching refs:anchor

167             final View anchor = mAnchor != null ? mAnchor.get() : null;
168 if (anchor != null && mDecorView != null) {
172 updateAboveAnchor(findDropDownPosition(anchor, p, mAnchorXoff, mAnchorYoff,
382 // used when the drop-down is placed above its anchor view, and the one to be
383 // used when the drop-down is placed below its anchor view. We extract
389 // at least one other drawable, intended for the 'below-anchor state'.
393 // Find the above-anchor view - this one's easy, it should be labeled as such.
396 // Now, for the below-anchor view, look for any other drawable specified in the
397 // StateListDrawable which is not for the above-anchor state and use that.
725 * Allow PopupWindow to scroll the anchor's parent to provide more room
728 * @param enabled True to scroll the anchor's parent when more room is desired by the popup.
944 * Sets whether the popup window should overlap its anchor view when
950 * @param overlapAnchor Whether the popup should overlap its anchor.
960 * Returns whether the popup window should overlap its anchor view when
963 * @return Whether the popup should overlap its anchor.
1037 * corner of the anchor view. If there is not enough room on screen to show
1041 * anchor view.
1043 * @param anchor the view on which to pin the popup window
1047 public void showAsDropDown(View anchor) {
1048 showAsDropDown(anchor, 0, 0);
1053 * corner of the anchor view offset by the specified x and y coordinates.
1057 * pinned at the top left corner of the anchor view.
1059 * If the view later scrolls to move <code>anchor</code> to a different
1062 * @param anchor the view on which to pin the popup window
1063 * @param xoff A horizontal offset from the anchor in pixels
1064 * @param yoff A vertical offset from the anchor in pixels
1068 public void showAsDropDown(View anchor, int xoff, int yoff) {
1069 showAsDropDown(anchor, xoff, yoff, DEFAULT_ANCHORED_GRAVITY);
1080 * the popup will anchor itself such that it is visible.
1082 * If the view later scrolls to move <code>anchor</code> to a different
1085 * @param anchor the view on which to pin the popup window
1086 * @param xoff A horizontal offset from the anchor in pixels
1087 * @param yoff A vertical offset from the anchor in pixels
1088 * @param gravity Alignment of the popup relative to the anchor
1092 public void showAsDropDown(View anchor, int xoff, int yoff, int gravity) {
1099 registerForScrollChanged(anchor, xoff, yoff, gravity);
1104 final WindowManager.LayoutParams p = createPopupLayoutParams(anchor.getWindowToken());
1107 final boolean aboveAnchor = findDropDownPosition(anchor, p, xoff, yoff, gravity);
1119 // with above-anchor and below-anchor states, use those.
1136 * is less than the y coordinate of the anchor) or below the anchor view (the y coordinate
1137 * of the popup is greater than y coordinate of the anchor's bottom).
1143 * @return True if this popup is showing above the anchor view, false otherwise.
1267 View anchor = mAnchor.get();
1268 if (anchor != null && mPopupViewInitialLayoutDirectionInherited) {
1269 mDecorView.setLayoutDirection(anchor.getLayoutDirection());
1286 // setting the x and y offsets to match the anchor's bottom-left
1380 * to fit under the anchor, a parent scroll view is seeked and scrolled up
1382 * window gets moved on top of the anchor.
1387 * @param anchor the view on which the popup window must be anchored
1394 private boolean findDropDownPosition(View anchor, WindowManager.LayoutParams p, int xoff,
1396 final int anchorHeight = anchor.getHeight();
1397 final int anchorWidth = anchor.getWidth();
1402 anchor.getLocationInWindow(mDrawingLocation);
1406 final int hgrav = Gravity.getAbsoluteGravity(gravity, anchor.getLayoutDirection())
1410 // anchor instead of left.
1418 anchor.getLocationOnScreen(mScreenLocation);
1420 anchor.getWindowVisibleDisplayFrame(displayFrame);
1423 final View root = anchor.getRootView();
1430 final int scrollX = anchor.getScrollX();
1431 final int scrollY = anchor.getScrollY();
1434 anchor.requestRectangleOnScreen(r, true);
1438 // whether the pop-up will go above or below the anchor.
1439 anchor.getLocationInWindow(mDrawingLocation);
1448 // Determine whether there is more space above or below the anchor.
1449 anchor.getLocationOnScreen(mScreenLocation);
1493 * @param anchor The view on which the popup window must be anchored.
1497 public int getMaxAvailableHeight(View anchor) {
1498 return getMaxAvailableHeight(anchor, 0);
1507 * @param anchor The view on which the popup window must be anchored.
1512 public int getMaxAvailableHeight(View anchor, int yOffset) {
1513 return getMaxAvailableHeight(anchor, yOffset, false);
1523 * @param anchor The view on which the popup window must be anchored.
1533 public int getMaxAvailableHeight(View anchor, int yOffset, boolean ignoreBottomDecorations) {
1535 anchor.getWindowVisibleDisplayFrame(displayFrame);
1538 anchor.getLocationOnScreen(anchorPos);
1542 Resources res = anchor.getContext().getResources();
1545 final int distanceToBottom = bottomEdge - (anchorPos[1] + anchor.getHeight()) - yOffset;
1548 // anchorPos[1] is distance from anchor to top of screen
1612 // Clears the anchor view.
1621 final View anchor = mAnchor != null ? mAnchor.get() : null;
1623 if (anchor == null || decor == null) {
1627 final int[] anchorLocation = anchor.getLocationOnScreen();
1630 // Compute the position of the anchor relative to the popup.
1631 final Rect bounds = new Rect(0, 0, anchor.getWidth(), anchor.getHeight());
1822 * @param anchor the popup's anchor view
1826 public void update(View anchor, int width, int height) {
1827 update(anchor, false, 0, 0, true, width, height);
1837 * If the view later scrolls to move {@code anchor} to a different
1840 * @param anchor the popup's anchor view
1846 public void update(View anchor, int xoff, int yoff, int width, int height) {
1847 update(anchor, true, xoff, yoff, true, width, height);
1850 private void update(View anchor, boolean updateLocation, int xoff, int yoff,
1859 if (oldAnchor == null || oldAnchor.get() != anchor || (needsUpdate && !mIsDropdown)) {
1860 registerForScrollChanged(anchor, xoff, yoff, mAnchoredGravity);
1885 updateAboveAnchor(findDropDownPosition(anchor, p, xoff, yoff, mAnchoredGravity));
1887 updateAboveAnchor(findDropDownPosition(anchor, p, mAnchorXoff, mAnchorYoff,
1906 final View anchor = anchorRef == null ? null : anchorRef.get();
1907 if (anchor != null) {
1908 final ViewTreeObserver vto = anchor.getViewTreeObserver();
1915 private void registerForScrollChanged(View anchor, int xoff, int yoff, int gravity) {
1918 mAnchor = new WeakReference<>(anchor);
1920 final ViewTreeObserver vto = anchor.getViewTreeObserver();