EpointGridPopView.java package com.epoint.showcase.frgs;import android.os.Bundle;import android.view.View;import android.widget.Toast;import com.epoint.frame.R;import com.epoint.frame.actys.SMPBaseFragment;import com.epoint.frame.core.contr
package com.epoint.showcase.frgs; import android.os.Bundle; import android.view.View; import android.widget.Toast; import com.epoint.frame.R; import com.epoint.frame.actys.SMPBaseFragment; import com.epoint.frame.core.controls.EpointGridPopView; import com.epoint.frame.core.controls.IconClickListener; /** * 作者: 李林 * 时间: 2017/9/22 14:35 * 版本: [1.0, 2017/9/22] * 版权: 江苏国泰新点软件有限公司 * 描述: 下拉菜单:横方向 */ public class SMPPullMenu2Fragment extends SMPBaseFragment { EpointGridPopView popupWindow; @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); getNbBar().nbRight.setVisibility(View.VISIBLE); getNbBar().nbRight.setImageResource(R.drawable.frm_nav_bulb); getNbBar().nbRight.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (popupWindow == null) { final String[] titles = new String[]{"写邮件", "发公告", "创建日程"}; int[] images = new int[]{R.drawable.moa_email_add_btn, R.drawable.moa_announce_btn, R.drawable.moa_add_schedule_btn}; //菜单显示位置(在该控件下方弹出) View locationView = getNbBar().nbRight; popupWindow = new EpointGridPopView(getActivity(), locationView, titles, images, new IconClickListener() { @Override public void iconClick(int index) { Toast.makeText(getContext(), titles[index], Toast.LENGTH_SHORT).show(); } }); } // 修改图标颜色 // popupWindow.setIconFilterColor(getResources().getColor(R.color.green)); popupWindow.showOrDismiss(); } }); } }