Android Open Source - ImageScanner Main Activity






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.example.imagescanner;
/* www.j a va  2 s  .c o m*/
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;

import com.scanner.utils.ConstantsUtils;
import com.scanner.utils.FormatBitmapUtils;

public class MainActivity extends Activity {

  private ImageView image;
  private TextView hint;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

    setContentView(R.layout.activity_main);
    image = (ImageView) findViewById(R.id.image);
    hint = (TextView) findViewById(R.id.hint);
    image.setOnClickListener(new OnClickListener() {
      
      @Override
      public void onClick(View v) {
        // TODO Auto-generated method stub
        
          if(v.getId() == R.id.image){
          Intent intent = new Intent(MainActivity.this,
               GalleryFolderActivity.class);
          MainActivity.this.startActivityForResult(intent,
               ConstantsUtils.REQUEST_FROM_GALLERY);
          
          

        
          }}
    });
  }
  
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {

    if (resultCode != Activity.RESULT_OK)
      return;
    switch (requestCode) {
    case ConstantsUtils.REQUEST_FROM_GALLERY:
      Bundle bundle = data.getExtras();
      String imgUrl = bundle.getString(ConstantsUtils.BUNDLE_IMAGE_PATH_FINAL);
      Bitmap bm = FormatBitmapUtils.file2Bitmap(imgUrl);
      image.setImageBitmap(bm);
      image.setClickable(false);
      hint.setVisibility(View.INVISIBLE);
    default:
      break;
    }
  }

}




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