Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter-like splash screen animation in Android

How to achieve effect like Twitter splash screen animation (from iOS Twitter version) in Android application? There is library https://github.com/callumboddy/CBZSplashView but it is for iOS only.

like image 913
user3626048 Avatar asked Mar 17 '23 06:03

user3626048


1 Answers

THis link may be usefull for you just download the code and as per the link suggests You can create in code:

// 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);

or in 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" />

then to run the animation, simply call:

--> run the animation and listen to the animation events (listener can be left as null)

splashView.splashAndDisappear(new ISplashListener(){
    @Override
    public void onStart(){

}

@Override
public void onUpdate(float completionFraction){

}

@Override
public void onEnd(){

}

});`

-Hope you find your answer.

like image 109
Hardy Avatar answered Mar 27 '23 23:03

Hardy