{"id":13642052,"url":"https://github.com/minetsh/PopupMenuView","last_synced_at":"2025-04-20T15:34:36.297Z","repository":{"id":37335385,"uuid":"74450650","full_name":"minetsh/PopupMenuView","owner":"minetsh","description":"A view just like UIMenuController of iOS, 一个类似iOS中弹框气泡菜单的控件","archived":false,"fork":false,"pushed_at":"2019-06-17T11:18:57.000Z","size":1364,"stargazers_count":425,"open_issues_count":7,"forks_count":82,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-08-04T00:05:42.296Z","etag":null,"topics":["android"],"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/minetsh.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}},"created_at":"2016-11-22T08:26:07.000Z","updated_at":"2024-08-04T00:05:42.297Z","dependencies_parsed_at":"2022-08-18T03:55:54.752Z","dependency_job_id":null,"html_url":"https://github.com/minetsh/PopupMenuView","commit_stats":null,"previous_names":["kareluo/popupmenuview"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minetsh%2FPopupMenuView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minetsh%2FPopupMenuView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minetsh%2FPopupMenuView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minetsh%2FPopupMenuView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minetsh","download_url":"https://codeload.github.com/minetsh/PopupMenuView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223832778,"owners_count":17210707,"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":["android"],"created_at":"2024-08-02T01:01:26.876Z","updated_at":"2024-11-09T13:30:18.028Z","avatar_url":"https://github.com/minetsh.png","language":"Java","readme":"# PopupMenuView\n此库主要实现了一个类似iOS中的`UIMenuController`控件的Popup控件。\n主要控件如下：\n\n- `PopLayout`继承自`FrameLayout`，用于实现控件的气泡化。\n- `OptionMenuView`继承自`LinearLayout`，用于实现Menu控件。\n- `PopupView`继承自`PopupWindow`，用于实现控件的指定方位弹出效果。\n- `PopupMenuView`是上述三者的集合，实现了弹出气泡菜单的功能。\n\n![预览图片](/screenshot/preview_image.png)\n\n# Demo\n安装 [apk](https://www.pgyer.com/menu) 文件预览效果，或者通过下面二维码去下载安装：\n\n![DEMO下载二维码](/screenshot/code.png)\n\n# Usage\n\nUse Gradle:\n``` java\ncompile 'me.kareluo.ui:popmenu:1.1.0'\n```\n\nOr Maven:\n``` maven\n\u003cdependency\u003e\n  \u003cgroupId\u003eme.kareluo.ui\u003c/groupId\u003e\n  \u003cartifactId\u003epopmenu\u003c/artifactId\u003e\n  \u003cversion\u003e1.1.0\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\n# Sample\n\n`PopupMenuView`可以通过menu布局文件加载出预先准备的菜单：\n\n``` java\n// 根据menu资源文件创建\nPopupMenuView menuView = new PopupMenuView(this, R.menu.menu_pop, new MenuBuilder(context));\n\n// 设置点击监听事件\nmenuView.setOnMenuClickListener(new OptionMenuView.OnOptionMenuClickListener() {\n    @Override\n    public boolean onOptionMenuClick(int position, OptionMenu menu) {\n        Toast.makeText(this, menu.getTitle(), Toast.LENGTH_SHORT).show();\n        return true;\n    }\n});\n\n// 显示在mButtom控件的周围\nmenuView.show(mButtom);\n```\n\n或者通过代码添加:\n\n``` java\nmenuView.setMenuItems(Arrays.asList(\n    new OptionMenu(\"复制\"), new OptionMenu(\"转发到朋友圈\"),\n    new OptionMenu(\"收藏\"), new OptionMenu(\"翻译\"),\n    new OptionMenu(\"删除\")));\n```\n\n默认的显示方位为：上、下、左、右，即按照这种顺序测试界面是否可以显示下菜单，可以如下方式自定义：\n\n``` java\nmenuView.setSites(PopupView.SITE_BOTTOM, PopupView.SITE_LEFT, PopupView.SITE_TOP, PopupView.SITE_RIGHT);\n```\n\n# Update Logs\n\n#### v1.0.0\n- 弹出菜单`PopupMenuView`\n- 气泡布局\n- 菜单控件\n\n#### v1.0.1\n- 移除support库引用，加载menu资源文件方法变动\n\n#### v1.0.2\n- 增加气泡布局资源属性offsetSize，并修改部分资源属性名称\n\n#### v1.0.3\n- 修改了module的名称，之前版本为`library`，后续版本为`popmenu`\n\n#### v1.0.4\n- 修复菜单条目变化时无法显示BUG\n\n#### v1.0.5\n- 增加自定义样式接口\n\n#### v1.1.0\n- 默认样式微调\n- 菜单项过多时可滚动视图\n\n# License\n``` license\nCopyright 2016 kareluo.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```","funding_links":[],"categories":["菜单(Menu)"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminetsh%2FPopupMenuView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminetsh%2FPopupMenuView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminetsh%2FPopupMenuView/lists"}