Android用PopupWindow实现下拉菜单

实现效果:


initpintu_副本_副本.jpg

(注意:PopupWindow菜单Android5.0以下版本点击外部不消失问题 && 在Android 7.0上PopupWindow.showAsDropDown不起作用问题)

布局说明:


image.png

点击区域弹出区域菜单,并实现遮罩层效果:


image.png

以下为实现代码(仅菜单部分):
1,主页布局newpages_activity_risk_demo.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:background="@color/gray_white">

    <FrameLayout
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"
        android:id="@+id/f1_frag"
        android:layout_width="match_parent"
        android:layout_height="105dip"
        android:layout_marginTop="50dip"
        android:background="@color/gray_white">
        <!-- 第一行 -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="50dip"
            android:orientation="horizontal"
            android:background="@color/white">

            <!-- 第一列 -->
            <LinearLayout
                android:layout_width="0dip"
                android:layout_weight="1"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/tvRiskArea"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:gravity="center"
                    android:text="区域"
                    android:textColor="@color/title_text_color"
                    android:textSize="@dimen/tb_body"/>

            </LinearLayout>
            <!-- 右下三角 -->
            <LinearLayout
                android:layout_width="0dip"
                android:layout_weight="0.1"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <ImageView
                    android:layout_width="10dip"
                    android:layout_height="10dip"
                    android:layout_marginTop="30dip"
                    android:background="@drawable/trigon" />

            </LinearLayout>
            <!-- 第二列 -->
            <LinearLayout
                android:layout_width="0dip"
                android:layout_weight="1"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/tvRiskSort"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:gravity="center"
                    android:text="类别"
                    android:textColor="@color/title_text_color"
                    android:textSize="@dimen/tb_body"/>

            </LinearLayout>
            <!-- 右下三角 -->
            <LinearLayout
                android:layout_width="0dip"
                android:layout_weight="0.1"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <ImageView
                    android:layout_width="10dip"
                    android:layout_height="10dip"
                    android:layout_marginTop="30dip"
                    android:background="@drawable/trigon" />

            </LinearLayout>
            <!-- 第三列 -->
            <LinearLayout
                android:layout_width="0dip"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/tvRiskLevel"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:gravity="center"
                    android:text="等级"
                    android:textColor="@color/title_text_color"
                    android:textSize="@dimen/tb_body"/>

            </LinearLayout>
            <!-- 右下三角 -->
            <LinearLayout
                android:layout_width="0dip"
                android:layout_weight="0.1"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <ImageView
                    android:layout_width="10dip"
                    android:layout_height="10dip"
                    android:layout_marginTop="30dip"
                    android:background="@drawable/trigon" />

            </LinearLayout>
            <!-- 第四列 -->
            <LinearLayout
                android:layout_width="0dip"
                android:layout_weight="1"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/tvRiskGrade"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:gravity="center"
                    android:text="来源"
                    android:textColor="@color/title_text_color"
                    android:textSize="@dimen/tb_body"/>

            </LinearLayout>
            <!-- 右下三角 -->
            <LinearLayout
                android:layout_width="0dip"
                android:layout_weight="0.1"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <ImageView
                    android:layout_width="10dip"
                    android:layout_height="10dip"
                    android:layout_marginTop="30dip"
                    android:background="@drawable/trigon" />

            </LinearLayout>
            <!-- 空白占位 -->
            <LinearLayout
                android:layout_width="0dip"
                android:layout_weight="0.1"
                android:layout_height="match_parent"
                android:orientation="vertical"/>

        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="0.5dp"
            android:layout_marginTop="50dip"
            android:background="@color/gray_white"/>

        <!-- 第二行 -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="50dip"
            android:layout_marginTop="50.5dip"
            android:orientation="horizontal"
            android:background="@color/white">

            <TextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="fill_vertical"
                android:text="当前区域:全部区域"
                android:layout_marginLeft="10dip"
                android:textColor="@color/title_text_color"
                android:textSize="@dimen/tb_body"/>

        </LinearLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="0.5dp"
            android:layout_marginTop="101dip"
            android:background="@color/gray_white"/>

    </FrameLayout>

    <ListView
        android:id="@+id/lvRisk"
        android:divider="@null"
        android:dividerHeight="1.0dip"
        android:scrollbars="none"
        android:listSelector="@android:color/transparent"
        android:cacheColorHint="@android:color/transparent"
        android:fadingEdge="none"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="155dip"
        android:layout_marginBottom="10dip"
        />

</RelativeLayout>

2,主页activity PageRiskActivity.java

import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.ab.activity.AbActivity;
import com.ab.util.AbDialogUtil;
import com.ab.view.titlebar.AbTitleBar;
import com.andbase.R;
import com.andbase.global.MyApplication;
import com.andbase.patrol.gtDemo.adapter.pagesAdapter.newPagesAdapter.ListRiskAreaListsDemoAdapter;
import com.andbase.patrol.gtDemo.adapter.pagesAdapter.newPagesAdapter.ListRiskGradeListsDemoAdapter;
import com.andbase.patrol.gtDemo.adapter.pagesAdapter.newPagesAdapter.ListRiskLevelListsDemoAdapter;
import com.andbase.patrol.gtDemo.adapter.pagesAdapter.newPagesAdapter.ListRiskSortListsDemoAdapter;
import com.andbase.patrol.gtDemo.adapter.pagesAdapter.newPagesAdapter.PageRiskAdapter;
import com.andbase.patrol.gtDemo.model.PageRiskFormDemo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * author:lmx
 * date:2018/3/6
 * description:风险清单--PopupWindow菜单、列表
 */
