Android實現(xiàn)Flip翻轉動畫效果
更新時間:2014年08月20日 15:29:52 投稿:shichen2014
這篇文章主要介紹了Android實現(xiàn)Flip翻轉動畫效果,對Android程序設計人員有很好的參考借鑒價值,需要的朋友可以參考下
本文實例講述了Android實現(xiàn)Flip翻轉動畫效果的方法,分享給大家供大家學習借鑒。
具體實現(xiàn)代碼如下:
LinearLayout locationLL = (LinearLayout) findViewById(R.id.locationLL); LinearLayout baseLL = (LinearLayout) findViewById(R.id.baseLL); private void flipit() { Interpolator accelerator = new AccelerateInterpolator(); Interpolator decelerator = new DecelerateInterpolator(); final LinearLayout visibleList,invisibleList; final ObjectAnimator visToInvis, invisToVis; if (locationLL.getVisibility() == View.GONE) { visibleList = baseLL; invisibleList = locationLL; visToInvis = ObjectAnimator.ofFloat(visibleList, "rotationY", 0f, 90f); invisToVis = ObjectAnimator.ofFloat(invisibleList, "rotationY", -90f, 0f); } else { invisibleList = baseLL; visibleList = locationLL; visToInvis = ObjectAnimator.ofFloat(visibleList, "rotationY", 0f, -90f); invisToVis = ObjectAnimator.ofFloat(invisibleList, "rotationY", 90f, 0f); } visToInvis.setDuration(300); invisToVis.setDuration(300); visToInvis.setInterpolator(accelerator); invisToVis.setInterpolator(decelerator); visToInvis.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator anim) { visibleList.setVisibility(View.GONE); invisToVis.start(); invisibleList.setVisibility(View.VISIBLE); } }); visToInvis.start(); }
希望本文所述實例對大家Android程序設計能有一定的幫助。
相關文章
詳解 Kotlin Reference Basic Types, String, Array and Imports
這篇文章主要介紹了詳解 Kotlin Reference Basic Types, String, Array and Imports的相關資料,需要的朋友可以參考下2017-06-06Android使用SQLite數(shù)據(jù)庫的示例
本篇文章主要介紹了Android使用SQLite數(shù)據(jù)庫的示例,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-01-01Android自定義可循環(huán)的滾動選擇器CycleWheelView
Android自定義可循環(huán)的滾動選擇器CycleWheelView替代TimePicker/NumberPicker/WheelView,很實用的一篇文章分享給大家,感興趣的小伙伴們可以參考一下2016-07-07Android數(shù)據(jù)加密之SHA安全散列算法
這篇文章主要為大家詳細介紹了Android數(shù)據(jù)加密之SHA安全散列算法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-09-09Android仿Iphone屏幕底部彈出半透明PopupWindow效果
這篇文章主要為大家詳細介紹了Android仿Iphone屏幕底部彈出半透明PopupWindow效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-07-07Android編程之Activity中onDestroy()調(diào)用分析
這篇文章主要介紹了Android編程之Activity中onDestroy()調(diào)用方法,針對onDestroy引起的內(nèi)存泄露及解決方法進行了分析,并給出了解決方案,需要的朋友可以參考下2015-12-12