{"id":13642183,"url":"https://github.com/joelan/WeiboPopupMenu","last_synced_at":"2025-04-20T16:30:36.729Z","repository":{"id":86190485,"uuid":"76102812","full_name":"joelan/WeiboPopupMenu","owner":"joelan","description":"模仿新浪微博菜单弹出界面（已停止维护）","archived":false,"fork":false,"pushed_at":"2018-07-25T09:12:49.000Z","size":283,"stargazers_count":74,"open_issues_count":4,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-09T13:37:23.379Z","etag":null,"topics":["addmenu","popup","sina"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joelan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-10T09:22:21.000Z","updated_at":"2023-08-28T06:18:12.000Z","dependencies_parsed_at":"2023-03-13T08:54:52.588Z","dependency_job_id":null,"html_url":"https://github.com/joelan/WeiboPopupMenu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelan%2FWeiboPopupMenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelan%2FWeiboPopupMenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelan%2FWeiboPopupMenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelan%2FWeiboPopupMenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joelan","download_url":"https://codeload.github.com/joelan/WeiboPopupMenu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249925714,"owners_count":21346421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addmenu","popup","sina"],"created_at":"2024-08-02T01:01:28.251Z","updated_at":"2025-04-20T16:30:36.107Z","avatar_url":"https://github.com/joelan.png","language":"Java","funding_links":[],"categories":["浮动菜单"],"sub_categories":[],"readme":"# 仿微博添加按钮弹出菜单\n[ ![Download](https://api.bintray.com/packages/joelan/maven/WeiboPopupMenu/images/download.svg) ](https://bintray.com/joelan/maven/WeiboPopupMenu/_latestVersion)\n\n![image](https://github.com/joelan/WeiboPopupMenu/raw/master/screenshoot/Screenshot_2016-12-10-20-00-44-686_com.example.ad.png)\n![image](https://github.com/joelan/WeiboPopupMenu/raw/master/screenshoot/Screenshot_2016-12-10-20-00-50-299_com.example.ad.png)\n\n## 版本更新须知（1.0.5）\n增加MenuItem的获取，预设的的个别几项属性设置settter和getter\n## 版本更新(1.0.7)\n增加菜单被关闭监听\n\n## 1.依赖\n### 依赖库分发在Jcenter。\n```groovy\n\ndependencies {\ncompile 'com.lrq.menu:addpopmenu:latestVersion'\n}\n\n```\n## 2.使用\n在对应要弹出的按钮事件上加上这段代码\n```java\n\n    mPopMenu = new PopMenu.Builder().attachToActivity(MainActivity.this)\n                .addMenuItem(new PopMenuItem(\"广场\", getResources().getDrawable(R.drawable.tabbar_compose_idea)))\n                .addMenuItem(new PopMenuItem(\"私密\", getResources().getDrawable(R.drawable.tabbar_compose_photo)))\n                .addMenuItem(new PopMenuItem(\"家庭圈\", getResources().getDrawable(R.drawable.tabbar_compose_headlines)))\n\n                .setOnItemClickListener(new PopMenuItemListener() {\n                    @Override\n                    public void onItemClick(PopMenu popMenu, int position) {\n\n\n                        Toast.makeText(MainActivity.this, \"你点击了第\" + position + \"个位置\", Toast.LENGTH_SHORT).show();\n\n\n                    }\n                })\n                .build();\n       mPopMenu.show();         \n                \n```\n## 3.自定义\n\n### （1）在PopMenu以下属性的set方法都可以自定义相对应的自定义功能（调用.build()后调用,show（）调用之前）\n\n```java\n   /**\n     * 关闭按钮距离屏幕底部位置单位dp\n     */\n   private int mCloseMenuMarginbottom=15;\n\n    /**\n     * 背景颜色\n     */\n    private int mBackGroundColor=Color.parseColor(\"#f0f3f3f3\");\n\n    /**\n     * 关闭按钮的图片\n     */\n    private int mCloseButtomResourceid=R.drawable.tabbar_compose_background_icon_close;\n\n    /**\n     * Menu相对于屏幕顶部的距离的的倍数因子（屏幕高度减去菜单本身高度剩下部分除以这个倍数因子）\n     */\n\n    private   float mMarginTopRemainSpace=1.5f;\n\n    /**\n     * 是否错位弹出菜单\n     */\n    private   boolean mIsmalpositionAnimatOut=true;\n\n    /**\n     * 错位动画时间（毫秒）默认50\n     */\n    private   int malposition=50;\n    \n```\n\n### (2)在PopMenu以下属性的set方法都可以自定义相对应的自定义功能（调用.build()前调用）\n\n```java\n    /**\n     * 一行多少列，默认三列\n     *\n     */\n        public Builder columnCount(int count) {\n            this.columnCount = count;\n            return this;\n        }\n\n    /**\n     *添加菜单项\n     *\n     */\n        public Builder addMenuItem(PopMenuItem menuItem) {\n            this.itemList.add(menuItem);\n            return this;\n        }\n    /**\n     * 动画执行时间，默认300毫秒\n     *\n     */\n        public Builder duration(int duration) {\n            this.duration = duration;\n            return this;\n        }\n    /**\n     * 拉力系数，默认10\n     *\n     */\n        public Builder tension(double tension) {\n            this.tension = tension;\n            return this;\n        }\n\n    /**\n     * 摩擦力系数默认5\n     *\n     */\n        public Builder friction(double friction) {\n            this.friction = friction;\n            return this;\n        }\n    /**\n     * item水平之间的间距\n     */\n        public Builder horizontalPadding(int padding) {\n            this.horizontalPadding = padding;\n            return this;\n        }\n    /**\n     * item竖直之间的间距\n     */\n        public Builder verticalPadding(int padding) {\n            this.verticalPadding = padding;\n            return this;\n        }\n    /**\n     * item点击监听器\n     */\n        public Builder setOnItemClickListener(PopMenuItemListener listener) {\n            this.popMenuItemListener = listener;\n            return this;\n        }\n    \n```\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelan%2FWeiboPopupMenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoelan%2FWeiboPopupMenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelan%2FWeiboPopupMenu/lists"}