public class PageRiskActivity extends AbActivity implements View.OnClickListener{

    private MyApplication application;
    //加载不同布局
    private PageRiskActivity context;
    private ListView listview;
    public List<PageRiskFormDemo> listInfo = null;
    //实例
    private TextView tvRiskArea,tvRiskSort,tvRiskLevel,tvRiskGrade;
    //菜单显示PopupWindow
    private PopupWindow mPopWindow;
    private List<Map<String, Object>> riskAreaList = null;
    private List<Map<String, Object>> riskSortList = null;
    private List<Map<String, Object>> riskLevelList = null;
    private List<Map<String, Object>> riskGradeList = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setAbContentView(R.layout.newpages_activity_risk_demo);
        AbTitleBar mAbTitleBar = this.getTitleBar();
        mAbTitleBar.setTitleText("风险清单");
        mAbTitleBar.setLogo(R.drawable.button_selector_back);
        mAbTitleBar.setTitleBarBackground(R.drawable.top_bg);
        mAbTitleBar.setTitleTextMargin(10, 0, 0, 0);
        mAbTitleBar.setLogoLine(R.drawable.line);
        this.setTitleBarOverlay(true);
        application = (MyApplication)abApplication;
        //加载不同布局
        this.listview = (ListView) findViewById(R.id.lvRisk);
        context = this;
        //获取实例--页头菜单
        tvRiskArea = (TextView)findViewById(R.id.tvRiskArea);
        tvRiskSort = (TextView)findViewById(R.id.tvRiskSort);
        tvRiskLevel = (TextView)findViewById(R.id.tvRiskLevel);
        tvRiskGrade = (TextView)findViewById(R.id.tvRiskGrade);
        //绑定点击事件
        tvRiskArea.setOnClickListener(this);
        tvRiskSort.setOnClickListener(this);
        tvRiskLevel.setOnClickListener(this);
        tvRiskGrade.setOnClickListener(this);

        //加载数据
        loadListView();
    }

    /**
     * 加载listView数据
     */
    public void loadListView(){
        try {
            listInfo = new ArrayList<PageRiskFormDemo>();

            PageRiskFormDemo form1 = new PageRiskFormDemo();
            form1.setPropertyType(0);//数值
            form1.setRiskName("风险点名称1");
            form1.setFirstRisk("一类风险点");
            form1.setaRisk("A级风险点");
            form1.setRiskControl("风险分级管控");
            listInfo.add(form1);

            PageRiskFormDemo form2 = new PageRiskFormDemo();
            form2.setPropertyType(0);
            form2.setRiskName("风险点名称2");
            form2.setFirstRisk("一类风险点");
            form2.setaRisk("A级风险点");
            form2.setRiskControl("风险分级管控");
            listInfo.add(form2);

            PageRiskFormDemo form3 = new PageRiskFormDemo();
            form3.setPropertyType(0);
            form3.setRiskName("风险点名称3");
            form3.setFirstRisk("一类风险点");
            form3.setaRisk("A级风险点");
            form3.setRiskControl("风险分级管控");
            listInfo.add(form3);

            PageRiskFormDemo form4 = new PageRiskFormDemo();
            form4.setPropertyType(0);
            form4.setRiskName("风险点名称4");
            form4.setFirstRisk("一类风险点");
            form4.setaRisk("A级风险点");
            form4.setRiskControl("风险分级管控");
            listInfo.add(form4);

            PageRiskFormDemo form5 = new PageRiskFormDemo();
            form5.setPropertyType(0);
            form5.setRiskName("风险点名称5");
            form5.setFirstRisk("一类风险点");
            form5.setaRisk("A级风险点");
            form5.setRiskControl("风险分级管控");
            listInfo.add(form5);

            PageRiskFormDemo form6 = new PageRiskFormDemo();
            form6.setPropertyType(0);
            form6.setRiskName("风险点名称6");
            form6.setFirstRisk("一类风险点");
            form6.setaRisk("A级风险点");
            form6.setRiskControl("风险分级管控");
            listInfo.add(form6);

        }catch(Exception ex)
        {
            Log.e("JSON Error: ", ex.toString());
        }

        ListView listView = (ListView) findViewById(R.id.lvRisk);
        PageRiskAdapter pageRiskAdapter = new PageRiskAdapter(context,listInfo);
        listView.setAdapter(pageRiskAdapter);
    }

    //菜单绑定点击事件
    @Override
    public void onClick(View v) {
        int id = v.getId();
        switch (id){
            case R.id.tvRiskArea:
                showRiskAreaPopupWindow();
            break;
            case R.id.tvRiskSort:
                showRiskSortPopupWindow();
            break;
            case R.id.tvRiskLevel:
                showRiskLevelPopupWindow();
            break;
            case R.id.tvRiskGrade:
                showRiskGradePopupWindow();
            break;
        }
    }
    //PopupWindow菜单详细内容显示
    //区域
    private void showRiskAreaPopupWindow() {
        //设置contentView
        View contentView = LayoutInflater.from(PageRiskActivity.this).inflate(R.layout.newpages_activity_risk_area_popup_demo, null);
        mPopWindow = new PopupWindow(contentView,
                ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, true);
        mPopWindow.setContentView(contentView);
        //获取实例,设置各个控件的点击响应
        //注意:PopupWindow中各个控件的所在的布局是contentView,而不是在Activity中,所以,要在findViewById(R.id.tv)前指定根布局
        CheckBox cbAllArea = (CheckBox)contentView.findViewById(R.id.cbAllArea);
        TextView tvAllArea = (TextView)contentView.findViewById(R.id.tvAllArea);
        ListView lvRiskArea = (ListView)contentView.findViewById(R.id.lvRiskArea);
        //区域列表加载
        riskAreaList = new ArrayList<Map<String, Object>>();
        Map<String,Object> map = new HashMap<String,Object>();
        for(int i=1; i<10; i++)
        {
            map = new HashMap<String, Object>();
            map.put("tvAreaItem", "区域" + i);
            map.put("tvAreaNo", i+5);
            riskAreaList.add(map);
        }
        ListRiskAreaListsDemoAdapter listRiskAreaListsDemoAdapter = new ListRiskAreaListsDemoAdapter(PageRiskActivity.this, riskAreaList,
                R.layout.newpages_risk_area_popup_list_item_demo, new String[] { "tvAreaItem","tvAreaNo"}, new int[] { R.id.tvAreaItem,R.id.tvAreaNo});
        lvRiskArea.setAdapter(listRiskAreaListsDemoAdapter);

        tvAllArea.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                AbDialogUtil.showAlertDialog(PageRiskActivity.this,"直接绑定点击事件");
                mPopWindow.dismiss();
            }
        });

        //解决5.0以下版本点击外部不消失问题
        mPopWindow.setOutsideTouchable(true);
        mPopWindow.setBackgroundDrawable(new BitmapDrawable());
        //显示方式
        mPopWindow.showAsDropDown(tvRiskArea);

    }
    //类别
    private void showRiskSortPopupWindow() {
        //设置contentView
        View contentView = LayoutInflater.from(PageRiskActivity.this).inflate(R.layout.newpages_activity_risk_sort_popup_demo, null);
        mPopWindow = new PopupWindow(contentView,
                ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, true);
        mPopWindow.setContentView(contentView);

        //获取实例,设置各个控件的点击响应
        //注意:PopupWindow中各个控件的所在的布局是contentView,而不是在Activity中,所以,要在findViewById(R.id.tv)前指定根布局
        CheckBox cbAllSort = (CheckBox)contentView.findViewById(R.id.cbAllSort);
        ListView lvRiskSort = (ListView)contentView.findViewById(R.id.lvRiskSort);
        //类别列表加载
        riskSortList = new ArrayList<Map<String, Object>>();
        Map<String,Object> map = new HashMap<String,Object>();
        for(int i=1; i<4; i++)
        {
            map = new HashMap<String, Object>();
            switch (i){
                case 1:
                    map.put("tvSortItem", "一类");
                    riskSortList.add(map);
                    break;
                case 2:
                    map.put("tvSortItem", "二类");
                    riskSortList.add(map);
                    break;
                case 3:
                    map.put("tvSortItem", "三类");
                    riskSortList.add(map);
                    break;
            }
//            map.put("tvSortItem", i + "类");
//            riskSortList.add(map);
        }
        ListRiskSortListsDemoAdapter listRiskSortListsDemoAdapter = new ListRiskSortListsDemoAdapter(PageRiskActivity.this, riskSortList,
                R.layout.newpages_risk_sort_popup_list_item_demo, new String[] { "tvSortItem"}, new int[] { R.id.tvSortItem});
        lvRiskSort.setAdapter(listRiskSortListsDemoAdapter);

        //解决5.0以下版本点击外部不消失问题
        mPopWindow.setOutsideTouchable(true);
        mPopWindow.setBackgroundDrawable(new BitmapDrawable());
        //显示方式
        mPopWindow.showAsDropDown(tvRiskSort);
    }
    //等级
    private void showRiskLevelPopupWindow() {
        //设置contentView
        View contentView = LayoutInflater.from(PageRiskActivity.this).inflate(R.layout.newpages_activity_risk_level_popup_demo, null);
        mPopWindow = new PopupWindow(contentView,
                ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, true);
        mPopWindow.setContentView(contentView);

        //获取实例,设置各个控件的点击响应
        //注意:PopupWindow中各个控件的所在的布局是contentView,而不是在Activity中,所以,要在findViewById(R.id.tv)前指定根布局
        CheckBox cbAllLevel = (CheckBox)contentView.findViewById(R.id.cbAllLevel);
        ListView lvRiskLevel = (ListView)contentView.findViewById(R.id.lvRiskLevel);
        //等级列表加载
        riskLevelList = new ArrayList<Map<String, Object>>();
        Map<String,Object> map = new HashMap<String,Object>();
        for(int i=1; i<4; i++)
        {
            map = new HashMap<String, Object>();
            switch (i){
                case 1:
                    map.put("tvLevelItem", "A级");
                    riskLevelList.add(map);
                    break;
                case 2:
                    map.put("tvLevelItem", "B级");
                    riskLevelList.add(map);
                    break;
                case 3:
                    map.put("tvLevelItem", "C级");
                    riskLevelList.add(map);
                    break;
            }

//            map.put("tvLevelItem", i + "级");
//            riskLevelList.add(map);
        }
        ListRiskLevelListsDemoAdapter listRiskLevelListsDemoAdapter = new ListRiskLevelListsDemoAdapter(PageRiskActivity.this, riskLevelList,
                R.layout.newpages_risk_level_popup_list_item_demo, new String[] { "tvLevelItem"}, new int[] { R.id.tvLevelItem});
        lvRiskLevel.setAdapter(listRiskLevelListsDemoAdapter);

        //解决5.0以下版本点击外部不消失问题
        mPopWindow.setOutsideTouchable(true);
        mPopWindow.setBackgroundDrawable(new BitmapDrawable());
        //显示方式
        mPopWindow.showAsDropDown(tvRiskLevel);
    }
    //来源
    private void showRiskGradePopupWindow() {
        //设置contentView
        View contentView = LayoutInflater.from(PageRiskActivity.this).inflate(R.layout.newpages_activity_risk_grade_popup_demo, null);
        mPopWindow = new PopupWindow(contentView,
                ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, true);
        mPopWindow.setContentView(contentView);

        //获取实例,设置各个控件的点击响应
        //注意:PopupWindow中各个控件的所在的布局是contentView,而不是在Activity中,所以,要在findViewById(R.id.tv)前指定根布局
        CheckBox cbAllGrade = (CheckBox)contentView.findViewById(R.id.cbAllGrade);
        ListView lvRiskGrade = (ListView)contentView.findViewById(R.id.lvRiskGrade);
        //来源列表加载
        riskGradeList = new ArrayList<Map<String, Object>>();
        Map<String,Object> map = new HashMap<String,Object>();
        for(int i=1; i<5; i++)
        {
            map = new HashMap<String, Object>();
            switch (i){
               case 1:
                   map.put("tvGradeItem", "风险分级管控系统");
                   riskGradeList.add(map);
                   break;
               case 2:
                   map.put("tvGradeItem", "巡检管理系统");
                   riskGradeList.add(map);
                   break;
               case 3:
                   map.put("tvGradeItem", "作业管理系统");
                   riskGradeList.add(map);
                   break;
               case 4:
                   map.put("tvGradeItem", "综合安全管理系统");
                   riskGradeList.add(map);
                   break;
            }
//            map.put("tvGradeItem", i + "系统");
//            riskGradeList.add(map);
        }
        ListRiskGradeListsDemoAdapter listRiskGradeListsDemoAdapter = new ListRiskGradeListsDemoAdapter(PageRiskActivity.this, riskGradeList,
                R.layout.newpages_risk_grade_popup_list_item_demo, new String[] { "tvGradeItem"}, new int[] { R.id.tvGradeItem});
        lvRiskGrade.setAdapter(listRiskGradeListsDemoAdapter);

        //解决5.0以下版本点击外部不消失问题
        mPopWindow.setOutsideTouchable(true);
        mPopWindow.setBackgroundDrawable(new BitmapDrawable());
        //显示方式
        mPopWindow.showAsDropDown(tvRiskGrade);
    }

}

