// Path: dttv/dttv-samples/src/main/java/dttv/app/impl/ICallBack.java
// public abstract class ICallBack {
//     public void doClickListener(View v) {
// 
//     }
// 
//     public void doItemClickListener(AdapterView<?> parent, View v, int position, long id) {
// 
//     }
// 
//     public void doItemSelectedListenter(AdapterView<?> parent, View v, int position, long id) {
// 
//     }
// 
// 
// }
// 
// Path: dttv/dttv-samples/src/main/java/dttv/app/impl/I_PopWindow.java
// public interface I_PopWindow {
//     public void onItemClick(View v);
// 
//     public void onProgressChanged(int widgetId);
// }
// 
// Path: dttv/dttv-samples/src/main/java/dttv/app/utils/Constant.java
// public class Constant {
// 
//     public final static String EXTRA_MESSAGE = "com.example.simpleplayer.MESSAGE";
//     public final static String FILE_MSG = "dttp.app.media.URL";
//     public final static String FILE_TYPE = "dttp.app.media.type";
//     public static final String LOGTAG = "DTTV";
// 
// 
//     public final static int REFRESH_TIME_MSG = 0x1000;
//     public final static int BEGIN_MEDIA_MSG = REFRESH_TIME_MSG + 1;
//     public final static int HIDE_OPREATE_BAR_MSG = BEGIN_MEDIA_MSG + 1;
//     public final static int HIDE_PROGRESS_BAR_MSG = HIDE_OPREATE_BAR_MSG + 1;
//     public final static int REFRESH_TIME = 1000;
// 
// 
//     public static final String ARGUMENTS_NAME = "arg";
//     public static final int LOCAL_VIDEO = 0;
//     public static final int LOCAL_AUDIO = 1;
//     public static final int LOCAL_FILE = 2;
// 
//     public static final String MEIDA_NAME_STR = "dttv.app.media_name";
// 
//     public static final String[] gEqulizerPresets = {
//             "Normal",
//             "Classical",
//             "Dance",
//             "Flat",
//             "Folk",
//             "Heavy Metal",
//             "Hip Hop",
//             "Jazz",
//             "Rock"
//     };
// 
//     public static final int FILTER_SIZE = 1 * 1024 * 1024;// 1MB
//     public static final int FILTER_DURATION = 1 * 60 * 1000;// 1分钟
// 
// 
//     // setting
//     public static final String KEY_SETTING_FILTER_AUDIO_FILTER = "key_checkbox_setting_audio_filter";
//     public static final String KEY_SETTING_FILTER_VIDEO_FILTER = "key_checkbox_setting_video_filter";
//     public static final String KEY_SETTING_DECODER_TYPE = "key_listpreference_setting_decoder_type";
//     public static final String KEY_SETTING_DECODER_TYPE_SOFT = "0";
//     public static final String KEY_SETTING_DECODER_TYPE_HW = "1";
//     public static final String KEY_SETTING_BROWSER_MODE ="key_listpreference_filebrowser_display";
//     public static final String KEY_SETTING_DISPLAY_MODE ="key_listpreference_setting_display_mode";
// 
// }


