-
-
Save lalitsonawane/f753529c0fce9d72cabe1f1d4c9e4516 to your computer and use it in GitHub Desktop.
This gist shows a splash screen animation in Android like in Tinder mobile app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android" | |
android:ordering="sequentially"> | |
<set | |
android:duration="@android:integer/config_mediumAnimTime" | |
android:ordering="together"> | |
<objectAnimator | |
android:propertyName="scaleX" | |
android:valueFrom="1.0" | |
android:valueTo="1.4" | |
android:valueType="floatType"/> | |
<objectAnimator | |
android:propertyName="scaleY" | |
android:valueFrom="1.0" | |
android:valueTo="1.4" | |
android:valueType="floatType"/> | |
</set> | |
<set | |
android:duration="@android:integer/config_mediumAnimTime" | |
android:ordering="together"> | |
<objectAnimator | |
android:propertyName="scaleX" | |
android:valueFrom="1.4" | |
android:valueTo="0" | |
android:valueType="floatType"/> | |
<objectAnimator | |
android:propertyName="scaleY" | |
android:valueFrom="1.4" | |
android:valueTo="0" | |
android:valueType="floatType"/> | |
</set> | |
</set> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@color/md_white" | |
android:gravity="center" | |
android:orientation="vertical"> | |
<ImageView | |
android:id="@+id/iv_logo" | |
android:layout_width="200dp" | |
android:layout_height="200dp" | |
android:layout_margin="16dp" | |
android:src="@drawable/gdg_sba_logo"/> | |
</LinearLayout> | |
</layout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.gdgsba.gdgdevfest.view.activity; | |
import android.animation.AnimatorInflater; | |
import android.animation.AnimatorSet; | |
import android.databinding.DataBindingUtil; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import org.gdgsba.gdgdevfest.R; | |
import org.gdgsba.gdgdevfest.databinding.SplashScreenActivityBinding; | |
public class SplashScreenActivity extends AppCompatActivity { | |
private SplashScreenActivityBinding mSplashScreenActivityBinding; | |
@Override | |
protected void onCreate(final Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
mSplashScreenActivityBinding = DataBindingUtil.setContentView(this, R.layout.splash_screen_activity); | |
AnimatorSet set = (AnimatorSet) AnimatorInflater | |
.loadAnimator(SplashScreenActivity.this, R.animator.logo_animator); | |
set.setTarget(mSplashScreenActivityBinding.ivLogo); | |
set.start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment