首页 > 代码库 > Android PopuWindow 导航链级筛选

Android PopuWindow 导航链级筛选

效果图:



代码

PopuWindowWidget

package com.example.checklistview;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.PopupWindow;

@SuppressLint("ViewConstructor")
public class PopuWindowWidget{

	private static PopuWindowWidget popuWindow=null;
	private Context context;
	public PopuWindowWidget(Context context){
		this.context=context;
	}

	public static PopuWindowWidget getInstance(Context context){
		if(popuWindow==null){
			popuWindow=new PopuWindowWidget(context);
		}
		return popuWindow;
	}

	public void onCreatePopuWindow(View view,PopuWindowListener listener){
		PopupWindow pop=new PopupWindow(view,LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT);
		pop.setOutsideTouchable(false);
		pop.setFocusable(false);
		pop.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.background_trans));
		listener.initialization(pop);
	}

}
package com.example.checklistview;

import android.widget.PopupWindow;

public interface PopuWindowListener{
	void isShow(boolean isShow,String message);
	void initialization(PopupWindow popuWindow);
	void onClickItem(Object obj);
}

PopuWindowView:

package com.example.checklistview;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.example.checklistview.CheckAdapter.NameOnClickListener;

public class PopuWindowView implements NameOnClickListener{
	private static PopuWindowListener listener;
	private View view;
	private Activity activity;
	private TextView tv;
	private ListView listView_bar;
	private ListView listView_data;
	private ArrayList<CheckBean> data=http://www.mamicode.com/null;>

资源下载地址:http://download.csdn.net/detail/anddroid_lanyan/8229077




Android PopuWindow 导航链级筛选