Android Open Source - scanNedit Crop Option Adapter






From Project

Back to project page scanNedit.

License

The source code is released under:

MIT License

If you think the Android project scanNedit 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.me.android.scanNedit;
//w  w w  . ja va  2s . co m
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import android.content.Context;

import java.util.ArrayList;


/**
 * Adapter for crop option list used in this project as an open source code
 * by @author Lorensius W. L. T <lorenz@londatiga.net>
 */
public class CropOptionAdapter extends ArrayAdapter<CropOption> {
  private ArrayList<CropOption> mOptions;
  private LayoutInflater mInflater;
  
  public CropOptionAdapter(Context context, ArrayList<CropOption> options) {
    super(context, R.layout.crop_selector, options);
    
    mOptions   = options;
    
    mInflater  = LayoutInflater.from(context);
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup group) {
    if (convertView == null)
      convertView = mInflater.inflate(R.layout.crop_selector, null);
    
    CropOption item = mOptions.get(position);
    
    if (item != null) {
      ((ImageView) convertView.findViewById(R.id.iv_icon)).setImageDrawable(item.icon);
      ((TextView) convertView.findViewById(R.id.tv_name)).setText(item.title);
      
      return convertView;
    }
    
    return null;
  }
}




Java Source Code List

com.googlecode.leptonica.android.AdaptiveMap.java
com.googlecode.leptonica.android.Binarize.java
com.googlecode.leptonica.android.Box.java
com.googlecode.leptonica.android.Constants.java
com.googlecode.leptonica.android.Convert.java
com.googlecode.leptonica.android.Enhance.java
com.googlecode.leptonica.android.JpegIO.java
com.googlecode.leptonica.android.Pix.java
com.googlecode.leptonica.android.Pixa.java
com.googlecode.leptonica.android.ReadFile.java
com.googlecode.leptonica.android.Rotate.java
com.googlecode.leptonica.android.Scale.java
com.googlecode.leptonica.android.Skew.java
com.googlecode.leptonica.android.WriteFile.java
com.googlecode.tesseract.android.TessBaseAPI.java
com.markupartist.android.widget.ActionBar.java
com.markupartist.android.widget.ActionBar_three.java
com.markupartist.android.widget.ActionBar_two.java
com.markupartist.android.widget.ScrollingTextView.java
com.me.android.scanNedit.CameraActivity.java
com.me.android.scanNedit.CropOptionAdapter.java
com.me.android.scanNedit.CropOption.java
com.me.android.scanNedit.FileCache.java
com.me.android.scanNedit.GalleryActivity.java
com.me.android.scanNedit.HelpActivity.java
com.me.android.scanNedit.ImageLoader.java
com.me.android.scanNedit.LazyAdapter.java
com.me.android.scanNedit.MemoryCache.java
com.me.android.scanNedit.Picture.java
com.me.android.scanNedit.SampleActivity.java
com.me.android.scanNedit.StartActivity.java
com.me.android.scanNedit.TessBaseAPITest.java
com.me.android.scanNedit.Utils.java
com.me.android.scanNedit.XMLParser.java