当前位置: 首页 > news >正文

下沙做网站软件设计网站公司选泽y湖南岚鸿询 问

下沙做网站软件,设计网站公司选泽y湖南岚鸿询 问,有什么知名网站是用织梦做的,苏州的网站建设1、实现方法1 仿微信盆友圈弹出点赞、评论 demo连接#xff1a;android开发PopupWindow实现跟随试弹出框-Android文档类资源-CSDN下载 实现步骤 1、下载module并引入项目 引入module步骤#xff1a;Android studio 导入module方法…1、实现方法1                                        仿微信盆友圈弹出点赞、评论 demo连接android开发PopupWindow实现跟随试弹出框-Android文档类资源-CSDN下载 实现步骤 1、下载module并引入项目 引入module步骤Android studio 导入module方法_meixi_android的博客-CSDN博客_as怎么导入module 2、实现方法2 1、封装弹出窗类 /*** 作者created by meixi* 邮箱13164716840163.com* 日期2018/10/26 15*/public abstract class CommonPopupWindow {protected Context context;protected View contentView;protected PopupWindow mInstance;public CommonPopupWindow(Context c, int layoutRes, int w, int h) {contextc;contentView LayoutInflater.from(c).inflate(layoutRes, null, false);initView();initEvent();mInstancenew PopupWindow(contentView, w, h, true);initWindow();}public View getContentView() { return contentView; }public PopupWindow getPopupWindow() { return mInstance; }protected abstract void initView();protected abstract void initEvent();protected void initWindow() {mInstance.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));mInstance.setOutsideTouchable(true); // mInstance.setTouchable(true);}public void showBashOfAnchor(View anchor, LayoutGravity layoutGravity, int xmerge, int ymerge) {int[] offsetlayoutGravity.getOffset(anchor, mInstance);mInstance.showAsDropDown(anchor, offset[0]xmerge, offset[1]ymerge);}public void showAsDropDown(View anchor, int xoff, int yoff) {mInstance.showAsDropDown(anchor, xoff, yoff);}public void showAtLocation(View parent, int gravity, int x, int y) {mInstance.showAtLocation(parent, gravity, x, y);}public static class LayoutGravity {private int layoutGravity;// waring, dont change the order of these constants!public static final int ALIGN_LEFT0x1;public static final int ALIGN_ABOVE0x2;public static final int ALIGN_RIGHT0x4;public static final int ALIGN_BOTTOM0x8;public static final int TO_LEFT0x10;public static final int TO_ABOVE0x20;public static final int TO_RIGHT0x40;public static final int TO_BOTTOM0x80;public static final int CENTER_HORI0x100;public static final int CENTER_VERT0x200;public LayoutGravity(int gravity) {layoutGravitygravity;}public int getLayoutGravity() { return layoutGravity; }public void setLayoutGravity(int gravity) { layoutGravitygravity; }public void setHoriGravity(int gravity) {layoutGravity(0x20x80x200x800x200);layoutGravity|gravity;}public void setVertGravity(int gravity) {layoutGravity(0x10x40x100x400x100);layoutGravity|gravity;}public boolean isParamFit(int param) {return (layoutGravity param) 0;}public int getHoriParam() {for(int i0x1; i0x100; ii2)if(isParamFit(i))return i;return ALIGN_LEFT;}public int getVertParam() {for(int i0x2; i0x200; ii2)if(isParamFit(i))return i;return TO_BOTTOM;}public int[] getOffset(View anchor, PopupWindow window) {int anchWidthanchor.getWidth();int anchHeightanchor.getHeight();int winWidthwindow.getWidth();int winHeightwindow.getHeight();View viewwindow.getContentView();if(winWidth0)winWidthview.getWidth();if(winHeight0)winHeightview.getHeight();int xoff0;int yoff0;switch (getHoriParam()) {case ALIGN_LEFT:xoff0; break;case ALIGN_RIGHT:xoffanchWidth-winWidth; break;case TO_LEFT:xoff-winWidth; break;case TO_RIGHT:xoffanchWidth; break;case CENTER_HORI:xoff(anchWidth-winWidth)/2; break;default:break;}switch (getVertParam()) {case ALIGN_ABOVE:yoff-anchHeight; break;case ALIGN_BOTTOM:yoff-winHeight; break;case TO_ABOVE:yoff-anchHeight-winHeight; break;case TO_BOTTOM:yoff0; break;case CENTER_VERT:yoff(-winHeight-anchHeight)/2; break;default:break;}return new int[]{ xoff, yoff };}} }外部不可点击 mInstance.setOutsideTouchable(false); mInstance.setFocusable(false); 2、activity调用代码 1下拉式弹出 private CommonPopupWindow.LayoutGravity layoutGravity;private CommonPopupWindow window;private View activityPopup; activityPopupfindViewById(R.id.activity_popup); textView.setOnClickListener(new View.OnClickListener() {Overridepublic void onClick(View view) {PopupWindow winwindow.getPopupWindow();win.setAnimationStyle(R.style.animTranslate);//动画效果window.showBashOfAnchor(textView, layoutGravity, 0, 0);//跟随式弹出 // window.showAtLocation(activityPopup, Gravity.BOTTOM, 0, 0);//底部弹出WindowManager.LayoutParams lpgetWindow().getAttributes();lp.alpha0.3f;getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);getWindow().setAttributes(lp);}}); 下拉式实例化 private void initPopup2(){layoutGravitynew CommonPopupWindow.LayoutGravity(CommonPopupWindow.LayoutGravity.CENTER_HORI| CommonPopupWindow.LayoutGravity.TO_BOTTOM);DisplayMetrics dm new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(dm);int nMultiple dm.widthPixels;//宽windownew CommonPopupWindow(this, R.layout.mypopup, (int) (nMultiple*0.4), ViewGroup.LayoutParams.WRAP_CONTENT) {Overrideprotected void initView() {View viewgetContentView();linearLayout (LinearLayout)view.findViewById(R.id.oneli);}Overrideprotected void initEvent() {linearLayout.setOnClickListener(new View.OnClickListener() {Overridepublic void onClick(View view) {Toast.makeText(MainActivity.this,ssssblue,Toast.LENGTH_SHORT).show();}});}Overrideprotected void initWindow() {super.initWindow();PopupWindow instancegetPopupWindow();instance.setOnDismissListener(new PopupWindow.OnDismissListener() {Overridepublic void onDismiss() {WindowManager.LayoutParams lpgetWindow().getAttributes();lp.alpha1.0f;getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);getWindow().setAttributes(lp);}});}}; } 2底部弹出 private void initPopupWindow() {DisplayMetrics dm new DisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(dm);int nMultiple dm.widthPixels;//宽// windownew CommonPopupWindow(this, R.layout.mypopup, ViewGroup.LayoutParams.MATCH_PARENT, (int) (screenHeight*0.7)) {windownew CommonPopupWindow(this, R.layout.mypopup, (int) (nMultiple*0.9), ViewGroup.LayoutParams.WRAP_CONTENT) {Overrideprotected void initView() {View viewgetContentView();linearLayout (LinearLayout)view.findViewById(R.id.oneli);}Overrideprotected void initEvent() {linearLayout.setOnClickListener(new View.OnClickListener() {Overridepublic void onClick(View view) {Toast.makeText(MainActivity.this,ssssblue,Toast.LENGTH_SHORT).show();}});}Overrideprotected void initWindow() {super.initWindow();PopupWindow instancegetPopupWindow();instance.setOnDismissListener(new PopupWindow.OnDismissListener() {Overridepublic void onDismiss() {WindowManager.LayoutParams lpgetWindow().getAttributes();lp.alpha1.0f;getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);getWindow().setAttributes(lp);}});}};} window.getPopupWindow().dismiss();//隐藏 demo链接PopupWindow实现demo-Android代码类资源-CSDN下载 下拉式弹出窗                                              全屏底部弹出窗
http://www.zqtcl.cn/news/308661/