3,区域子菜单(其它相同),对应为主页activity中showRiskAreaPopupWindow()部分。
子菜单的表现样式:newpages_activity_risk_area_popup_demo.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/popup_shadow_bg_color">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:orientation="vertical"
        android:paddingBottom="2dp"
        android:layout_alignParentTop="true">

        <!-- 悬浮按钮 -->
        <FrameLayout
            android:layout_alignParentTop="true"
            android:layout_alignParentRight="true"
            android:id="@+id/f1_frag"
            android:layout_width="match_parent"
            android:layout_height="40dip"
            android:layout_marginBottom="0dip"
            android:background="@color/popup_bg_color">

            <CheckBox
                android:id="@+id/cbAllArea"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_marginLeft="15dip"
                android:textColor="@color/details_text_color"
                android:textSize="@dimen/table_body"
                android:text="全部区域" />

            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="match_parent"
                android:gravity="right"
                android:layout_marginLeft="8dip"
                android:layout_marginRight="15dip">

                <TextView
                    android:id="@+id/tvAllArea"
                    android:layout_width="wrap_content"
                    android:layout_height="fill_parent"
                    android:text="121"
                    android:gravity="center"
                    android:textColor="@color/details_text_color"
                    android:textSize="@dimen/table_body"/>

            </LinearLayout>


        </FrameLayout>

        <ListView
            android:id="@+id/lvRiskArea"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:divider="@color/table_line"
            android:dividerHeight="1.0dip"
            android:scrollbars="none"
            android:listSelector="@android:color/transparent"
            android:cacheColorHint="@android:color/transparent"
            android:fadingEdge="none"
            />

    </LinearLayout>

</RelativeLayout>

其中:RelativeLayout的android:background="@color/popup_shadow_bg_color"为半透明色:#96000000,实现遮罩层效果
4,子菜单中ListView的item
newpages_risk_area_popup_list_item_demo.xml

