android.widget.ImageView.setPivotY()方法的使用及代码示例

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

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

ImageView.setPivotY介绍

暂无

代码示例

代码示例来源:origin: ZieIony/Carbon

@Override
public void setPivotY(float pivotY) {
  super.setPivotY(pivotY);
  invalidateParentIfNeeded();
  fireOnTransformationChangedListener();
}

代码示例来源:origin: heinrichreimer/material-drawer

@Override
public void onAnimationStart(Animator animation) {
  imageViewProfileAvatarSecondary.setPivotX(0);
  imageViewProfileAvatarSecondary.setPivotY(0);
}

代码示例来源:origin: yll2wcf/book

public void rotateClick(View view) {
    //利用ObjectAnimator实现旋转动画
    iv.setPivotX(iv.getWidth()/2);
    iv.setPivotY(iv.getHeight()/2);
    ObjectAnimator.ofFloat(iv, "rotation", 0, 360)
        .setDuration(1000).start();
  }
}

代码示例来源:origin: yll2wcf/book

public void scaleClick(View view) {
  //利用AnimatorSet和ObjectAnimator实现缩放动画
  final AnimatorSet animatorSet = new AnimatorSet();
  //设置缩放的基准点
  iv.setPivotX(iv.getWidth()/2);
  iv.setPivotY(iv.getHeight()/2);
  animatorSet.playTogether(
      ObjectAnimator.ofFloat(iv, "scaleX", 1, 0,1).setDuration(5000), //X轴缩放
      ObjectAnimator.ofFloat(iv, "scaleY", 1, 0,1).setDuration(5000));//Y轴缩放
  animatorSet.start();
}
//位移按钮的点击事件

代码示例来源:origin: DingMouRen/DingDingMap

@Override
public void setRotateAnchorPoints() {
  image.setPivotX(buttonRadius - imageRect.left);
  image.setPivotY(buttonRadius - imageRect.top);
}

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

ImageView  ball;

int i = ball.getMeasuredHeight();

ObjectAnimator animation = ObjectAnimator.ofFloat(ball, "rotation", 0, 360);
animation.setDuration(10000);
ball.setPivotX(0);
ball.setPivotY(i / 2);
animation.setRepeatCount(ObjectAnimator.INFINITE);
animation.setInterpolator(new LinearInterpolator());
animation.start();

代码示例来源:origin: ronaldsmartin/Material-ViewPagerIndicator

@Override
public void onAnimationStart(Animator animation) {
  super.onAnimationStart(animation);
  centerSegment.setPivotX(pivotX);
  centerSegment.setPivotY(pivotY);
}

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

ImageView imageView;
 imageView = addImageView(mainLayout, 200, 300, 200, 200, new OnClickListener() {
   @Override
   public void onClick(View v) {
     imageView.setPivotX(200);
     imageView.setPivotY(200);
     imageView.setRotation(45);
   }
 });

代码示例来源:origin: ronaldsmartin/Material-ViewPagerIndicator

@Override
  public void onAnimationEnd(Animator animation) {
    // Reset values.
    centerSegment.setVisibility(INVISIBLE);
    centerSegment.setScaleX(originalScale);
    centerSegment.setScaleY(originalScale);
    centerSegment.setPivotX(originalPivotX);
    centerSegment.setPivotY(originalPivotY);
  }
});

代码示例来源:origin: DingMouRen/DingDingMap

@Override
public void setRotateAnchorPoints() {
  image.setPivotX(buttonRadius - imageRect.left);
  image.setPivotY(buttonRadius - imageRect.top);
  text.setPivotX(buttonRadius - textRect.left);
  text.setPivotY(buttonRadius - textRect.top);
}

代码示例来源:origin: MoMoWait/LeanbackLauncher

