implement PopupWindow.update()

This commit is contained in:
Julian Winkler
2025-02-15 10:39:14 +01:00
parent 9f94f9d668
commit 4a7db70fbc
4 changed files with 26 additions and 3 deletions

View File

@@ -669,9 +669,9 @@ public class ListPopupWindow {
mPopup.setOutsideTouchable(!mForceIgnoreOutsideTouch && !mDropDownAlwaysVisible);
// mPopup.update(getAnchorView(), mDropDownHorizontalOffset,
// mDropDownVerticalOffset, (widthSpec < 0)? -1 : widthSpec,
// (heightSpec < 0)? -1 : heightSpec);
mPopup.update(getAnchorView(), mDropDownHorizontalOffset,
mDropDownVerticalOffset, (widthSpec < 0)? -1 : widthSpec,
(heightSpec < 0)? -1 : heightSpec);
// mPopup.getContentView().restoreDefaultFocus();
} else {
final int widthSpec;

View File

@@ -45,6 +45,7 @@ public class PopupWindow {
protected native void native_showAsDropDown(long widget, long anchor, int xoff, int yoff, int gravity);
protected native boolean native_isShowing(long widget);
protected native void native_dismiss(long widget);
protected native void native_update(long widget, long anchor, int xoff, int yoff, int width, int height);
public void setBackgroundDrawable(Drawable background) {}
@@ -109,4 +110,8 @@ public class PopupWindow {
public void setTouchModal(boolean touchModal) {}
public void setElevation(float elevation) {}
public void update(View anchor, int xoff, int yoff, int width, int height) {
native_update(popover, anchor.widget, xoff, yoff, width, height);
}
}