<?xml version="1.0" encoding="UTF-8"?>
<android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="40dip"
        android:gravity="center_vertical"
        android:layout_marginLeft="15dip"
        android:layout_marginRight="15dip"
        >

        <TextView
            android:id="@+id/tvAreaItem"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingBottom="@dimen/table_padding"
            android:paddingTop="@dimen/table_padding"
            android:textColor="@color/title_text_color"
            android:textSize="@dimen/table_body"
            android:gravity="center"
            android:singleLine="false"
            android:ellipsize="none"
            android:inputType="textMultiLine"
            android:text="区域一"
            />

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="match_parent"
            android:gravity="right"
            android:layout_marginLeft="8dip">

            <TextView
                android:id="@+id/tvAreaNo"
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:text="12"
                android:gravity="center_vertical"
                android:textColor="@color/title_text_color"
                android:textSize="@dimen/table_body"/>

        </LinearLayout>

    </LinearLayout>

</android.support.percent.PercentRelativeLayout>

5,区域子菜单Adapter
ListRiskAreaListsDemoAdapter.java

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

import com.andbase.patrol.gtDemo.activity.pages.newPages.PageRiskActivity;

import java.util.List;
import java.util.Map;

/**
 * author:lmx
 * date:2018/3/7
 * description:
 */

public class ListRiskAreaListsDemoAdapter extends BaseAdapter {

    private PageRiskActivity mContext;
    //单行的布局
    private int mResource;
    //列表展现的数据
    private List<? extends Map<String, ?>> mData;
    //Map中的key
    private String[] mFrom;
    //view的id
    private int[] mTo;

    //点击变色
    private int selectedPosition = -1;// 选中的位置

    /**
     * 构造方法
     * @param context
     * @param data 列表展现的数据
     * @param resource 单行的布局
     * @param from Map中的key
     * @param to view的id
     */
    public ListRiskAreaListsDemoAdapter(PageRiskActivity context, List<? extends Map<String, ?>> data,
                                        int resource, String[] from, int[] to){
        mContext = context;
        mData = data;
        mResource = resource;
        mFrom = from;
        mTo = to;
    }

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

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

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

    //点击变色
    public void setSelectedPosition(int position) {
        selectedPosition = position;
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent){
        final ListRiskAreaListsDemoAdapter.ViewHolder holder;
        if(convertView == null){
            //使用自定义的list_items作为Layout
            convertView = LayoutInflater.from(mContext).inflate(mResource, parent, false);
            //使用减少findView的次数
            holder = new ListRiskAreaListsDemoAdapter.ViewHolder();
            holder.tvAreaItem = ((TextView) convertView.findViewById(mTo[0]));
            holder.tvAreaNo = ((TextView) convertView.findViewById(mTo[1]));

            //设置标记
            convertView.setTag(holder);
        }else{
            holder = (ListRiskAreaListsDemoAdapter.ViewHolder) convertView.getTag();
        }
        //设置数据
        final Map<String, ?> dataSet = mData.get(position);
        if (dataSet == null) {
            return null;
        }
        //获取该行数据
        final Object tvAreaItem = dataSet.get(mFrom[0]);
        final Object tvAreaNo = dataSet.get(mFrom[1]);

        holder.tvAreaItem.setText(tvAreaItem.toString());
        holder.tvAreaNo.setText(tvAreaNo.toString());

        return convertView;
    }

    /**
     * ViewHolder类
     */
    static class ViewHolder {
        TextView tvAreaItem;//区域名
        TextView tvAreaNo;//No
    }

}

完。

补充:解决5.0以下版本,点击外部PopupWindow菜单不消失的问题

需要在显示方式前加这两行代码

//解决5.0以下版本点击外部不消失问题
mPopWindow.setOutsideTouchable(true);
mPopWindow.setBackgroundDrawable(new BitmapDrawable());

补充:解决7.0版本PopupWindow.showAsDropDown不起作用

新建Solve7PopupWindow类

import android.graphics.Rect;
import android.os.Build;
import android.view.View;
import android.widget.PopupWindow;

/**
 * author:lmx
 * date:2018/3/27
 * description:解决在Android 7.0上PopupWindow.showAsDropDown不起作用
 */
public class Solve7PopupWindow extends PopupWindow {

    public Solve7PopupWindow(View mMenuView, int matchParent, int matchParent1) {
        super(mMenuView, matchParent,matchParent1);
    }

    @Override
    public void showAsDropDown(View anchor) {
        if (Build.VERSION.SDK_INT == 24) {
            Rect rect = new Rect();
            anchor.getGlobalVisibleRect(rect);
            int h = anchor.getResources().getDisplayMetrics().heightPixels - rect.bottom;
            setHeight(h);
        }
        super.showAsDropDown(anchor);
    }
}

在PageRiskActivity中使用如下:
将原来的

mPopWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, true);

替换为:

//适配7.0版本
mPopWindow = new Solve7PopupWindow(contentView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);

更新后的PageRiskActivity.java

import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.ab.activity.AbActivity;
import com.ab.util.AbDialogUtil;
import com.ab.view.titlebar.AbTitleBar;
import com.andbase.R;
import com.andbase.global.MyApplication;
import com.andbase.patrol.gtDemo.adapter.pagesAdapter.newPagesAdapter.ListRiskAreaListsDemoAdapter;
import com.andbase.patrol.gtDemo.adapter.pagesAdapter.newPagesAdapter.ListRiskGradeListsDemoAdapter;
import com.andbase.patrol.gtDemo.adapter.pagesAdapter.newPagesAdapter.ListRiskLevelListsDemoAdapter;
import com.andbase.patrol.gtDemo.adapter.pagesAdapter.newPagesAdapter.ListRiskSortListsDemoAdapter;
import com.andbase.patrol.gtDemo.adapter.pagesAdapter.newPagesAdapter.PageRiskAdapter;
import com.andbase.patrol.gtDemo.model.PageRiskFormDemo;
import com.andbase.patrol.gtDemo.util.Solve7PopupWindow;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * author:lmx
 * date:2018/3/6
 * description:风险清单--PopupWindow菜单、列表
 * 注意:PopupWindow菜单Android5.0以下版本点击外部不消失问题
 *      在Android 7.0上PopupWindow.showAsDropDown不起作用问题
 */
