小编Rah*_*ury的帖子

为前棒棒糖设备创建循环显示

首先,这与前Lollipop设备(Android)的创建循环显示不同

我正在使用那里提到的库来创建Circular Reveal,但它似乎对我不起作用.

XML

<io.codetail.widget.RevealFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <FrameLayout
            android:id="@+id/circBack"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#ff4081"
            android:visibility="invisible"
            ></FrameLayout>
</io.codetail.widget.RevealFrameLayout>
Run Code Online (Sandbox Code Playgroud)

JAVA

                View myView = findViewById(R.id.circBack);


                // get the center for the clipping circle
                int cx = (myView.getLeft() + myView.getRight()) / 2;
                int cy = (myView.getTop() + myView.getBottom()) / 2;

                // get the final radius for the clipping circle
                int finalRadius = Math.max(myView.getWidth(), myView.getHeight());


                SupportAnimator animator = ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);
                animator.setInterpolator(new AccelerateDecelerateInterpolator());
                animator.setDuration(1000);
                myView.setVisibility(View.VISIBLE);
                animator.start();
Run Code Online (Sandbox Code Playgroud)

圆形揭示没有显示出来.我的意思是代码执行时没有任何反应.

Logcat显示了这一点

07-01 19:15:47.498  27556-27556/com.ledo.ledoapp I/art? …
Run Code Online (Sandbox Code Playgroud)

animation android material-design animator

5
推荐指数
1
解决办法
2861
查看次数

标签 统计

android ×1

animation ×1

animator ×1

material-design ×1