Back to project page transitions-everywhere.
The source code is released under:
Apache License
If you think the Android project transitions-everywhere listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package android.transitions.everywhere.utils; //from w w w. jav a2 s . c o m import android.annotation.TargetApi; import android.os.Build.VERSION_CODES; import android.view.View; import java.lang.reflect.Method; @TargetApi(VERSION_CODES.KITKAT) class ViewUtilsKitKat extends ViewUtils.ViewUtilsJellyBeanMR2 { private static final Method METHOD_getTransitionAlpha = ReflectionUtils.getMethod(View.class, "getTransitionAlpha"); private static final Method METHOD_setTransitionAlpha = ReflectionUtils.getMethod(View.class, "setTransitionAlpha", float.class); @Override public float getTransitionAlpha(View v) { return (Float) ReflectionUtils.invoke(v, 1, METHOD_getTransitionAlpha); } @Override public boolean isLaidOut(View v, boolean defaultValue) { return v.isLaidOut(); } @Override public void setTransitionAlpha(View v, float alpha) { ReflectionUtils.invoke(v, null, METHOD_setTransitionAlpha, alpha); } @Override public String getAlphaProperty() { return "transitionAlpha"; } }