Android Open Source - ImageScanner Density Util






From Project

Back to project page ImageScanner.

License

The source code is released under:

Apache License

If you think the Android project ImageScanner 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 com.scanner.utils;
//from   w  w w  .j  a  v  a 2 s. c  o m
import android.content.Context;
import android.graphics.Point;
import android.os.Build;
import android.view.Display;
import android.view.WindowManager;

public class DensityUtil {  
  public static int SCREENWIDTH;
  public static int SCREENHEIGHT;
  
  
  /**
   * 
   * 
   * @param context
   * @return
   */
  public static int getScreenWidth(Context context) {
    int width = 0;  
    WindowManager window = (WindowManager) context
        .getSystemService(Context.WINDOW_SERVICE);
    Display display = window.getDefaultDisplay();
    if(Build.VERSION.SDK_INT > 12){
      Point point = new Point();
      display.getSize(point);
      width = point.x;
    }else{
      width = display.getWidth();
    }
    SCREENWIDTH = width;
    return width;
  }

  /**
   * ?????????
   * 
   * @param context
   * @return
   */
  public static int getScreenHeight(Context context) {
    int height = 0;  
    WindowManager window = (WindowManager) context
        .getSystemService(Context.WINDOW_SERVICE);
    Display display = window.getDefaultDisplay();
    if(Build.VERSION.SDK_INT > 12){
      Point point = new Point();
      display.getSize(point);
      height = point.y;
    }else{
      height = display.getHeight();
    }
    SCREENHEIGHT = height;
    return height;
  }
  
}




Java Source Code List

com.atermenji.android.iconicdroid.IconicFontDrawable.java
com.atermenji.android.iconicdroid.icon.EntypoIcon.java
com.atermenji.android.iconicdroid.icon.EntypoSocialIcon.java
com.atermenji.android.iconicdroid.icon.FontAwesomeIcon.java
com.atermenji.android.iconicdroid.icon.Icon.java
com.atermenji.android.iconicdroid.icon.IconicIcon.java
com.atermenji.android.iconicdroid.util.TypefaceManager.java
com.example.imagescanner.GalleryFolderActivity.java
com.example.imagescanner.GalleryGridActivity.java
com.example.imagescanner.MainActivity.java
com.scanner.adapter.GalleryFolderListAdapter.java
com.scanner.adapter.GalleryGridAdapter.java
com.scanner.beans.GalleryFolderBean.java
com.scanner.beans.GridImageBean.java
com.scanner.utils.BitmapUtils.java
com.scanner.utils.ConstantsUtils.java
com.scanner.utils.DensityUtil.java
com.scanner.utils.FormatBitmapUtils.java
com.scanner.utils.ImageLoaderCacheHelper.java
com.scanner.utils.L.java
com.scanner.utils.ScannerUtils.java
com.scanner.utils.UIHelper.java