Android Open Source - UniversalImagePick App






From Project

Back to project page UniversalImagePick.

License

The source code is released under:

Apache License

If you think the Android project UniversalImagePick 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.luffyjet.universalimagepick;
/*  w  w  w  .ja  va2 s .c  om*/
import android.app.Application;
import android.content.Context;
import android.graphics.Bitmap;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;

public class App extends Application
{
  @Override
  public void onCreate()
  {
    super.onCreate();
    initImageLoader(this);
  }
  
  public static void initImageLoader(Context context) {
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
//    .memoryCacheExtraOptions(480, 800) // default = device screen dimensions
        .diskCacheExtraOptions(480, 800, null)
    .threadPriority(Thread.NORM_PRIORITY - 2)
    .denyCacheImageMultipleSizesInMemory()
    .threadPoolSize(3)
//    .memoryCache(new WeakMemoryCache())
    // .writeDebugLogs() // Remove for release app
    .build();
    // Initialize ImageLoader with configuration.
    ImageLoader.getInstance().init(config);
  }

  public static interface ImgLoaderOpts {
    DisplayImageOptions forImgSelect = new DisplayImageOptions.Builder()
//        .showImageOnLoading(R.drawable.default_img)// loading?
//        .showImageForEmptyUri(R.drawable.qb_group_open_troop_activity_break)
//        .showImageOnFail(R.drawable.qb_group_open_troop_activity_break)
        .resetViewBeforeLoading(false)
        .cacheInMemory(true)
        .cacheOnDisk(true)
        .considerExifParams(true)
        .imageScaleType(ImageScaleType.EXACTLY)
//        .decodingOptions(options)
        .bitmapConfig(Bitmap.Config.RGB_565)
        .build();
  }
}




Java Source Code List

com.luffyjet.universalimagepick.App.java
com.luffyjet.universalimagepick.Constants.java
com.luffyjet.universalimagepick.MainActivity.java
com.luffyjet.universalimagepick.Test.java
com.luffyjet.universalimagepick.adapter.BucketAdapter.java
com.luffyjet.universalimagepick.adapter.GalleryAdapter.java
com.luffyjet.universalimagepick.adapter.PickGridAdapter.java
com.luffyjet.universalimagepick.adapter.PreviewAdapter.java
com.luffyjet.universalimagepick.adapter.ResultAdapter.java
com.luffyjet.universalimagepick.model.ImageBucket.java
com.luffyjet.universalimagepick.model.Image.java
com.luffyjet.universalimagepick.model.ImagesHelper.java
com.luffyjet.universalimagepick.model.Thumbnail.java
com.luffyjet.universalimagepick.ui.BaseActivity.java
com.luffyjet.universalimagepick.ui.GalleryActivity.java
com.luffyjet.universalimagepick.ui.PickActivity.java
com.luffyjet.universalimagepick.utils.LogUtil.java
com.luffyjet.universalimagepick.widget.CropImageView.java
com.luffyjet.universalimagepick.widget.CustomGridView.java
com.luffyjet.universalimagepick.widget.MulitPointTouchListener.java
com.luffyjet.universalimagepick.widget.ViewfinderView.java