Android中类似Twitter的闪屏动画

Android中类似Twitter的闪屏动画,android,twitter,android-animation,Android,Twitter,Android Animation,如何在Android应用程序中实现类似Twitter闪屏动画(来自iOS Twitter版本)的效果? 有库,但它仅适用于iOS。可能对您有用,只需下载代码并按照链接建议 您可以在代码中创建: // create and customize the view SplashView splashView = new SplashView(context); // the animation will last 0.5 seconds splashView.setDuration(500); //

如何在Android应用程序中实现类似Twitter闪屏动画(来自iOS Twitter版本)的效果? 有库,但它仅适用于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" />
}))`


-希望您能找到答案。

对于API 21+设备,您可以使用-Check createCircularReveal方法获得类似的结果。谢谢您,但如何使用API 15实现这一点?我发现了,但是如何将它与闪屏连接起来呢?我不知道。但是看看自述文件,您似乎可以调用
SupportAnimator animator=ViewAnimationUtils.createCircularReveal(myView,cx,cy,0,finalRadius)
,在这里您可以为它提供坐标和视图!如何向应用程序添加依赖项?@RahulKushwaha无需添加任何依赖项,只需从
GitHub
复制粘贴
SplashView
类并添加相关的attributes@Dinesh谢谢你,兄弟,我明白了。
splashView.splashAndDisappear(new ISplashListener(){
    @Override
    public void onStart(){

}

@Override
public void onUpdate(float completionFraction){

}

@Override
public void onEnd(){

}