Android Open Source - Android-Pulley-Menu Custom List View Adapter






From Project

Back to project page Android-Pulley-Menu.

License

The source code is released under:

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCT...

If you think the Android project Android-Pulley-Menu 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 anshul.pulleymenu;
/* w  w w . ja va 2 s . c  o m*/
import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class CustomListViewAdapter extends ArrayAdapter<String> {

  Context Context;
  ArrayList<String> Menuitems = new ArrayList<String>();

  public CustomListViewAdapter(Context context, int ResourceId,
      List<String> objects) {
    super(context, ResourceId, objects);
    this.Menuitems = (ArrayList<String>) objects;
    this.Context = context;

  }

  private class ViewHolder {

    ImageView imageview;
    TextView textname;

  }

  public View getView(int position, View convertView, ViewGroup parent) {

    ViewHolder holder;
    String str = Menuitems.get(position);
    LayoutInflater mInflater = (LayoutInflater) Context
        .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);

    if (convertView == null) {
      convertView = mInflater.inflate(R.layout.listitem, null);
      holder = new ViewHolder();

      holder.textname = (TextView) convertView.findViewById(R.id.tVmenu);

      convertView.setTag(holder);
    } else
      holder = (ViewHolder) convertView.getTag();

    holder.textname.setText(str);

    convertView.setBackgroundColor(Color.WHITE);

    return convertView;

  }

}




Java Source Code List

anshul.pulleymenu.BuildLayerFrameLayout.java
anshul.pulleymenu.ColorDrawable.java
anshul.pulleymenu.CustomListViewAdapter.java
anshul.pulleymenu.DraggableDrawer.java
anshul.pulleymenu.FloatScroller.java
anshul.pulleymenu.MenuDrawer.java
anshul.pulleymenu.NoClickThroughFrameLayout.java
anshul.pulleymenu.OverlayDrawer.java
anshul.pulleymenu.PeekInterpolator.java
anshul.pulleymenu.Position.java
anshul.pulleymenu.PulleyMenu.java
anshul.pulleymenu.Scroller.java
anshul.pulleymenu.SinusoidalInterpolator.java
anshul.pulleymenu.SlideDrawable.java
anshul.pulleymenu.SlidingDrawer.java
anshul.pulleymenu.SmoothInterpolator.java
anshul.pulleymenu.StaticDrawer.java
anshul.pulleymenu.ViewHelper.java
anshul.pulleymenu.compat.ActionBarHelperNative.java
anshul.pulleymenu.compat.ActionBarHelperSherlock.java
anshul.pulleymenu.compat.ActionBarHelper.java
anshul.pulleymenu.samples.PulleyMenuSample.java
anshul.pulleymenu.test.java