Back to project page scanNedit.
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.
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; } }