如何在Android应用程序中实现类似Twitter启动画面动画的效果(来自iOS Twitter版本)?已经有一个库https://github.com/callumboddy/CBZSplashView,但它仅适用于iOS。
这个链接可能对您有用,只需下载代码并按照链接提示的步骤,您可以在代码中创建:
// create and customize the view
SplashView splashView = new SplashView(context);
// the animation will last 0.5 seconds
splashView.setDuration(500);
// transparent hole will look white before the animation
splashView.setHoleFillColor(Color.WHITE);
// this is the Twitter blue color
splashView.setIconColor(Color.rgb(23, 169, 229));
// a Twitter icon with transparent hole in it
splashView.setIconResource(R.drawable.ic_twitter);
// remove the SplashView from MainView once animation is completed
splashView.setRemoveFromParentOnEnd(true);
或者在XML中:
<com.yildizkabaran.twittersplash.view.SplashView
xmlns:app="http://schemas.android.com/apk/res/com.yildizkabaran.twittersplash"
android:id="@+id/splash_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:icon="@drawable/ic_twitter"
app:iconColor="@color/twitter_blue"
app:duration="500"
app:holeFillColor="@color/white"
app:removeFromParentOnEnd="true" />
要运行动画,只需调用:
--> 运行动画并监听动画事件(监听器可以保留为空)
splashView.splashAndDisappear(new ISplashListener(){
@Override
public void onStart(){
}
@Override
public void onUpdate(float completionFraction){
}
@Override
public void onEnd(){
}
});`
-希望你能找到答案。
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius)
,其中你需要提供坐标和一个视图! - Joaquin Iurchuk