public class PageRiskActivity extends AbActivity implements View.OnClickListener{

    private MyApplication application;
    //加载不同布局
    private PageRiskActivity context;
    private ListView listview;
    public List<PageRiskFormDemo> listInfo = null;
    //实例
    private LinearLayout llPopBox;
    private TextView tvRiskArea,tvRiskSort,tvRiskLevel,tvRiskGrade;
    //菜单显示PopupWindow
    private PopupWindow mPopWindow;
    private List<Map<String, Object>> riskAreaList = null;
    private List<Map<String, Object>> riskSortList = null;
    private List<Map<String, Object>> riskLevelList = null;
    private List<Map<String, Object>> riskGradeList = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setAbContentView(R.layout.newpages_activity_risk_demo);
        AbTitleBar mAbTitleBar = this.getTitleBar();
        mAbTitleBar.setTitleText("风险清单");
        mAbTitleBar.setLogo(R.drawable.button_selector_back);
        mAbTitleBar.setTitleBarBackground(R.drawable.top_bg);
        mAbTitleBar.setTitleTextMargin(10, 0, 0, 0);
        mAbTitleBar.setLogoLine(R.drawable.line);
        this.setTitleBarOverlay(true);
        application = (MyApplication)abApplication;
        //加载不同布局
        this.listview = (ListView) findViewById(R.id.lvRisk);
        context = this;
        //获取实例--页头菜单
        llPopBox = (LinearLayout)findViewById(R.id.llPopBox);
        tvRiskArea = (TextView)findViewById(R.id.tvRiskArea);
        tvRiskSort = (TextView)findViewById(R.id.tvRiskSort);
        tvRiskLevel = (TextView)findViewById(R.id.tvRiskLevel);
        tvRiskGrade = (TextView)findViewById(R.id.tvRiskGrade);
        //绑定点击事件
        tvRiskArea.setOnClickListener(this);
        tvRiskSort.setOnClickListener(this);
        tvRiskLevel.setOnClickListener(this);
        tvRiskGrade.setOnClickListener(this);

        //加载数据
        loadListView();
    }

    /**
     * 加载listView数据
     */
    public void loadListView(){
        try {
            listInfo = new ArrayList<PageRiskFormDemo>();

            PageRiskFormDemo form1 = new PageRiskFormDemo();
            form1.setPropertyType(0);//数值
            form1.setRiskName("风险点名称1");
            form1.setFirstRisk("一类风险点");
            form1.setaRisk("A级风险点");
            form1.setRiskControl("风险分级管控");
            listInfo.add(form1);

            PageRiskFormDemo form2 = new PageRiskFormDemo();
            form2.setPropertyType(0);
            form2.setRiskName("风险点名称2");
            form2.setFirstRisk("一类风险点");
            form2.setaRisk("A级风险点");
            form2.setRiskControl("风险分级管控");
            listInfo.add(form2);

            PageRiskFormDemo form3 = new PageRiskFormDemo();
            form3.setPropertyType(0);
            form3.setRiskName("风险点名称3");
            form3.setFirstRisk("一类风险点");
            form3.setaRisk("A级风险点");
            form3.setRiskControl("风险分级管控");
            listInfo.add(form3);

            PageRiskFormDemo form4 = new PageRiskFormDemo();
            form4.setPropertyType(0);
            form4.setRiskName("风险点名称4");
            form4.setFirstRisk("一类风险点");
            form4.setaRisk("A级风险点");
            form4.setRiskControl("风险分级管控");
            listInfo.add(form4);

            PageRiskFormDemo form5 = new PageRiskFormDemo();
            form5.setPropertyType(0);
            form5.setRiskName("风险点名称5");
            form5.setFirstRisk("一类风险点");
            form5.setaRisk("A级风险点");
            form5.setRiskControl("风险分级管控");
            listInfo.add(form5);

            PageRiskFormDemo form6 = new PageRiskFormDemo();
            form6.setPropertyType(0);
            form6.setRiskName("风险点名称6");
            form6.setFirstRisk("一类风险点");
            form6.setaRisk("A级风险点");
            form6.setRiskControl("风险分级管控");
            listInfo.add(form6);

        }catch(Exception ex)
        {
            Log.e("JSON Error: ", ex.toString());
        }

        ListView listView = (ListView) findViewById(R.id.lvRisk);
        PageRiskAdapter pageRiskAdapter = new PageRiskAdapter(context,listInfo);
        listView.setAdapter(pageRiskAdapter);
    }

    //菜单绑定点击事件
    @Override
    public void onClick(View v) {
        int id = v.getId();
        switch (id){
            case R.id.tvRiskArea:
                showRiskAreaPopupWindow();
            break;
            case R.id.tvRiskSort:
                showRiskSortPopupWindow();
            break;
            case R.id.tvRiskLevel:
                showRiskLevelPopupWindow();
            break;
            case R.id.tvRiskGrade:
                showRiskGradePopupWindow();
            break;
        }
    }
    //PopupWindow菜单详细内容显示
    //区域
    private void showRiskAreaPopupWindow() {
        //设置contentView
        View contentView = LayoutInflater.from(PageRiskActivity.this).inflate(R.layout.newpages_activity_risk_area_popup_demo, null);
        //适配7.0版本
        mPopWindow = new Solve7PopupWindow(contentView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
//        mPopWindow = new PopupWindow(contentView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, true);
        mPopWindow.setContentView(contentView);
        //获取实例,设置各个控件的点击响应
        //注意:PopupWindow中各个控件的所在的布局是contentView,而不是在Activity中,所以,要在findViewById(R.id.tv)前指定根布局
        CheckBox cbAllArea = (CheckBox)contentView.findViewById(R.id.cbAllArea);
        TextView tvAllArea = (TextView)contentView.findViewById(R.id.tvAllArea);
        ListView lvRiskArea = (ListView)contentView.findViewById(R.id.lvRiskArea);
        //区域列表加载
        riskAreaList = new ArrayList<Map<String, Object>>();
        Map<String,Object> map = new HashMap<String,Object>();
        for(int i=1; i<10; i++)
        {
            map = new HashMap<String, Object>();
            map.put("tvAreaItem", "区域" + i);
            map.put("tvAreaNo", i+5);
            riskAreaList.add(map);
        }
        ListRiskAreaListsDemoAdapter listRiskAreaListsDemoAdapter = new ListRiskAreaListsDemoAdapter(PageRiskActivity.this, riskAreaList,
                R.layout.newpages_risk_area_popup_list_item_demo, new String[] { "tvAreaItem","tvAreaNo"}, new int[] { R.id.tvAreaItem,R.id.tvAreaNo});
        lvRiskArea.setAdapter(listRiskAreaListsDemoAdapter);

        tvAllArea.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                AbDialogUtil.showAlertDialog(PageRiskActivity.this,"直接绑定点击事件");
                mPopWindow.dismiss();
            }
        });

        //解决5.0以下版本点击外部不消失问题
        mPopWindow.setOutsideTouchable(true);
        mPopWindow.setBackgroundDrawable(new BitmapDrawable());
        //显示方式
        mPopWindow.showAsDropDown(tvRiskArea);

