<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 189,comments - 115,trackbacks - 0

    android animation 總結

    變化率是個常數,即 f (x) = x.

    方法:public float getInterpolation(float input)

    AccelerateInterpolator--開始變化很慢,然后逐漸變快,即 f(x) = x*x 或者 f(x) = pow(x, 2*mFactor).

    方法:public float getInterpolation(float input)

    AccelerateDecelerateInterpolator--變化率開始和結束都很慢,但中間很快,即 f(x) = (cos ((x+1)*PI) / 2.0f) + 0.5f.

    方法:public float getInterpolation(float input)

    LinearInerpolator、AccelerateInterpolator, DecelerateInterpolator, AccelerateDecelerateInterpolator,CycleInterpolator 是 Interpolator 的子類,分別實現了勻速、加速、減速、變速、循環等效果。

    AlphaAnimation

    控制透明度

    構造函數:

    @param開始的透明度

    @param結束的透明度

    AlphaAnimation(float fromAlpha, float toAlpha)

    方法:

    willChangeBounds()                                     具體不詳,不過其返回值是固定的都是false

    willChangeTransformationMatrix()         false

    ScaleAnimation

    控制尺寸

    構造函數:

    @param開始時x方向的伸縮比列

    @param結束時x方向的伸縮比列

    @param開始時y方向的伸縮比列

    @param結束時y方向的伸縮比列

    ScaleAnimation(float fromX, float toX, float fromY, float toY)

    @param動畫在x軸的伸縮位置0%-100%中取值,50%為物件的X或Y方向坐標上的中點位置

    @param動畫在y軸的伸縮位置

    ScaleAnimation(float fromX, float toX, float fromY, float toY, float pivotX, float pivotY)

    @param  pivotXType動畫在X軸相對于物件位置類型--固定的一些數據

    @param  pivotYType動畫在X軸相對于物件位置類型

    pivotXValue,pivotYValue同上面的pivotX,pivotY

    ScaleAnimation(float fromX, float toX, float fromY, float toY,int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)

    方法:

         initialize(int width, int height, int parentWidth, int parentHeight)設置動畫的大小根據父類的維數(猜測)

    TranslateAnimation

    移動

    構造函數:

    @param開始時x的位置

    @param結束時x的位置

    @param開始時y的位置

    @param結束時y的位置

    TranslateAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta)

    @param參考上面ScaleAnimation的

    TranslateAnimation(int fromXType, float fromXValue, int toXType, float toXValue,int fromYType, float fromYValue, int toYType, float toYValue)

    方法:

    @param同ScaleAnimation的

    initialize(int width, int height, int parentWidth, int parentHeight)

    RotateAnimation

    旋轉

    構造函數:

    @param開始的角度

    @param結束的角度

    RotateAnimation(float fromDegrees, float toDegrees)

    @param動畫在x軸的旋轉位置

    @param動畫在x軸的旋轉位置

    RotateAnimation(float fromDegrees, float toDegrees, float pivotX, float pivotY)

    方法:

    @param同ScaleAnimation的

             initialize(int width, int height, int parentWidth, int parentHeight)

    Animation

    抽象類,所有控制動畫的都繼承與該類

    Aniamtion 是基類,他記錄了動畫的通用屬性和方法。主要的屬性包括動畫持續時間、重復次數、interpolator等。

    方法:---只列舉了幾個方法,用法很簡單,可以去看sdk

    getTransformation (currentTime, outTransformation)

    該方法根據當前時間 (currentTime) 和 interpolator,計算當前的變換,在 outTransformation 中返回。

    setRepeatMode(int)—在測試AnimationSet是該函數沒有成功,可能有什么地方設置錯了,以后再跟進

    @param Animation.RESTART回到動作開始時的坐標,Animation.REVERSE反轉的意思,a->b,在從b->a,Animation.INFINITE不斷重復該動作

    設置動作結束后,將怎樣處理,只有在repeatCount大于0或為INFINITE的時候setRepeatMode才會生效

    TranslateAnimation、RotateAnimation、AlphaAnimation、ScaleAnimation等是Animation的子類,分別實現了平移、旋轉、改變透明度、縮放等動畫。

    AnimationSet

    設置一個動畫組,就是將一系列動作合在一起形成新的動畫

    可以包含多個Animation,但都是在同一個時間執行的,是并行,不是串行執行的。如果AnimationSet中有一些設定,如duration,fillBefore等,它包含的子動作也設定了的話,子動作中的設定將會給覆蓋掉。

    構造函數:

         @param是否公用動畫插入器,為true表示共用AnimationSet的插入器

    AnimationSet(boolean shareInterpolator)

    方法:==

         @param為true時將在播放完后被應用,播完后停在最后一幅畫上,這里重寫了Animation的該方法,其他的基本上都是直接使用父類的

         setFillAfter(boolean fillAfter)

    @param為true時將在開始前被應用,播完后停在第一幅畫上,好像不設置該屬性也會停留在最開始的那副上面

    setFillBefore(boolean fillBefore)

    @param在使用AnimationSet的重復mode時,還沒有看到有什么效果,但是它的解釋和Animation的該方法是一樣的

    setRepeatMode(int repeatMode)

    @param動畫停留時間間隔,從上次結束后停留多長時間進入下一次動畫

    setStartOffset(long startOffset)

    @param添加動畫

    addAnimation(Animation a)

    Example

    AnimationSet aa = new AnimationSet(true);

        Animation myAnimaton = new TranslateAnimation(0,100,0,100); 

        aa.addAnimation(myAnimaton);

        Animation myAnimaton1 = new RotateAnimation(0,360);

        aa.addAnimation(myAnimaton1);

        myImage.startAnimation(aa);

        aa.start();

        aa.setDuration(2000);

    aa.setFillAfter(true);

    AnimationUtils

    該類沒有父類,動畫的輔助類.構造函數也沒有,使用默認的

    方法:

    @param可以看到不需要實例化該對象就可以使用,通過資源xml獲得一個動畫

    static Animation loadAnimation(Context context, int id)

    TranslateAnimation manmation = (TranslateAnimation)AnimationUtils. loadAnimation(this,R.anim.animation);

    @param

    LayoutAnimationController loadLayoutAnimation(Context context, int id)

    LayoutAnimationController

    Layout animation controller is used to animated a layout's, or a view group's, children.

    該類和其衍生類GridLayoutAnimationController,GridLayoutAnimationController.AnimationParameters等還沒有看到相關資料,也沒有用過

    Animation.Description

    Utility class to parse a string description of a size. 

    GridLayoutAnimationController

    A layout animation controller is used to animated a grid layout's children.

    GridLayoutAnimationController.AnimationParameters

    The set of parameters that has to be attached to each view contained in the view group animated by the grid layout animation controller.

    LayoutAnimationController.AnimationParameters

    The set of parameters that has to be attached to each view contained in the view group animated by the layout animation controller.

    Transformation                                                                      

    Defines the transformation to be applied at one point in time of an Animation.

    在xml文件中設置動畫可以參考android_xml文件中介紹的,有實例解釋

     

    AlphaAnimation
     漸變透明度動畫效果
     
    ScaleAnimation
     漸變尺寸伸縮動畫效果
     
    TranslateAnimation
     畫面轉換位置移動動畫效果
     
    RotateAnimation
     畫面轉移旋轉動畫效果
     

    transition設置兩張圖片的過渡,好像只能設置兩張之間的過渡,多設置幾張也只顯示前面兩張


    本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/lishubing1126/archive/2009/12/02/4926770.aspx

    posted on 2010-08-26 20:14 MEYE 閱讀(1907) 評論(0)  編輯  收藏 所屬分類: Android3D
    主站蜘蛛池模板: 免费观看的毛片手机视频| 亚洲人成电影网站免费| www.亚洲精品| 99re热免费精品视频观看| 两个人看的www高清免费观看| 亚洲精品理论电影在线观看| 在线免费观看亚洲| 亚洲精品乱码久久久久久| 又粗又大又猛又爽免费视频 | 亚洲国产精品毛片av不卡在线| 免费精品国产自产拍在| 久久国产乱子精品免费女| 搜日本一区二区三区免费高清视频 | 亚洲伊人久久大香线蕉结合| 亚洲欧洲日韩不卡| 国产亚洲福利精品一区| 黑人大战亚洲人精品一区| 亚洲高清成人一区二区三区| 日韩在线视频免费看| 成人性生免费视频| 卡1卡2卡3卡4卡5免费视频| 亚洲精品免费网站| 久久久久免费看黄A片APP| 美女被cao免费看在线看网站| 亚洲免费中文字幕| 桃子视频在线观看高清免费完整| 一级毛片免费观看不卡视频| 老司机69精品成免费视频| a色毛片免费视频| 一区二区三区无码视频免费福利| a级毛片免费全部播放无码| 怡红院免费的全部视频| 国产成人AV免费观看| 免费精品99久久国产综合精品| 青青草原1769久久免费播放| 精品国产麻豆免费人成网站| 亚洲欧洲免费视频| 国产精品免费观看| 日本特黄特黄刺激大片免费| 四虎永久在线免费观看| 亚洲国产免费综合|