android.widget.ImageButton.getHeight()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中android.widget.ImageButton.getHeight()方法的一些代码示例,展示了ImageButton.getHeight()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageButton.getHeight()方法的具体详情如下:
包路径:android.widget.ImageButton
类名称:ImageButton
方法名:getHeight

ImageButton.getHeight介绍

暂无

代码示例

代码示例来源:origin: nickbutcher/plaid

private void showFab() {
  fab.setAlpha(0f);
  fab.setScaleX(0f);
  fab.setScaleY(0f);
  fab.setTranslationY(fab.getHeight() / 2);
  fab.animate()
      .alpha(1f)
      .scaleX(1f)
      .scaleY(1f)
      .translationY(0f)
      .setDuration(300L)
      .setInterpolator(AnimUtils.getLinearOutSlowInInterpolator(this))
      .start();
}

代码示例来源:origin: asyl/ArcAnimator

void upRed() {
  startRedX = mRed.getX();
  startRedY = mRed.getY();
  ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mRed, "y", mRed.getY(),
      mBluePair.getBottom() - mRed.getHeight() / 2);
  objectAnimator.addListener(new SimpleListener() {
    @Override
    public void onAnimationEnd(Animator animation) {
      disappearRed();
    }
  });
  objectAnimator.setDuration(650);
  objectAnimator.setInterpolator(ACCELERATE_DECELERATE);
  objectAnimator.start();
}

代码示例来源:origin: asyl/ArcAnimator

void appearRed() {
  mRed.setVisibility(View.VISIBLE);
  int cx = mRed.getWidth() / 2;
  int cy = mRed.getHeight() / 2;
  SupportAnimator animator = ViewAnimationUtils.createCircularReveal(mRed, cx, cy, 0, mRed.getWidth() / 2);
  animator.addListener(new SimpleListener() {
    @Override
    public void onAnimationEnd() {
      upRed();
    }
  });
  animator.setInterpolator(ACCELERATE);
  animator.start();
}

代码示例来源:origin: asyl/ArcAnimator

void disappearRed() {
  int cx = mRed.getWidth() / 2;
  int cy = mRed.getHeight() / 2;
  SupportAnimator animator = ViewAnimationUtils.createCircularReveal(mRed, cx, cy, mRed.getWidth() / 2, 0);
  animator.addListener(new SimpleListener() {
    @Override
    public void onAnimationEnd() {
      mRed.setVisibility(View.INVISIBLE);
      mRed.setX(startRedX);
      mRed.setY(startRedY);
      release();
    }
  });
  animator.setInterpolator(DECELERATE);
  animator.start();
}

代码示例来源:origin: GitLqr/MaterialDesignDemo

@Override
public void hide() {
  mToolbar.animate().translationY(-(mToolbar.getHeight() + mToolbarBottomMargin)).setInterpolator(new AccelerateInterpolator(3));
  mFab.animate().translationY(mFab.getHeight() + mFabBottomMargin).setInterpolator(new AccelerateInterpolator(3));
}

代码示例来源:origin: stackoverflow.com

private void setupBalloon(ImageButton b, int i) {
  int imageId = (int)(Math.random() * images.length);
  LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
      LinearLayout.LayoutParams.WRAP_CONTENT);
  b.setLayoutParams(params);
  b.setImageResource(images[imageId]);
  b.setBackgroundColor(Color.TRANSPARENT);
  b.setScaleX(0.4f);
  b.setScaleY(0.4f);
  b.setX((float) (Math.random() * (width - b.getWidth())));
  b.setY((float) (Math.random() * (height - b.getHeight())));
  b.setVisibility(View.VISIBLE);
}

代码示例来源:origin: stackoverflow.com

final ImageButton button = (ImageButton) findViewById(R.id.my_button);
final LinearLayout button_container = (LinearLayout) findViewById(R.id.my_window);

button.setOnClickListener(new OnClickListener() {
  public void onClick (View v) {

    // change button image
    int imgNo = (int) (Math.random() * 9) + 1; // 9 images in the folder, start at index 1
    int imgID = getResources().getIdentifier("chef" + imgNo, "drawable", getPackageName());
    button.setBackgroundResource(imgID);
    button.requestLayout(); // size to fit content

    // move button to a random location
    int x = (int) (Math.random() * (button_container.getWidth() - button.getWidth()));
    int y = (int) (Math.random() * (button_container.getHeight() - button.getHeight()));
    button_container.setPadding(x, y, 0, 0);
  }   
});
button.performClick(); // run once at the start to set image and position randomly

代码示例来源:origin: googlecreativelab/lipswap

private void hideEditControls() {
  int marginBottom = getResources().getDimensionPixelSize(R.dimen.margin_bottom);
  mEditContainer.startAnimation(mHideEditAnim);
  mEditContainer.setVisibility(View.GONE);
  TranslateAnimation recordAnim = new TranslateAnimation(0, 0,
      mRecordBtn.getHeight() + marginBottom, 0);
  recordAnim.setDuration(350);
  recordAnim.setStartOffset(300);
  recordAnim.setInterpolator(new OvershootInterpolator());
  mRecordBtn.startAnimation(recordAnim);
  mRecordBtn.setVisibility(View.VISIBLE);
}

代码示例来源:origin: googlecreativelab/lipswap

private void showEditControls() {
  int marginBottom = getResources().getDimensionPixelSize(R.dimen.margin_bottom);
  TranslateAnimation recordAnim = new TranslateAnimation(0, 0, 0,
      mRecordBtn.getHeight() + marginBottom);
  recordAnim.setDuration(350);
  recordAnim.setInterpolator(new AnticipateInterpolator());
  mRecordBtn.startAnimation(recordAnim);
  mRecordBtn.setVisibility(View.GONE);
  mShowEditAnim.setStartOffset(300);
  mEditContainer.startAnimation(mShowEditAnim);
  mEditContainer.setVisibility(View.VISIBLE);
}

代码示例来源:origin: stackoverflow.com

protected void onStart() {
  super.onStart();
  rel.drawCircle(pontos,center.getX() + center.getWidth()/2,center.getY() + center.getHeight()/2);
  rel.invalidate();

代码示例来源:origin: stackoverflow.com

.getRight() - imageButton.getWidth();
maxY = imageButton.getRootView()
  .getBottom() - imageButton.getHeight();

代码示例来源:origin: PuffOpenSource/Puff-Android

buttonSkip.setTranslationY(0);
} else {
  buttonSkip.setTranslationY((1 - offset) * 2 * buttonNext.getHeight());
  buttonNext.setTranslationY(0);
} else {
  buttonNext.setTranslationY(offset * 2 * buttonNext.getHeight());
  buttonSkip.setTranslationX((rtl ? 1 : -1) * pager.getWidth());
} else {
  buttonSkip.setTranslationY(offset * 2 * buttonNext.getHeight());
  buttonNext.setTranslationY(offset * 2 * buttonNext.getHeight());
} else {
  buttonNext.setTranslationY(-2 * buttonNext.getHeight());

代码示例来源:origin: stackoverflow.com

b.setPosition(
      (stage.getWidth() - b.getWidth()) / 2f,
      (stage.getHeight() - b.getHeight()) / 2f);
} else

代码示例来源:origin: stackoverflow.com

fromY = ib1.getTop() + ib1.getHeight() / 2 + glActionMenu.getTop();
toX = ib2.getLeft();
toY = ib2.getTop() + ib2.getHeight() / 2;

相关文章

ImageButton类方法