//        if (Build.VERSION.SDK_INT < 24) {
////            dropListPopupWindow.showAsDropDown(this, 0, 5);
//            mPopWindow.showAsDropDown(tvRiskArea);
//        } else {
//            // 适配 android 7.0
//            mPopWindow = new Solve7PopupWindow(contentView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
//            mPopWindow.showAsDropDown(tvRiskArea);
//        }

    }


    //类别
    private void showRiskSortPopupWindow() {
        //设置contentView
        View contentView = LayoutInflater.from(PageRiskActivity.this).inflate(R.layout.newpages_activity_risk_sort_popup_demo, null);
        //适配7.0版本
        mPopWindow = new Solve7PopupWindow(contentView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
//        mPopWindow = new PopupWindow(contentView,
//                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, true);
        mPopWindow.setContentView(contentView);

        //获取实例,设置各个控件的点击响应
        //注意:PopupWindow中各个控件的所在的布局是contentView,而不是在Activity中,所以,要在findViewById(R.id.tv)前指定根布局
        CheckBox cbAllSort = (CheckBox)contentView.findViewById(R.id.cbAllSort);
        ListView lvRiskSort = (ListView)contentView.findViewById(R.id.lvRiskSort);
        //类别列表加载
        riskSortList = new ArrayList<Map<String, Object>>();
        Map<String,Object> map = new HashMap<String,Object>();
        for(int i=1; i<4; i++)
        {
            map = new HashMap<String, Object>();
            switch (i){
                case 1:
                    map.put("tvSortItem", "一类");
                    riskSortList.add(map);
                    break;
                case 2:
                    map.put("tvSortItem", "二类");
                    riskSortList.add(map);
                    break;
                case 3:
                    map.put("tvSortItem", "三类");
                    riskSortList.add(map);
                    break;
            }
//            map.put("tvSortItem", i + "类");
//            riskSortList.add(map);
        }
        ListRiskSortListsDemoAdapter listRiskSortListsDemoAdapter = new ListRiskSortListsDemoAdapter(PageRiskActivity.this, riskSortList,
                R.layout.newpages_risk_sort_popup_list_item_demo, new String[] { "tvSortItem"}, new int[] { R.id.tvSortItem});
        lvRiskSort.setAdapter(listRiskSortListsDemoAdapter);

        //解决5.0以下版本点击外部不消失问题
        mPopWindow.setOutsideTouchable(true);
        mPopWindow.setBackgroundDrawable(new BitmapDrawable());
        //显示方式
        mPopWindow.showAsDropDown(tvRiskSort);
    }
    //等级
    private void showRiskLevelPopupWindow() {
        //设置contentView
        View contentView = LayoutInflater.from(PageRiskActivity.this).inflate(R.layout.newpages_activity_risk_level_popup_demo, null);
        //适配7.0版本
        mPopWindow = new Solve7PopupWindow(contentView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
//        mPopWindow = new PopupWindow(contentView,
//                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, true);
        mPopWindow.setContentView(contentView);

        //获取实例,设置各个控件的点击响应
        //注意:PopupWindow中各个控件的所在的布局是contentView,而不是在Activity中,所以,要在findViewById(R.id.tv)前指定根布局
        CheckBox cbAllLevel = (CheckBox)contentView.findViewById(R.id.cbAllLevel);
        ListView lvRiskLevel = (ListView)contentView.findViewById(R.id.lvRiskLevel);
        //等级列表加载
        riskLevelList = new ArrayList<Map<String, Object>>();
        Map<String,Object> map = new HashMap<String,Object>();
        for(int i=1; i<4; i++)
        {
            map = new HashMap<String, Object>();
            switch (i){
                case 1:
                    map.put("tvLevelItem", "A级");
                    riskLevelList.add(map);
                    break;
                case 2:
                    map.put("tvLevelItem", "B级");
                    riskLevelList.add(map);
                    break;
                case 3:
                    map.put("tvLevelItem", "C级");
                    riskLevelList.add(map);
                    break;
            }

//            map.put("tvLevelItem", i + "级");
//            riskLevelList.add(map);
        }
        ListRiskLevelListsDemoAdapter listRiskLevelListsDemoAdapter = new ListRiskLevelListsDemoAdapter(PageRiskActivity.this, riskLevelList,
                R.layout.newpages_risk_level_popup_list_item_demo, new String[] { "tvLevelItem"}, new int[] { R.id.tvLevelItem});
        lvRiskLevel.setAdapter(listRiskLevelListsDemoAdapter);

        //解决5.0以下版本点击外部不消失问题
        mPopWindow.setOutsideTouchable(true);
        mPopWindow.setBackgroundDrawable(new BitmapDrawable());
        //显示方式
        mPopWindow.showAsDropDown(tvRiskLevel);
    }
    //来源
    private void showRiskGradePopupWindow() {
        //设置contentView
        View contentView = LayoutInflater.from(PageRiskActivity.this).inflate(R.layout.newpages_activity_risk_grade_popup_demo, null);
        //适配7.0版本
        mPopWindow = new Solve7PopupWindow(contentView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
//        mPopWindow = new PopupWindow(contentView,
//                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, true);
        mPopWindow.setContentView(contentView);

        //获取实例,设置各个控件的点击响应
        //注意:PopupWindow中各个控件的所在的布局是contentView,而不是在Activity中,所以,要在findViewById(R.id.tv)前指定根布局
        CheckBox cbAllGrade = (CheckBox)contentView.findViewById(R.id.cbAllGrade);
        ListView lvRiskGrade = (ListView)contentView.findViewById(R.id.lvRiskGrade);
        //来源列表加载
        riskGradeList = new ArrayList<Map<String, Object>>();
        Map<String,Object> map = new HashMap<String,Object>();
        for(int i=1; i<5; i++)
        {
            map = new HashMap<String, Object>();
            switch (i){
               case 1:
                   map.put("tvGradeItem", "风险分级管控系统");
                   riskGradeList.add(map);
                   break;
               case 2:
                   map.put("tvGradeItem", "巡检管理系统");
                   riskGradeList.add(map);
                   break;
               case 3:
                   map.put("tvGradeItem", "作业管理系统");
                   riskGradeList.add(map);
                   break;
               case 4:
                   map.put("tvGradeItem", "综合安全管理系统");
                   riskGradeList.add(map);
                   break;
            }
//            map.put("tvGradeItem", i + "系统");
//            riskGradeList.add(map);
        }
        ListRiskGradeListsDemoAdapter listRiskGradeListsDemoAdapter = new ListRiskGradeListsDemoAdapter(PageRiskActivity.this, riskGradeList,
                R.layout.newpages_risk_grade_popup_list_item_demo, new String[] { "tvGradeItem"}, new int[] { R.id.tvGradeItem});
        lvRiskGrade.setAdapter(listRiskGradeListsDemoAdapter);

        //解决5.0以下版本点击外部不消失问题
        mPopWindow.setOutsideTouchable(true);
        mPopWindow.setBackgroundDrawable(new BitmapDrawable());
        //显示方式
        mPopWindow.showAsDropDown(tvRiskGrade);
    }
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,684评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 87,143评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,214评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,788评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,796评论 5 368
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,665评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,027评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,679评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 41,346评论 1 299
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,664评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,766评论 1 331
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,412评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,015评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,974评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,203评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,073评论 2 350
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,501评论 2 343

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 171,444评论 25 707
  • 迎着风 深深的掩埋曾经的我 叹息总是挽不回心 那过去我要把它撕成碎片 回忆 深深刻刻丢在心的夹层里 有太多的想念在...
  • 我从来都想做一个英雄,可惜我不是。为什么我做不了英雄?因为想做英雄的人很多,我竞争不过他们。我不是不努力,而是我不...
    邵子初阅读 3,904评论 0 1
  • 项目管理涉及人和资源的协调,异常情况下的处理 1、人和资源的记录2、每日不管是项目进展如何都需要向上一级汇报进度3...
    simplehu阅读 220评论 0 0
  • 学校放寒假了,每年我跟爸爸妈妈都要回老家兴宁过年。广东省梅州兴宁市是客家人聚居地。正月的春节期间有一个独特的节...
    琳宝珠阅读 440评论 0 0