private void setUpThreeBarAnimators() {
  Context context = getContext();
  this.mThreeBarAnimator = new AnimatorSet();
  int pivotY = getBarDrawable(context.getResources()).getIntrinsicHeight();
  this.mImage1 = (ImageView) findViewById(R.id.bar1);
  this.mImage1.setPivotY((float) pivotY);
  DropListener.setDropScale(this.mImage1);
  this.mImage2 = (ImageView) findViewById(R.id.bar2);
  this.mImage2.setPivotY((float) pivotY);
  DropListener.setDropScale(this.mImage2);
  this.mImage3 = (ImageView) findViewById(R.id.bar3);
  this.mImage3.setPivotY((float) pivotY);
  DropListener.setDropScale(this.mImage3);
  ObjectAnimator bar1Animator = ObjectAnimator.ofFloat(this.mImage1, "scaleY", new float[]{0.41666666f, 0.25f, 0.41666666f, 0.5833333f, 0.75f, 0.8333333f, 0.9166667f, 1.0f, 0.9166667f, 1.0f, 0.8333333f, 0.6666667f, 0.5f, 0.33333334f, 0.16666667f, 0.33333334f, 0.5f, 0.5833333f, 0.75f, 0.9166667f, 0.75f, 0.5833333f, 0.41666666f, 0.25f, 0.41666666f, 0.6666667f, 0.41666666f, 0.25f, 0.33333334f, 0.41666666f});
  bar1Animator.setRepeatCount(-1);
  bar1Animator.setDuration(2320);
  bar1Animator.setInterpolator(new LinearInterpolator());
  ObjectAnimator bar2Animator = ObjectAnimator.ofFloat(this.mImage2, "scaleY", new float[]{1.0f, 0.9166667f, 0.8333333f, 0.9166667f, 1.0f, 0.9166667f, 0.75f, 0.5833333f, 0.75f, 0.9166667f, 1.0f, 0.8333333f, 0.6666667f, 0.8333333f, 1.0f, 0.9166667f, 0.75f, 0.41666666f, 0.25f, 0.41666666f, 0.6666667f, 0.8333333f, 1.0f, 0.8333333f, 0.75f, 0.6666667f, 1.0f});
  bar2Animator.setRepeatCount(-1);
  bar2Animator.setDuration(2080);
  bar2Animator.setInterpolator(new LinearInterpolator());
  ObjectAnimator bar3Animator = ObjectAnimator.ofFloat(this.mImage3, "scaleY", new float[]{0.6666667f, 0.75f, 0.8333333f, 1.0f, 0.9166667f, 0.75f, 0.5833333f, 0.41666666f, 0.5833333f, 0.6666667f, 0.75f, 1.0f, 0.9166667f, 1.0f, 0.75f, 0.5833333f, 0.75f, 0.9166667f, 1.0f, 0.8333333f, 0.6666667f, 0.75f, 0.5833333f, 0.41666666f, 0.25f, 0.6666667f});
  bar3Animator.setRepeatCount(-1);
  bar3Animator.setDuration(2000);
  bar3Animator.setInterpolator(new LinearInterpolator());
  this.mThreeBarAnimator.playTogether(new Animator[]{bar1Animator, bar2Animator, bar3Animator});
  findViewById(R.id.scrim).setVisibility(0);
}

代码示例来源:origin: DingMouRen/DingDingMap

@Override
public void setRotateAnchorPoints() {
  image.setPivotX(buttonRadius - imageRect.left);
  image.setPivotY(buttonRadius - imageRect.top);
  text.setPivotX(trueRadius - textRect.left);
  text.setPivotY(trueRadius - textRect.top);
}

代码示例来源:origin: andforce/iBeebo

@Override
  public void onGlobalLayout() {
    content.getViewTreeObserver().removeGlobalOnLayoutListener(this);// .removeOnGlobalLayoutListener(this);
    if (ori == null) {
      return;
    }
    int[] avatarLocation = new int[2];
    avatar.getLocationOnScreen(avatarLocation);
    final int transX = ori.left - avatarLocation[0];
    final int transY = ori.top - avatarLocation[1];
    final float scaleX = (float) ori.width() / (float) avatar.getWidth();
    final float scaleY = (float) ori.height() / (float) avatar.getHeight();
    avatar.setTranslationX(transX);
    avatar.setTranslationY(transY);
    avatar.setPivotX(0);
    avatar.setPivotY(0);
    avatar.setScaleX(scaleX);
    avatar.setScaleY(scaleY);
    avatar.animate().translationX(0).translationY(0).scaleY(1).scaleX(1).alpha(1.0f).setDuration(300);
  }
});

代码示例来源:origin: 18Gray/ProCamera

float pivotY = y + iv_focus_camera.getMeasuredHeight() / 2;
iv_arraw_awb.setPivotX(pivotX);
iv_arraw_awb.setPivotY(pivotY);
objectAnimator.setDuration(1000);

代码示例来源:origin: GaoGersy/MultiSelecter

mFloatImg_1.setPivotY(mFloatImg_1.getHeight() / 2);
mFloatImg_1.setVisibility(View.VISIBLE);
int[] initial = new int[2];

代码示例来源:origin: AllenCoder/Recyclerview

imageView.setPivotY(lp.height / 2);

代码示例来源:origin: fookwood/Launcher3

if (fi.getFolder() != null) {
  mFolderIconImageView.setPivotX(fi.getFolder().getPivotXForIconAnimation());
  mFolderIconImageView.setPivotY(fi.getFolder().getPivotYForIconAnimation());

代码示例来源:origin: WeAreFairphone/FP2-Launcher

if (fi.getFolder() != null) {
  mFolderIconImageView.setPivotX(fi.getFolder().getPivotXForIconAnimation());
  mFolderIconImageView.setPivotY(fi.getFolder().getPivotYForIconAnimation());

代码示例来源:origin: klinker24/Android-Blur-Launcher

if (fi.getFolder() != null) {
  mFolderIconImageView.setPivotX(fi.getFolder().getPivotXForIconAnimation());
  mFolderIconImageView.setPivotY(fi.getFolder().getPivotYForIconAnimation());

代码示例来源:origin: klinker24/launcher3

if (fi.getFolder() != null) {
  mFolderIconImageView.setPivotX(fi.getFolder().getPivotXForIconAnimation());
  mFolderIconImageView.setPivotY(fi.getFolder().getPivotYForIconAnimation());

相关文章

ImageView类方法