Android Open Source - semana-isw2013 Activity Utils






From Project

Back to project page semana-isw2013.

License

The source code is released under:

Apache License

If you think the Android project semana-isw2013 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 mobi.itson.semanaisw2013app.utils;
/*from   ww w  .ja v a  2  s.c  om*/
import android.annotation.SuppressLint;
import android.app.Activity;
import android.graphics.Point;
import android.graphics.drawable.Drawable;
import android.view.Display;
import android.view.View;

@SuppressLint("NewApi")
@SuppressWarnings("deprecation")
public class ActivityUtils {
  
  /**
   * Method that get the Screen Size
   * @param activity Actual Activity
   * @return array type int 
   */
  public static int[] getScreenSize(Activity activity){
    
    //Obtain default display
    Display display = activity.getWindowManager().getDefaultDisplay();
    Point size = new Point();
    
    //Set Size in case of ICS
    if(android.os.Build.VERSION.SDK_INT >= 13){
      display.getSize(size);
      return new int[] {size.x, size.y};
    } else {
      return new int[] {display.getWidth(), display.getHeight()};
    }
  }
  
  
  public static void setBackground(View view, Drawable drawable){
    //In case of Newer Version
    if(android.os.Build.VERSION.SDK_INT >= 16){
      view.setBackground(drawable);
    } else {
      view.setBackgroundDrawable(drawable);
    }
  }
}




Java Source Code List

mobi.itson.semanaisw2013app.AboutUsActivity.java
mobi.itson.semanaisw2013app.ConferenceActivity.java
mobi.itson.semanaisw2013app.Conference.java
mobi.itson.semanaisw2013app.ConferencesPagerFragment.java
mobi.itson.semanaisw2013app.GalleryActivity.java
mobi.itson.semanaisw2013app.ImagePagerActivity.java
mobi.itson.semanaisw2013app.MainActivity.java
mobi.itson.semanaisw2013app.ScheduleActivity.java
mobi.itson.semanaisw2013app.SplashActivity.java
mobi.itson.semanaisw2013app.WebView_Register_Actvity.java
mobi.itson.semanaisw2013app.WorkshopActivity.java
mobi.itson.semanaisw2013app.WorkshopPagerFragment.java
mobi.itson.semanaisw2013app.Workshop.java
mobi.itson.semanaisw2013app.utils.ActivityUtils.java
mobi.itson.semanaisw2013app.utils.BitmapHack.java
mobi.itson.semanaisw2013app.utils.Constants.java
mobi.itson.semanaisw2013app.utils.HttpHelper.java
mobi.itson.semanaisw2013app.utils.SemanaUpload.java
mobi.itson.semanaisw2013app.utils.TouchHighlightImageButton.java
mobi.itson.semanaisw2013app.utils.UploadImage.java