Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's a <a href="http://www.41post.com/3368/programming/android-changing-the-animation-between-activities" rel="noreferrer">tutorial</a> on how to add an animation when transistioning between two activities. However, instead of using a translate animation like in the article, you'll want to use a rotate animation. For more information on animations, checkout this <a href="http://developer.android.com/guide/topics/resources/animation-resource.html#View" rel="noreferrer">documentation</a>.</p> <p>Putting those two things together, here's what you need to do. First, where you make the call to start the new activity do this:</p> <pre><code>//Calls a new Activity startActivity(new Intent(this, NewActivity.class)); //Set the transition -&gt; method available from Android 2.0 and beyond overridePendingTransition(R.anim.rotate_out,R.anim.rotate_in); </code></pre> <p>Then create the following two animations in your xml:</p> <p>rotate_out.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="300" /&gt; &lt;rotate android:fromDegrees="0" android:toDegrees="90" android:pivotX="25%" /&gt; &lt;/set&gt; </code></pre> <p>rotate_in.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="300" /&gt; &lt;rotate android:fromDegrees="90" android:toDegrees="0" android:pivotX="-25%" /&gt; &lt;/set&gt; </code></pre> <p>You can play with the fromDegrees, toDegrees, and pivotX values to get exactly what you'd like.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload