本文整理了Java中android.widget.PopupWindow.update()
方法的一些代码示例,展示了PopupWindow.update()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PopupWindow.update()
方法的具体详情如下:
包路径:android.widget.PopupWindow
类名称:PopupWindow
方法名:update
暂无
代码示例来源:origin: rey5137/material
@Override
public void update(View anchor, int xoff, int yoff, int width, int height) {
if (Build.VERSION.SDK_INT < 21 && mOverlapAnchor) {
// If we're pre-L, emulate overlapAnchor by modifying the yOff
yoff -= anchor.getHeight();
}
super.update(anchor, xoff, yoff, width, height);
}
}
代码示例来源:origin: ZieIony/Carbon
@Override
public void update(int x, int y) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
super.update(0, y, wm.getDefaultDisplay().getWidth(), contentView.getMeasuredHeight());
bubble.setTranslationX(x);
}
代码示例来源:origin: ZieIony/Carbon
public boolean show(View anchor) {
super.showAtLocation(anchor, Gravity.START | Gravity.TOP, 0, 0);
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
contentView.measure(View.MeasureSpec.makeMeasureSpec(wm.getDefaultDisplay().getWidth(), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
super.update(wm.getDefaultDisplay().getWidth(), contentView.getMeasuredHeight());
bubble.animateVisibility(View.VISIBLE);
return true;
}
代码示例来源:origin: ZieIony/Carbon
public boolean showImmediate(View anchor) {
super.showAtLocation(anchor, Gravity.START | Gravity.TOP, 0, 0);
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
contentView.measure(View.MeasureSpec.makeMeasureSpec(wm.getDefaultDisplay().getWidth(), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
super.update(wm.getDefaultDisplay().getWidth(), contentView.getMeasuredHeight());
bubble.setVisibility(View.VISIBLE);
return true;
}
代码示例来源:origin: ZieIony/Carbon
public void update() {
if (editText == null)
return;
final Resources res = getContentView().getContext().getResources();
int margin = (int) res.getDimension(R.dimen.carbon_padding);
int itemHeight = (int) res.getDimension(R.dimen.carbon_menuHeight);
Rect windowRect = new Rect();
editText.getWindowVisibleDisplayFrame(windowRect);
int[] location = new int[2];
editText.getLocationInWindow(location);
LinearLayout content = getContentView().findViewById(R.id.carbon_menuContent);
content.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(itemHeight, View.MeasureSpec.EXACTLY));
int popupX = location[0] - margin;
int popupY = location[1] - margin * 2 - content.getMeasuredHeight();
update(popupX, popupY, content.getMeasuredWidth() + margin * 2, content.getMeasuredHeight() + margin * 2);
super.update();
}
代码示例来源:origin: stackoverflow.com
if (click) {
popUp.showAtLocation(layout, Gravity.BOTTOM, 10, 10);
popUp.update(50, 50, 300, 80);
click = false;
} else {
代码示例来源:origin: stackoverflow.com
isClicked = false;
popUpWindow.showAtLocation(mainLayout, Gravity.BOTTOM, 10, 10);
popUpWindow.update(50, 50, 320, 90);
} else {
isClicked = true;
代码示例来源:origin: ZieIony/Carbon
super.update();
代码示例来源:origin: ZieIony/Carbon
super.update();
代码示例来源:origin: seven332/EhViewer
private void updatePopup() {
int width = getWidth();
int paddingTop = getPaddingTop();
int paddingBottom = getPaddingBottom();
getLocationInWindow(mTemp);
mPopupWidth = (int) (width - mRadius - mRadius + mBubbleWidth);
int popupHeight = mBubbleHeight;
mPopupX = (int) (mTemp[0] + mRadius - (mBubbleWidth / 2));
mPopupY = (int) (mTemp[1] - popupHeight + paddingTop +
((getHeight() - paddingTop - paddingBottom) / 2) -
mRadius -LayoutUtils.dp2pix(mContext, 2));
mPopup.update(mPopupX, mPopupY, mPopupWidth, popupHeight, false);
}
代码示例来源:origin: lipangit/JiaoZiVideoPlayer
int offsetX = clarity.getMeasuredWidth() / 3;
int offsetY = clarity.getMeasuredHeight() / 3;
clarityPopWindow.update(clarity, -offsetX, -offsetY, Math.round(layout.getMeasuredWidth() * 2), layout.getMeasuredHeight());
} else if (i == R.id.retry_btn) {
if (jzDataSource.urlsMap.isEmpty() || jzDataSource.getCurrentUrl() == null) {
代码示例来源:origin: stackoverflow.com
View pview = inflater.inflate(R.layout.popup_example,(ViewGroup)findViewById(R.layout.main));
PopupWindow pw = new PopupWindow(pview);
pw.showAtLocation(v, Gravity.LEFT,0,0);
pw.update(8,-70,150,270);
//if onclick written here, it gives null pointer exception.
ImageButton img=(ImageButton)pview.findViewById(R.id.home);
img.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
Intent.....
}
});
代码示例来源:origin: zyyoona7/EasyPopup
/**
* 更新 PopupWindow 到精准的位置
*
* @param width
* @param height
* @param anchor
* @param yGravity
* @param xGravity
* @param x
* @param y
*/
private void updateLocation(int width, int height, @NonNull View anchor, @YGravity final int yGravity, @XGravity int xGravity, int x, int y) {
if (mPopupWindow == null) {
return;
}
x = calculateX(anchor, xGravity, width, x);
y = calculateY(anchor, yGravity, height, y);
mPopupWindow.update(anchor, x, y, width, height);
}
代码示例来源:origin: stackoverflow.com
popupWindow.showAtLocation(findViewById(R.id.btn_show), Gravity.NO_GRAVITY, 0, 0);
popupWindow.setFocusable(true);
popupWindow.update();
flag =true;
} else {
代码示例来源:origin: pinguo-zhouwei/CustomPopwindow
mPopupWindow.update();
代码示例来源:origin: PopFisher/SmartPopupWindow
private void updatePopupPos() {
if (mCurOrientation == ActivityInfo.SCREEN_ORIENTATION_USER || mCurOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
mPopupWindow.update(0, 0, -1, -1);
} else if (mCurOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
mPopupWindow.update(0, 800, -1, -1);
}
}
}
代码示例来源:origin: PopFisher/SmartPopupWindow
public void updatePopupWindow5(final View anchorView) {
// 在android7.0里面,update方法里面会覆盖PopupWindow的Gravity属性
if (mCurPopupWindow != null) {
mCurPopupWindow.update();
}
}
代码示例来源:origin: com.actionbarsherlock/actionbarsherlock
@Override
public void update(View anchor, int xoff, int yoff, int width, int height) {
super.update(anchor, xoff, yoff, width, height);
registerListener(anchor);
}
代码示例来源:origin: stackoverflow.com
final PopupWindow popUp = new PopupWindow(context);
LayoutInflater inflater = LayoutInflater.from(this);
final LinearLayout ll =
(LinearLayout)inflater.inflate(R.layout.settings_caching_popup, null);
popUp.setContentView(ll);
ll.post(new Runnable() {
public void run() {
popUp.showAtLocation(ll, Gravity.BOTTOM, 10, 10);
popUp.update(50, 50, 300, 80);
}
});
代码示例来源:origin: techery/progresshint
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
String popupText = mHintAdapter.getHint(mSeekBar, progress);
mPopupTextView.setText(popupText);
if (mPopupStyle == POPUP_FOLLOW) {
Point offsetPoint = getFollowHintOffset();
mPopup.update(mSeekBar, offsetPoint.x, offsetPoint.y, -1, -1);
}
}
内容来源于网络,如有侵权,请联系作者删除!