android自訂動畫

來源:互聯網
上載者:User

前一篇說了實現過程,這次來寫一個自己簡單實現的3d動畫

,方便使用xml 檔案來定製動畫

                                                                      

配置參數相關的一些解釋

  dimension 像素實值型別,包括有"px", "dip", "sp", "pt", "in", "mm", 一般用TypedValue.complexToDimension解析
  fraction 分數,一般用來表示占的百分比,"%", "%p"。 一般用TypedValue.complexToFraction解析 有時候和float類型功能通用
  float 浮點數。當確定是這個類型的時候,用TypedValue.getFloat解析
  integer 整數,TypedValue.data 就是這個值。
  

動畫配置


 

      

 

CubeAnimation mFromXType = mFromX = 0 mFromXdata = 0 mToXType = mToX = 0 mToXData = 0 mAxisY = 0 mAxisYType = CubeAnimation( fromX, toX, fromDegree, toDegree,.mFromX =.mToX =.mFromDegrees =.mToDegrees =.mAxisY =======(value.type==.mFromX =.mFromXType =.mFromXType =.mFromXdata ==(value.type==TypedValue.TYPE_FLOAT){ .mToX =.mToXType =.mToXType =.mToXData = t = a.getBoolean(R.styleable.CubeAnimation_positive, (!.mToDegrees = 0.0F.mFromDegrees = 90.0F.mFromDegrees = a.getFloat(R.styleable.CubeAnimation_fromDegree, 0.mToDegrees = a.getFloat(R.styleable.CubeAnimation_toDegree, 90=.mAxisYType = (.mAxisYType==.mAxisY =.mAxisYType =.mAxisY = initialize( width, height, (.mFromXType!=TypedValue.TYPE_FLOAT){ .mFromX = resolveData(.mFromXType,(mToXType!=.mToX = resolveData(.mToXType,.mCamera = (mAxisYType==RELATIVE_TO_SELF) { mAxisY = mAxisY*"mFromX="+mFromX+",mToX=="+ resolveData( type, data, size, value = 0 (type === (type ==={ value= applyTransformation( fromDegrees = degrees = fromDegrees + (.mToDegrees -*= =+(mToX-mFromX)*interpolatedTime, Animation loadAnimation(Context context, = = createAnimationFromXml(context, parser, = "Can't load animation resource ID #0x" += "Can't load animation resource ID #0x" + (parser != = depth = (((type = parser.next()) != XmlPullParser.END_TAG ||> depth) && type != (type !== (name.equals("set"= (name.equals("alpha"= (name.equals("scale"= (name.equals("rotate"= (name.equals("translate"= (name.equals("cube"= "not a cubeanimation animation name: " + (parent != View Code

 

設定檔載入和動態構造兩種方式建立對話執行個體以及調用

AnimateActivity = (v.getTag()==||"設定檔載入"="動態初始化"= CubeAnimation(0, 400, 0, 360, 1008000View Code

 

 

ok 基本完成,希望沒有什麼遺漏

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.