{"id":28997799,"url":"https://github.com/hqs5678/hqs-common-dialog-android","last_synced_at":"2025-06-25T06:30:30.636Z","repository":{"id":301066238,"uuid":"79632790","full_name":"hqs5678/hqs-common-dialog-android","owner":"hqs5678","description":"a dialog for android","archived":false,"fork":false,"pushed_at":"2017-07-14T08:32:02.000Z","size":1147,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T01:49:38.602Z","etag":null,"topics":["android-dialog","android-dialog-view","dialog","qdialog","qsdialog"],"latest_commit_sha":null,"homepage":null,"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/hqs5678.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-01-21T08:09:07.000Z","updated_at":"2018-09-06T14:42:23.000Z","dependencies_parsed_at":"2025-06-25T01:49:41.025Z","dependency_job_id":"844f65e4-4c66-493d-8196-135d9abc909a","html_url":"https://github.com/hqs5678/hqs-common-dialog-android","commit_stats":null,"previous_names":["hqs5678/hqs-common-dialog-android"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hqs5678/hqs-common-dialog-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqs5678%2Fhqs-common-dialog-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqs5678%2Fhqs-common-dialog-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqs5678%2Fhqs-common-dialog-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqs5678%2Fhqs-common-dialog-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hqs5678","download_url":"https://codeload.github.com/hqs5678/hqs-common-dialog-android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hqs5678%2Fhqs-common-dialog-android/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261818713,"owners_count":23214350,"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-dialog","android-dialog-view","dialog","qdialog","qsdialog"],"created_at":"2025-06-25T06:30:24.773Z","updated_at":"2025-06-25T06:30:30.500Z","avatar_url":"https://github.com/hqs5678.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hqs-dialog\n简单封装对话框, 原理: 在当前activity的root view 中添加自定义view, 添加进入动画和谈出动画.\n\n#### 运行效果\n![运行效果图](https://github.com/hqs5678/hqs-common-dialog-android/blob/master/2017-07-10%2015_10_51.gif)\n\n\n\n### 添加到项目\n\n#### gradle\n\n```\n\ndependencies {\n    compile 'com.hqs.common.view.dialog:qdialog:1.0.20'\n}\n\n```\n\n### 使用说明\n\n\u003e 显示对话框并添加按钮监听\n```\ndialog = QDialog.create(MainActivity.this)\n            .setSingleButtonMode()\n            .setSingleButtonText(\"我知道了\")\n            .show(\"我是来打酱油打酱油的!!!\", new QDialog.OnDialogClickListener() {\n        @Override\n        public void onClickRightButton() {\n            makeToast(\"ok\");\n        }\n\n        @Override\n        public void onClickLeftButton() {\n            makeToast(\"cancel\");\n        }\n\n        @Override\n        public void onCancel() {\n            // 只一个按钮时也会触发onCancel()\n            makeToast(\"onCancel\");\n        }\n    });\n```\n\n#### 设置返回按钮事件\n\n\u003e 在调用者的activity中覆盖onBackPressed(), 例如:\n```\n@Override\npublic void onBackPressed() {\n    if (dialog != null \u0026\u0026 !dialog.onBackPressed()){\n        // do your own things\n        // ...\n        super.onBackPressed();\n    }\n}\n```\n\n\n##### 自定义对话框样式\n\n1. setContentBackgroundColor  设置对话框颜色\n1. setBackgroundColor 设置对话框背景颜色\n1. setDividerHeight  设置分割线高度\n1. setDividerColor 设置分割线颜色\n1. setButtonRippleColor  设置按钮波纹颜色\n1. setLeftButtonText  设置左边按钮的标题\n1. setLeftButtonTextColor  设置左边按钮的字体颜色\n1. setRightButtonText 设置右边按钮的标题\n1. setRightButtonTextColor 设置右边按钮的字体颜色\n1. setSingleButtonMode 设置一个按钮的模式\n1. setSingleButtonText 设置一个按钮时按钮的标题\n1. setSingleButtonTextColor 设置一个按钮时按钮的颜色\n\n###### 详情请查看Demo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhqs5678%2Fhqs-common-dialog-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhqs5678%2Fhqs-common-dialog-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhqs5678%2Fhqs-common-dialog-android/lists"}