Back to project page android-ui.
The source code is released under:
Apache License
If you think the Android project android-ui 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 at.markushi.ui.util; // w w w . j av a 2 s . c om import android.graphics.drawable.Drawable; import android.os.Build; import android.view.View; public class UiHelper { @SuppressWarnings("deprecation") public static void setBackground(View view, Drawable d) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { view.setBackground(d); } else { view.setBackgroundDrawable(d); } } public static void postInvalidateOnAnimation(View view) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { view.postInvalidateOnAnimation(); } else { view.invalidate(); } } }