Start Activity with an animation

I am using this in a current project of mine, it is basically pretty simple. You define a new animation style in your styles.xml, like this: <!– just defines top layer “Animation” –> <style name=”Animation” /> <!– the animations must have been defined in your “anim” folder, of course –> <style name=”Animation.MyAwesomeAnimation” parent=”android:style/Animation.Activity”> <item name=”android:activityOpenEnterAnimation”>@anim/myawesomeanimation_enter</item> … Read more

CSS3 transition on click using pure CSS

If you want a css only solution you can use active .crossRotate:active { transform: rotate(45deg); -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); } But the transformation will not persist when the activity moves. For that you need javascript (jquery click and css is the cleanest IMO). $( “.crossRotate” ).click(function() { if ( $( this ).css( “transform” ) == … Read more

CSS Auto hide elements after 5 seconds

YES! But you can’t do it in the way you may immediately think, because you cant animate or create a transition around the properties you’d otherwise rely on (e.g. display, or changing dimensions and setting to overflow:hidden) in order to correctly hide the element and prevent it from taking up visible space. Therefore, create an … Read more

Invoke a callback at the end of a transition

You want to listen for the “end” event of the transition. // d3 v5 d3.select(“#myid”).transition().style(“opacity”,”0″).on(“end”, myCallback); // old way d3.select(“#myid”).transition().style(“opacity”,”0″).each(“end”, myCallback); This demo uses the “end” event to chain many transitions in order. The donut example that ships with D3 also uses this to chain together multiple transitions. Here’s my own demo that changes the … Read more

Implement page curl on android?

I’m doing some experimenting on page curl effect on Android using OpenGL ES at the moment. It’s quite a sketch actually but maybe gives some idea how to implement page curl for your needs. If you’re interested in 3D page flip implementation that is. As for the formula you’re referring to – I tried it … Read more

Activity transition in Android

Here’s the code to do a nice smooth fade between two Activities.. Create a file called fadein.xml in res/anim <?xml version=”1.0″ encoding=”utf-8″?> <alpha xmlns:android=”http://schemas.android.com/apk/res/android” android:interpolator=”@android:anim/accelerate_interpolator” android:fromAlpha=”0.0″ android:toAlpha=”1.0″ android:duration=”2000″ /> Create a file called fadeout.xml in res/anim <?xml version=”1.0″ encoding=”utf-8″?> <alpha xmlns:android=”http://schemas.android.com/apk/res/android” android:interpolator=”@android:anim/accelerate_interpolator” android:fromAlpha=”1.0″ android:toAlpha=”0.0″ android:duration=”2000″ /> If you want to fade from Activity A to … Read more