Android Open Source - fullscreen-popupmenu Popup Menu Array Adapter






From Project

Back to project page fullscreen-popupmenu.

License

The source code is released under:

MIT License

If you think the Android project fullscreen-popupmenu 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.lion.pupupmenu;
//from w ww  .  ja  va2s  .c om
import java.util.ArrayList;

import com.lion.popupmenu.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class PopupMenuArrayAdapter extends BaseAdapter {

  private ArrayList<String> mArrayList;
  private Context mContext;

  public PopupMenuArrayAdapter(Context context, ArrayList<String> arrayList) {
    mContext = context;
    mArrayList = arrayList;
  }

  @Override
  public int getCount() {
    return mArrayList.size();
  }

  @Override
  public Object getItem(int position) {
    return mArrayList.get(position);
  }

  @Override
  public long getItemId(int position) {
    return 0;
  }

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    View view = LayoutInflater.from(mContext).inflate(R.layout.defaultpopupmenuitem, null);
    TextView textView = (TextView) view.findViewById(R.id.menuName);
    textView.setText(((String) getItem(position)));
    return view;
  }

}




Java Source Code List

com.example.popupmenudemo.MainActivity.java
com.lion.homewatcher.HomeWatcher.java
com.lion.pupupmenu.FullScreenPopupMenu.java
com.lion.pupupmenu.PopupMenuArrayAdapter.java
com.lion.pupupmenu.PopupMenuListener.java