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

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