相关文章:

  • vue网站开发注意事项做设计想接外单去哪个网站好
  • 免费模板下载网站推荐苏州seo
  • 徐州市水利工程建设有限公司网站网站建设技术团队有多重要性
  • 合肥佰瑞网站搜索引擎优化步骤
  • 营销型网站建设亏1广西桂林天气预报15天
  • 想做一个网站平台怎么做公司网站建设费用估计
  • 电商网站开发平台pi netwo网页设计文件下载
  • 南平网站设计笔记本怎么建设网站
  • 舆情分析网站免费人工智能培训班收费标准
  • 青岛网站建设 大公司制作相册视频
  • 什么是网站的域名jquery素材网站
  • 课程网站建设ppt模板百度seo推广
  • 网站建设需要用到什么怎么在电脑上用手机app软件
  • 公司做网站有意义么网站认证必须做么
  • 网站虚拟空间更新缓存php外贸网站建设
  • 河南省建设执业资格注册中心网站门户定制网站建设公司
  • 网站开发比较厉害wordpress中文 插件
  • 文化投资的微网站怎么做个人微信公众号如何推广
  • 单位的网站怎样设计才美观网页设计图片的代码
  • 长沙专业做网站排名济南手机网站定制费用
  • 西安专题门户响应式网站建设系统网站有哪些
  • 山东省建设局网站监理员考试asp.net mvc6电商网站开发实践
  • 做网站需要提供什么资料网站备案是什么意思
  • 河南网站建设及推广东莞百度代做网站联系方式
  • 大型企业网站制作浦东新区做网站
  • 简单大气网站源码织梦怎么用框架实现在浏览器的地址栏只显示网站的域名而不显示出文件名
  • 电子商务型网站建设线上推广营销策划
  • 网站建设管理工作情况的通报网站开发vs设计报告
  • 嘉定网站网站建设公司官网制作
  • 做旅游广告在哪个网站做效果好财经网站建设