安卓过渡动画-幕布效果

布局:外层FrameLayout,TextView为最终要显示的布局,LinearLayout为幕布

        android:layout_width="match_parent"

        android:layout_height="match_parent">

    

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:text="ASDFASFSFASFSDFSDFSADFSDFSDSDFAAAAAAA" />

            android:id="@+id/iv_avau_img"

            android:background="@color/black_20"

            android:layout_width="match_parent"

            android:layout_height="match_parent"

            tools:ignore="Orientation" />

Activity代码:

private int mSceenHeight;

private int mSceenWidth;

LinearLayout ivAvauImg;

public void onCreate(){

    ivAvauImg = findViewById(R.id.iv_avau_img);  

    mSceenHeight = getResources().getDisplayMetrics().heightPixels;

    mSceenWidth = getResources().getDisplayMetrics().widthPixels;

    ivAvauImg.setVisibility(View.VISIBLE);

    final Animator animator3 = ViewAnimationUtils.createCircularReveal(ivAvauImg, mSceenWidth / 2, mSceenHeight , mSceenHeight,     200); 

    animator3.setDuration(300);

    animator3.start();

    animator3.addListener(new Animator.AnimatorListener() {

        public void onAnimationEnd(Animator animation) {

            ivAvauImg.setVisibility(View.GONE);

        }

    }

}










你可能感兴趣的:(安卓过渡动画-幕布效果)