Android Open Source - cloud-app Left Adapter

From Project

Back to project page cloud-app.


The source code is released under:

MIT License

If you think the Android project cloud-app 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

/*  w w  w.  j  a  v a  2 s.  co m*/
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;


import java.util.List;

 * Created by bq on 2015/1/4.
public class LeftAdapter extends BaseAdapter {
    private List<String> items;
    private LayoutInflater inflater;
    private Context context;

    public LeftAdapter(Context context, List<String> items) {
        this.context = context;
        this.inflater = LayoutInflater.from(context);
        this.items = items;

    public int getCount() {
        return items.size();

    public Object getItem(int position) {
        return items.get(position);

    public long getItemId(int position) {
        return position;

    public View getView(int position, View convertView, ViewGroup parent) {
        String item = items.get(position);
        ViewHolder viewHolder;
        if (convertView == null) {
            convertView = inflater.inflate(R.layout.left_list, null);
            viewHolder = new ViewHolder();
   = (TextView) convertView.findViewById(;

        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        return convertView;

    private static class ViewHolder {
        public TextView tv;

Java Source Code List