當前位置: 首頁>>代碼示例>>Java>>正文


Java View.setAnimation方法代碼示例

本文整理匯總了Java中android.view.View.setAnimation方法的典型用法代碼示例。如果您正苦於以下問題:Java View.setAnimation方法的具體用法?Java View.setAnimation怎麽用?Java View.setAnimation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.View的用法示例。


在下文中一共展示了View.setAnimation方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setAdapterInsertAnimation

import android.view.View; //導入方法依賴的package包/類
public static void setAdapterInsertAnimation(final View aCard, int row, int height) {
	final int ANIMATION_DURATION = 650;
	final int BASE_DELAY = 50;

	TranslateAnimation translationAnimation = new TranslateAnimation(0,0, height,0);

	AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);

	final AnimationSet animationSet = new AnimationSet(true);
	animationSet.addAnimation(translationAnimation);
	animationSet.addAnimation(alphaAnimation);
	animationSet.setInterpolator(new AccelerateDecelerateInterpolator());
	animationSet.setFillAfter(true);
	animationSet.setFillBefore(true);
	animationSet.setDuration(ANIMATION_DURATION + row * BASE_DELAY);

	aCard.setAnimation(animationSet);
}
 
開發者ID:SebastianRask,項目名稱:Pocket-Plays-for-Twitch,代碼行數:19,代碼來源:AnimationService.java

示例2: wrap

import android.view.View; //導入方法依賴的package包/類
public static View10 wrap(View view) {
    View10 proxy = PROXIES.get(view);
    Animation animation = view.getAnimation();
    if (proxy == null || proxy != animation && animation != null) {
        proxy = new View10(view);
        PROXIES.put(view, proxy);
    } else if (animation == null) {
        view.setAnimation(proxy);
    }
    return proxy;
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:12,代碼來源:View10.java

示例3: animateSides

import android.view.View; //導入方法依賴的package包/類
/**
 * Animating the sides of the row, For example animating the user profile image and the message date.
 * */
private void animateSides(View view, boolean fromLeft, Animation.AnimationListener animationListener){
    if (!isScrolling)
        return;

    if (fromLeft)
        view.setAnimation(AnimationUtils.loadAnimation(mActivity, R.anim.expand_slide_form_left));
    else view.setAnimation(AnimationUtils.loadAnimation(mActivity, R.anim.expand_slide_form_right));

    view.getAnimation().setAnimationListener(animationListener);
    view.animate();
}
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:15,代碼來源:ChatSDKMessagesListAdapter.java

示例4: animateContent

import android.view.View; //導入方法依賴的package包/類
/**
 *  Animating the center part of the row, For example the image in an image message or the text in text message.
 * */
private void animateContent(View view, Animation.AnimationListener animationListener, boolean showFull){
    if (!isScrolling)
        return;

    view.setAnimation(AnimationUtils.loadAnimation(mActivity, showFull ? R.anim.fade_in_expand : R.anim.fade_in_half_and_expand));
    view.getAnimation().setAnimationListener(animationListener);
    view.animate();
}
 
開發者ID:MobileDev418,項目名稱:chat-sdk-android-push-firebase,代碼行數:12,代碼來源:ChatSDKMessagesListAdapter.java

示例5: startAnim

import android.view.View; //導入方法依賴的package包/類
private void startAnim(View widget) {
    int distance = widget.getHeight();
    widget.setVisibility(0);
    this.mFloatLayout.setVisibility(0);
    AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
    alphaAnimation.setDuration(200);
    alphaAnimation.setStartOffset(200);
    this.mFloatLayout.setAnimation(alphaAnimation);
    this.mAnimation = new TranslateAnimation(0.0f, 0.0f, (float) distance, 0.0f);
    this.mAnimation.setDuration(200);
    this.mAnimation.setStartOffset(200);
    widget.setAnimation(this.mAnimation);
    this.mAnimation.start();
    alphaAnimation.start();
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:16,代碼來源:FeedBackAnimFragment.java

示例6: rotate

import android.view.View; //導入方法依賴的package包/類
public static void rotate(View v){
    //創建旋轉動畫 對象   fromDegrees:旋轉開始的角度  toDegrees:結束的角度
    RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    //設置動畫的顯示時間
    rotateAnimation.setDuration(1000);
    //設置動畫重複播放幾次
    rotateAnimation.setRepeatCount(RotateAnimation.INFINITE);
    //設置動畫插值器
    rotateAnimation.setInterpolator(new LinearInterpolator());
    //設置動畫重複播放的方式,翻轉播放
    rotateAnimation.setRepeatMode(Animation.RESTART);
    //拿著imageview對象來運行動畫效果
    v.setAnimation(rotateAnimation);
}
 
開發者ID:fengdongfei,項目名稱:CXJPadProject,代碼行數:15,代碼來源:AnimationUtil.java

示例7: AnimatorProxy

import android.view.View; //導入方法依賴的package包/類
private AnimatorProxy(View view) {
    setDuration(0);
    setFillAfter(true);
    view.setAnimation(this);
    this.mView = new WeakReference(view);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:7,代碼來源:AnimatorProxy.java

示例8: View10

import android.view.View; //導入方法依賴的package包/類
private View10(View view) {
    setDuration(0);
    setFillAfter(true);
    view.setAnimation(this);
    mView = new WeakReference<>(view);
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:7,代碼來源:View10.java

示例9: AnimatorProxy

import android.view.View; //導入方法依賴的package包/類
private AnimatorProxy(View view) {
    setDuration(0); //perform transformation immediately
    setFillAfter(true); //persist transformation beyond duration
    view.setAnimation(this);
    mView = new WeakReference<View>(view);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:7,代碼來源:AnimatorProxy.java

示例10: bindItemAnimation

import android.view.View; //導入方法依賴的package包/類
private Animation bindItemAnimation(final View child, final boolean isClicked, final long duration) {
    Animation animation = createItemDisapperAnimation(duration, isClicked);
    child.setAnimation(animation);

    return animation;
}
 
開發者ID:leobert-lan,項目名稱:UiLib,代碼行數:7,代碼來源:ArcMenu.java

示例11: setFadeInAnimation

import android.view.View; //導入方法依賴的package包/類
public void setFadeInAnimation(View view){
    Animation animation = new AlphaAnimation(0, 1);
    animation.setDuration(500);
    view.setAnimation(animation);
}
 
開發者ID:pooi,項目名稱:Nearby,代碼行數:6,代碼來源:BaseFragment.java

示例12: setFadeOutAnimation

import android.view.View; //導入方法依賴的package包/類
public void setFadeOutAnimation(View view){
    Animation animation = new AlphaAnimation(1, 0);
    animation.setDuration(500);
    view.setAnimation(animation);
}
 
開發者ID:pooi,項目名稱:Nearby,代碼行數:6,代碼來源:BaseActivity.java

示例13: bindItemAnimation

import android.view.View; //導入方法依賴的package包/類
private Animation bindItemAnimation(final View child, final boolean isClicked, final long duration) {
	Animation animation = createItemDisapperAnimation(duration, isClicked);
	child.setAnimation(animation);

	return animation;
}
 
開發者ID:cheenid,項目名稱:FLFloatingButton,代碼行數:7,代碼來源:RayMenu.java


注:本文中的android.view.View.setAnimation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。