package com.peer1.internetmap;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;

//note: a lot of this is c&p from VisualizationPopupWindow. if we get a 3rd simple menu we should abstract it out.
public class InfoPopup extends PopupWindow{
    private static String TAG = "InfoPopup";
    private Context mContext;

    private class InfoArrayAdapter extends ArrayAdapter<String> {
        public int selectedRow;

        public InfoArrayAdapter(Context context, int resource, int textViewResourceId, String[] objects) {
            super(context, resource, textViewResourceId, objects);
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            TextView textView = (TextView) super.getView(position, convertView, parent);
            if (position == selectedRow) {
                textView.setBackgroundColor(mContext.getResources().getColor(R.color.orange));
                textView.setTextColor(Color.BLACK);
            } else {
                textView.setBackgroundColor(Color.TRANSPARENT);
                textView.setTextColor(Color.WHITE);
            }
            return textView;
        }
    }

    public InfoPopup(final InternetMap context, final MapControllerWrapper controller, View view) {
        super(view, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        setBackgroundDrawable(new ColorDrawable(context.getResources().getColor(R.color.translucentBlack)));
        setOutsideTouchable(true);
        setFocusable(true);
        mContext = context;

        final ListView listView = (ListView) getContentView().findViewById(R.id.visualizationList);
        
        String[] values = new String[3];
        values[0] = context.getString(R.string.infoHelp);
        values[1] = context.getString(R.string.infoSales);
        values[2] = context.getString(R.string.infoCredits);
        
        final InfoArrayAdapter adapter = new InfoArrayAdapter(context, android.R.layout.simple_list_item_1, android.R.id.text1, values);
        listView.setAdapter(adapter);

        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
                switch (position) {
                case 0: //help
                    Log.d(TAG, "TODO: help");
                    break;
                case 1: //sales
                    Log.d(TAG, "TODO: sales");
                    break;
                case 2: //credits
                    Log.d(TAG, "TODO: credits");
                    break;
                default:
                    Log.e(TAG, "can't happen");
                }
                InfoPopup.this.dismiss();
            }
        });
    }


}

@@ -29,71 +29,8 @@
 p;%0A%0A
-import android.content.Context;%0Aimport android.graphics.Color;%0A
 impo
@@ -181,1103 +181,213 @@
 get.
-*;%0A%0A//note: a lot of this is c&p from VisualizationPopupWindow. if we get a 3rd simple menu we should abstract it out.%0Apublic class InfoPopup extends PopupWindow%7B%0A    private static String TAG = %22InfoPopup%22;%0A    private Context mContext;%0A%0A    private class InfoArrayAdapter extends ArrayAdapter%3CString%3E %7B%0A        public int selectedRow;%0A%0A        public InfoArrayAdapter(Context context, int resource, int textViewResourceId, String%5B%5D objects) %7B%0A            super(context, resource, textViewResourceId, objects);%0A        %7D%0A%0A        @Override%0A        public View getView(int position, View convertView, ViewGroup parent) %7B%0A            TextView textView = (TextView) super.getView(position, convertView, parent);%0A            if (position == selectedRow) %7B%0A                textView.setBackgroundColor(mContext.getResources().getColor(R.color.orange));%0A                textView.setTextColor(Color.BLACK);%0A            %7D else %7B%0A                textView.setBackgroundColor(Color.TRANSPARENT);%0A                textView.setTextColor(Color.WHITE);%0A            %7D%0A            return textView;%0A        %7D%0A    %7D
+AdapterView;%0Aimport android.widget.ArrayAdapter;%0Aimport android.widget.ListView;%0Aimport android.widget.PopupWindow;%0A%0Apublic class InfoPopup extends PopupWindow%7B%0A    private static String TAG = %22InfoPopup%22;
 %0A%0A  
@@ -754,36 +754,8 @@
 ue);
-%0A        mContext = context;
 %0A%0A  
@@ -1103,20 +1103,16 @@
   final 
-Info
 ArrayAda
@@ -1115,16 +1115,24 @@
 yAdapter
+%3CString%3E
  adapter
@@ -1138,20 +1138,16 @@
 r = new 
-Info
 ArrayAda
@@ -1150,16 +1150,24 @@
 yAdapter
+%3CString%3E
 (context

Remove highlight code from info popup. Android half of #241