Created
July 25, 2016 10:02
-
-
Save vmax/41a33e9af4dabf64d619b1e829a66a46 to your computer and use it in GitHub Desktop.
Class that helps to debug layout changes animation
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 vmax.myway; | |
import android.animation.LayoutTransition; | |
import android.util.Log; | |
import android.view.View; | |
import android.view.ViewGroup; | |
public class LayoutTransitionLogger implements LayoutTransition.TransitionListener { | |
private String logTAG; | |
public LayoutTransitionLogger(String logTAG) | |
{ | |
this.logTAG = logTAG; | |
} | |
@Override | |
public void startTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { | |
Log.d(logTAG, "\n\n startTransition: in "+container+" view "+view+" type "+ descr(transitionType)); | |
} | |
@Override | |
public void endTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) { | |
Log.d(logTAG, "\n\n endTransition: in "+container+" view "+view+" type "+ descr(transitionType)); | |
} | |
String descr(int transitionType) { | |
String[] m = new String[]{"CHANGE_APPEARING","CHANGE_DISAPPEARING","APPEARING","DISAPPEARING"}; | |
return "" + transitionType + ": " + m[transitionType&3] + " changing="+( transitionType&LayoutTransition.CHANGING); | |
} | |
public String getLogTAG() { | |
return logTAG; | |
} | |
public void setLogTAG(String logTAG) { | |
this.logTAG = logTAG; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment