EDIT:
Ho testato questo facendo una piccola applicazione
Prima di tutto nascondere la vista che si desidera rivelare in questa animazione.
La vista può essere dello stesso layout e in XML sua visibilità dovrebbe essere invisibile modo che l'animazione rivelare esso.
È possibile impostare l'altezza e la larghezza di vista partita genitore se si desidera creare un schermo intero animazione ...
prendere la vostra vista originale e rivelare sia in cornice layout di
Nel mio caso, ho usato questo:
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:text="Hello World!"
android:layout_width="wrap_content"
android:textSize="20sp"
android:layout_height="wrap_content" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimaryDark"
android:id="@+id/revealiew"
android:visibility="invisible"
>
</FrameLayout>
poi nella vostra attività sul button click
o qualche evento fare questo:
fab.setOnClickListener(new View.OnClickListener() {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onClick(View view) {
// previously invisible view
View myView = findViewById(R.id.revealview);
// get the center for the clipping circle
int cx = myView.getWidth()/2;
int cy = myView.getHeight()/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);
//Interpolator for giving effect to animation
anim.setInterpolator(new AccelerateDecelerateInterpolator());
// Duration of the animation
anim.setDuration(1000);
// make the view visible and start the animation
myView.setVisibility(View.VISIBLE);
anim.start();
}
});
}
Si può prendere sguardo dettagliato alla documentazione ufficiale qui: http://developer.android.com/training/material/animations.html
fonte
2015-11-03 13:37:04
Impostazione taglia in 3 ore. – SysVoid
Puoi per favore mostrare cosa hai provato? – KishuDroid
Niente. Non so da dove iniziare. Sono alle prime armi su Android-y. – SysVoid