当前位置: 首页>>代码示例>>Java>>正文


Java Animation.setStartTime方法代码示例

本文整理汇总了Java中android.view.animation.Animation.setStartTime方法的典型用法代码示例。如果您正苦于以下问题:Java Animation.setStartTime方法的具体用法?Java Animation.setStartTime怎么用?Java Animation.setStartTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.animation.Animation的用法示例。


在下文中一共展示了Animation.setStartTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: animationDisplay

import android.view.animation.Animation; //导入方法依赖的package包/类
private void animationDisplay(ImageView imageView,Bitmap bitmap,Animation animation){
	animation.setStartTime(AnimationUtils.currentAnimationTimeMillis());		
       imageView.setImageBitmap(bitmap);
       imageView.startAnimation(animation);
}
 
开发者ID:PlutoArchitecture,项目名称:Pluto-Android,代码行数:6,代码来源:SimpleDisplayer.java

示例2: animateIn

import android.view.animation.Animation; //导入方法依赖的package包/类
public static void animateIn(final @NonNull View view, final @NonNull Animation animation) {
  if (view.getVisibility() == View.VISIBLE) return;

  view.clearAnimation();
  animation.reset();
  animation.setStartTime(0);
  view.setVisibility(View.VISIBLE);
  view.startAnimation(animation);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:10,代码来源:ViewUtil.java

示例3: center

import android.view.animation.Animation; //导入方法依赖的package包/类
protected void center(boolean vertical, boolean horizontal, boolean animate) {
	if (mBitmap == null)
		return;

	Matrix m = getImageViewMatrix();

	float [] topLeft  = new float[] { 0, 0 };
	float [] botRight = new float[] { mBitmap.getWidth(), mBitmap.getHeight() };

	translatePoint(m, topLeft);
	translatePoint(m, botRight);

	float height = botRight[1] - topLeft[1];
	float width  = botRight[0] - topLeft[0];

	float deltaX = 0, deltaY = 0;

	if (vertical) {
		int viewHeight = getHeight();
		if (height < viewHeight) {
			deltaY = (viewHeight - height)/2 - topLeft[1];
		} else if (topLeft[1] > 0) {
			deltaY = -topLeft[1];
		} else if (botRight[1] < viewHeight) {
			deltaY = getHeight() - botRight[1];
		}
	}

	if (horizontal) {
		int viewWidth = getWidth();
		if (width < viewWidth) {
			deltaX = (viewWidth - width)/2 - topLeft[0];
		} else if (topLeft[0] > 0) {
			deltaX = -topLeft[0];
		} else if (botRight[0] < viewWidth) {
			deltaX = viewWidth - botRight[0];
		}
	}

	postTranslate(deltaX, deltaY);
	if (animate) {
		Animation a = new TranslateAnimation(-deltaX, 0, -deltaY, 0);
		a.setStartTime(SystemClock.elapsedRealtime());
		a.setDuration(250);
		setAnimation(a);
	}
	setImageMatrix(getImageViewMatrix());
}
 
开发者ID:lpy19930103,项目名称:MinimalismJotter,代码行数:49,代码来源:ZoomableImageView.java

示例4: center

import android.view.animation.Animation; //导入方法依赖的package包/类
@Override
protected void center(boolean vertical, boolean horizontal, boolean animate) {
    if (mBitmap == null)
        return;
    if (selection == null) {
        invalidate();
        return;
    }

    Matrix m = getImageViewMatrix();

    float[] topLeft = new float[]{0, 0};
    float[] botRight = new float[]{mBitmap.getWidth(), mBitmap.getHeight()};

    translatePoint(m, topLeft);
    translatePoint(m, botRight);

    float deltaX = 0, deltaY = 0;

    if (vertical) {
        if (topLeft[1] > selection.bottom) {
            deltaY = selection.bottom - topLeft[1];
        } else if (botRight[1] < selection.top) {
            deltaY = selection.top - botRight[1];
        }
    }

    if (horizontal) {
        if (topLeft[0] > selection.right) {
            deltaX = selection.right - topLeft[0];
        } else if (botRight[0] < selection.left) {
            deltaX = selection.left - botRight[0];
        }
    }

    postTranslate(deltaX, deltaY);
    if (animate) {
        Animation a = new TranslateAnimation(-deltaX, 0, -deltaY, 0);
        a.setStartTime(SystemClock.elapsedRealtime());
        a.setDuration(250);
        setAnimation(a);
    }
    setImageMatrix(getImageViewMatrix());
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:45,代码来源:CropImageView.java


注:本文中的android.view.animation.Animation.setStartTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。