Android 仿 PPT 進入動畫效果合集

EnterAnimation

android 仿ppt進入動畫效果合集, 百葉窗效果,擦除效果,盒狀效果,階梯效果,菱形效果,輪子效果,劈裂效果,棋盤效果, 切入效果,扇形展開效果,十字擴展效果,隨機線條效果,向內溶解效果,圓形擴展效果, 適用於各種view和viewgroup,activity即用於頁面根部viewgroup, 自定義viewgroup自動換行layout, 看效果圖

Series of entrance animation effects just like ppt in Android. There are effects of Blinds,Wipe,Box,Strips,Diamond,Wheel,Split,Checkerboard,Peek In,Wedge,Plus,Random Bars,Dissolve In,Circle. The Animation effects can apply to any View or ViewGroup. There is also a custom ViewGroup of auto linefeed called SimpleLineWrapLayout to layout the buttons. look the images:


1.gif 2.gif 3.gif4.gif 5.gif 6.gif7.gif 8.gif 9.gif10.gif 11.gif 12.gif13.gif 14.gif

Attributes

There are several attributes you can set:


attr 屬性description 描述
isVisibleAtFirst進入頁面時視圖內容是否可見,默認可見

How to use

layout:

在需要顯示動畫效果的 view 或 viewgroup 的外層包一個 EnterAnimLayout,然後在 java 中設置具體動畫和控制開始播放動畫;需要播放整個 activity 的話同理在最外層加一個 EnterAnimLayout,然後在 java 中設置具體動畫和控制開始播放動畫


        <com.wangpm.enteranimation.EnterAnimLayout           
            android:id="@+id/anim_layout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:background="@android:color/holo_blue_bright"
            android:padding="20dp"
            >
            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:background="@android:color/holo_orange_light">
                <TextView
                    android:id="@+id/text_view"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="EnterAnimTextView"
                    android:textSize="30sp"
                    />
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal">
                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@mipmap/ic_launcher"
                        />
                    <Button
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="這就是一個按鈕"/>
                </LinearLayout>

            </LinearLayout>
        </com.wangpm.enteranimation.EnterAnimLayout>

java:

        enterAnimLayout = (EnterAnimLayout)  findViewById(R.id.anim_layout);	  
          //oncreate中還並未獲得view的具體尺寸,所以打開頁面時延遲播放動畫
        new Handler().postDelayed(new Runnable() {   
                 @Override
            public void run() {			   
             //舉例設置成百葉窗動畫
                Anim anim = new AnimBaiYeChuang(enterAnimLayout);
                anim.startAnimation(2500);//開始播放動畫,動畫播放時長2500ms,默認2000
            }
        }, 1000);


項目地址:
https://github.com/wangpeiming110/EnterAnimation
如果覺得對你有用,請在github上star一個,O(∩_∩)O謝謝


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章