最佳答案
根据 https://developer.android.com/training/material/animations.html
ViewAnimationUtils.createCircularReveal()
方法使您能够 动画剪辑圆以显示或隐藏视图。用这种效果显示以前看不见的景象:
// previously invisible view View myView = findViewById(R.id.my_view); // 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()); // create the animator for this view (the start radius is zero) Animator anim = ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius); // make the view visible and start the animation myView.setVisibility(View.VISIBLE); anim.start();
这是为了展示一种风景。我如何使用它来循环显示整个活动,而不使用任何共享元素?
具体来说,我希望我的 searchActivity 从工具栏中的搜索操作按钮循环显示。