本文整理了Java中android.widget.Button.getTop()
方法的一些代码示例,展示了Button.getTop()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.getTop()
方法的具体详情如下:
包路径:android.widget.Button
类名称:Button
方法名:getTop
暂无
代码示例来源:origin: apps4av/avare
int topY = (mMenuButton.getHeight() / 2) + mMenuButton.getTop();
代码示例来源:origin: SmartisanTech/SmartisanOS-SDK
@Override
public void onClick(View view) {
if (mOneStepHelper.isOneStepShowing()) {
mTextDragPopupWindow = mOneStepHelper.showDragPopupText(btn_show_popup,
dragListener,
"One Step",
btn_show_popup.getLeft(),
btn_show_popup.getTop());
}
}
代码示例来源:origin: AndBible/and-bible
/** calculate button position relative to this table because MotionEvents are relative to this table
*/
private void recordButtonPositions() {
for (ButtonInfo buttonInfo : buttonInfoList) {
// get position of button within row
Button button = buttonInfo.button;
TableRow tableRow = (TableRow)button.getParent();
buttonInfo.left += button.getLeft()+tableRow.getLeft();
buttonInfo.top += button.getTop()+tableRow.getTop();
buttonInfo.right += button.getRight()+tableRow.getLeft();
buttonInfo.bottom += button.getBottom()+tableRow.getTop();
}
// calculate offset of 2 button heights so users can see the buttons surrounding the current button pressed
if (buttonInfoList.size()>0) {
ButtonInfo but1 = buttonInfoList.get(0);
mPreviewOffset = but1.top - but1.bottom;
}
}
/**
代码示例来源:origin: wasdennnoch/AndroidN-ify
private void revealTheButton(Button v) {
XposedHook.logD("androidn_ify", "reveal");
mSelectedContainer.setVisibility(View.VISIBLE);
int centerX = v.getLeft() + v.getWidth() / 2;
int centerY = v.getTop() + v.getHeight() / 2;
Animator reveal = ViewAnimationUtils.createCircularReveal( // TODO work out why this isn't working, same for hide
mSelectedContainer,
centerX,
centerY,
0,
Math.max(centerX, mSelectedContainer.getWidth() - centerX)
+ Math.max(centerY, mSelectedContainer.getHeight() - centerY));
reveal.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mButton.setVisibility(View.INVISIBLE);
}
});
reveal.start();
//animateHintText(mSelectedLabel, v, reveal);
animateHintText(mLaunchHint, v, reveal);
mSelectedLabel.setText(v.getText());
mLayout.postDelayed(mHideRunnable, HIDE_DELAY);
mLayout.postDelayed(mRippleRunnable, RIPPLE_PAUSE / 2);
// Transfer focus from the originally clicked button to the expanded button.
mSelectedContainer.requestFocus();
}
内容来源于网络,如有侵权,请联系作者删除!