Android Open Source - AndroidUIExample Ui Helper






From Project

Back to project page AndroidUIExample.

License

The source code is released under:

Apache License

If you think the Android project AndroidUIExample listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package util;
/*  w ww.  j a  v a  2  s.  co m*/
import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;

public class UiHelper {

  @SuppressLint("NewApi") @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);
    }
  }

  @SuppressLint("NewApi") public static void postInvalidateOnAnimation(View view) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
      view.postInvalidateOnAnimation();
    } else {
      view.invalidate();
    }
  }
}




Java Source Code List

action.Action.java
action.BackAction.java
action.CloseAction.java
action.DrawerAction.java
action.LineSegment.java
action.PlusAction.java
action.SymbolAction.java
com.example.androidui.ActionView.java
com.example.androidui.MyActivity.java
com.example.androidui.RevealColorView.java
util.BakedBezierInterpolator.java
util.UiHelper.java