當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。