Android Open Source - african-art-talent-discovery Crop Option Adapter

From Project

Back to project page african-art-talent-discovery.


The source code is released under:

GNU General Public License

If you think the Android project african-art-talent-discovery 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.appsng.reusables;
//  w  w  w  .  ja  v a2 s. c  o  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;

import com.ekoconnect.afriphotos.R;

 * Adapter for crop option list.
 * @author Lorensius W. L. T <>
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);
  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(;
      ((TextView) convertView.findViewById(;
      return convertView;
    return null;

Java Source Code List