import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager.LayoutParams;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.PopupWindow;
import dttv.app.R;
import dttv.app.impl.ICallBack;
import dttv.app.impl.I_PopWindow;
import dttv.app.utils.Constant;
        Log.i(TAG, "enter PopWindowCompnent");
        initialize();
    }

    @Override
    public void initialize() {
        // TODO Auto-generated method stub
        super.initialize();
        View view = LayoutInflater.from(mActivity).inflate(R.layout.effect_popwindow, null);
        mListView = (ListView) view.findViewById(R.id.pop_listview);
        fillData();
        effectWindow = new PopupWindow(view, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        effectWindow.setAnimationStyle(R.style.pop_win_style);
        ColorDrawable dw = new ColorDrawable(0xb0ffffff);
        effectWindow.setBackgroundDrawable(dw);
        mListView.setOnItemClickListener(new ItemClickListener());
    }

    private class ItemClickListener implements OnItemClickListener {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position,
                                long id) {
            // TODO Auto-generated method stub
            callback.doItemClickListener(parent, view, position, id);
            effectWindow.dismiss();
        }
    }

    private void fillData() {
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(mActivity,
// Path: dttv/dttv-samples/src/main/java/dttv/app/impl/ICallBack.java
// public abstract class ICallBack {
//     public void doClickListener(View v) {
// 
//     }
// 
//     public void doItemClickListener(AdapterView<?> parent, View v, int position, long id) {
// 
//     }
// 
//     public void doItemSelectedListenter(AdapterView<?> parent, View v, int position, long id) {
// 
//     }
// 
// 
// }
// 
// Path: dttv/dttv-samples/src/main/java/dttv/app/impl/I_PopWindow.java
// public interface I_PopWindow {
//     public void onItemClick(View v);
// 
//     public void onProgressChanged(int widgetId);
// }
// 
// Path: dttv/dttv-samples/src/main/java/dttv/app/utils/Constant.java
// public class Constant {
// 
//     public final static String EXTRA_MESSAGE = "com.example.simpleplayer.MESSAGE";
//     public final static String FILE_MSG = "dttp.app.media.URL";
//     public final static String FILE_TYPE = "dttp.app.media.type";
//     public static final String LOGTAG = "DTTV";
// 
// 
//     public final static int REFRESH_TIME_MSG = 0x1000;
//     public final static int BEGIN_MEDIA_MSG = REFRESH_TIME_MSG + 1;
//     public final static int HIDE_OPREATE_BAR_MSG = BEGIN_MEDIA_MSG + 1;
//     public final static int HIDE_PROGRESS_BAR_MSG = HIDE_OPREATE_BAR_MSG + 1;
//     public final static int REFRESH_TIME = 1000;
// 
// 
//     public static final String ARGUMENTS_NAME = "arg";
//     public static final int LOCAL_VIDEO = 0;
//     public static final int LOCAL_AUDIO = 1;
//     public static final int LOCAL_FILE = 2;
// 
//     public static final String MEIDA_NAME_STR = "dttv.app.media_name";
// 
//     public static final String[] gEqulizerPresets = {
//             "Normal",
//             "Classical",
//             "Dance",
//             "Flat",
//             "Folk",
//             "Heavy Metal",
//             "Hip Hop",
//             "Jazz",
//             "Rock"
//     };
// 
//     public static final int FILTER_SIZE = 1 * 1024 * 1024;// 1MB
//     public static final int FILTER_DURATION = 1 * 60 * 1000;// 1分钟
// 
// 
//     // setting
//     public static final String KEY_SETTING_FILTER_AUDIO_FILTER = "key_checkbox_setting_audio_filter";
//     public static final String KEY_SETTING_FILTER_VIDEO_FILTER = "key_checkbox_setting_video_filter";
//     public static final String KEY_SETTING_DECODER_TYPE = "key_listpreference_setting_decoder_type";
//     public static final String KEY_SETTING_DECODER_TYPE_SOFT = "0";
//     public static final String KEY_SETTING_DECODER_TYPE_HW = "1";
//     public static final String KEY_SETTING_BROWSER_MODE ="key_listpreference_filebrowser_display";
//     public static final String KEY_SETTING_DISPLAY_MODE ="key_listpreference_setting_display_mode";
// 
// }


// Path: dttv/dttv-samples/src/main/java/dttv/app/compnent/PopWindowCompnent.java
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager.LayoutParams;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.PopupWindow;
import dttv.app.R;
import dttv.app.impl.ICallBack;
import dttv.app.impl.I_PopWindow;
import dttv.app.utils.Constant;

        Log.i(TAG, "enter PopWindowCompnent");
        initialize();
    }

    @Override
    public void initialize() {
        // TODO Auto-generated method stub
        super.initialize();
        View view = LayoutInflater.from(mActivity).inflate(R.layout.effect_popwindow, null);
        mListView = (ListView) view.findViewById(R.id.pop_listview);
        fillData();
        effectWindow = new PopupWindow(view, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        effectWindow.setAnimationStyle(R.style.pop_win_style);
        ColorDrawable dw = new ColorDrawable(0xb0ffffff);
        effectWindow.setBackgroundDrawable(dw);
        mListView.setOnItemClickListener(new ItemClickListener());
    }

    private class ItemClickListener implements OnItemClickListener {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position,
                                long id) {
            // TODO Auto-generated method stub
            callback.doItemClickListener(parent, view, position, id);
            effectWindow.dismiss();
        }
    }

    private void fillData() {
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(mActivity,
                android.R.layout.simple_list_item_1, Constant.gEqulizerPresets);