



免費(fèi)預(yù)覽已結(jié)束,剩余1頁(yè)可下載查看
下載本文檔
版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
MARS-Android 視頻教程實(shí)例源代碼第二季第八集AVD版本Build SDK和Mini SDKAnimations01package mars.admations01;/當(dāng)時(shí)建包時(shí)輸錯(cuò)了字母import android.os.Bundle;import android.app.Activity;import android.view.Menu;import android.view.View;import android.view.View.OnClickListener;import android.view.animation.AlphaAnimation;import android.view.animation.Animation;import android.view.animation.AnimationSet;import android.view.animation.RotateAnimation;import android.view.animation.ScaleAnimation;import android.view.animation.TranslateAnimation;import android.widget.Button;import android.widget.ImageButton;public class MainActivity extends Activity private Button scaleButton=null;private Button rotateButton=null;private Button alphaButton=null;private Button translateButton=null;private ImageButton imageButton=null; Override public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); scaleButton=(Button)findViewById(R.id.scaleButtonId); scaleButton.setOnClickListener(new scaleButtonOnClickListener(); rotateButton=(Button)findViewById(R.id.rotateButtonId); rotateButton.setOnClickListener(new rotateButtonOnClickListener(); alphaButton=(Button)findViewById(R.id.alphaButtonId); alphaButton.setOnClickListener(new alphaButtonOnClickListener(); translateButton=(Button)findViewById(R.id.translateButtonId); translateButton.setOnClickListener(new translateButtonOnClickListener(); imageButton=(ImageButton)findViewById(R.id.imageViewId); class scaleButtonOnClickListener implements OnClickListenerOverridepublic void onClick(View arg0) / TODO Auto-generated method stubSystem.out.println(scaleButtonOnClick);AnimationSet animationSet=new AnimationSet(true);ScaleAnimation scaleAnimation=new ScaleAnimation(1,0.1f,1,0.1f,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);animationSet.addAnimation(scaleAnimation);animationSet.setDuration(2000);/animationSet.setFillBefore(false);animationSet.setFillAfter(true);imageButton.setAnimation(animationSet); class rotateButtonOnClickListener implements OnClickListener Override public void onClick(View arg0) / TODO Auto-generated method stub System.out.println(rotateButtonOnClick); AnimationSet animationSet=new AnimationSet(true); RotateAnimation rotateAnimation=new RotateAnimation(0,360,Animation.RELATIVE_TO_PARENT,1f,Animation.RELATIVE_TO_PARENT,0F); rotateAnimation.setDuration(5000); animationSet.addAnimation(rotateAnimation); imageButton.setAnimation(animationSet); class alphaButtonOnClickListener implements OnClickListener Override public void onClick(View arg0) / TODO Auto-generated method stub System.out.println(alphaButtonOnClick); AnimationSet animationSet=new AnimationSet(true); AlphaAnimation alphaAnimation=new AlphaAnimation(1,0); alphaAnimation.setDuration(1000); animationSet.addAnimation(alphaAnimation); imageButton.setAnimation(animationSet); class translateButtonOnClickListener implements OnClickListener Override public void onClick(View arg0) / TODO Auto-generated method stub System.out.println(translateButtonOnClick); AnimationSet animationSet=new AnimationSet(true); TranslateAnimation translateAnimation=new TranslateAnimation(Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,1f); translateAnimation.setDuration(1000); animationSet.addAnimation(translateAnimation); imageB
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年林草種植代理加盟協(xié)議
- 文化創(chuàng)意產(chǎn)業(yè)發(fā)展趨勢(shì)與前瞻
- 理賠業(yè)務(wù)合作伙伴風(fēng)險(xiǎn)基礎(chǔ)知識(shí)點(diǎn)歸納
- 基于數(shù)據(jù)分析的思政課程評(píng)價(jià)模型
- 軟組織生物力學(xué)數(shù)據(jù)管理系統(tǒng)基礎(chǔ)知識(shí)點(diǎn)歸納
- 連續(xù)式微波殺菌和萃取設(shè)備項(xiàng)目投資風(fēng)險(xiǎn)評(píng)估報(bào)告
- 教聯(lián)體合作中的質(zhì)量管理與保障機(jī)制
- 健美操訓(xùn)練方法的現(xiàn)代化與多元化探索
- 抽水蓄能產(chǎn)業(yè)高質(zhì)量發(fā)展的面臨的問(wèn)題、機(jī)遇與挑戰(zhàn)
- 應(yīng)用型卓越醫(yī)學(xué)人才培養(yǎng)的背景意義及必要性
- 高考放假安全班會(huì)
- 預(yù)防性侵家長(zhǎng)會(huì)
- 體彩筆試試題及答案
- 教學(xué)設(shè)計(jì):2.1 聲音的產(chǎn)生與傳播
- 龍舟競(jìng)渡 y-2024-2025學(xué)年人美版(2024)初中美術(shù)七年級(jí)下冊(cè)
- ISO 37001-2025 反賄賂管理體系要求及使用指南(中文版-雷澤佳譯-2025)
- 水利工程監(jiān)理規(guī)劃(標(biāo)準(zhǔn)范本)
- DB4403-T 81-2020 綠化遷移技術(shù)規(guī)范
- 《剪映+即夢(mèng)Dreamina:AI文案、圖片與視頻生成技巧大全》 課件 第1-7章 通過(guò)剪映生成AI文案-使用智能畫(huà)布二次創(chuàng)作
- 2025年江蘇鹽城燕舞集團(tuán)有限公司招聘筆試參考題庫(kù)含答案解析
- 員工質(zhì)量意識(shí)培訓(xùn)
評(píng)論
0/150
提交評(píng)論