{"id":16583206,"url":"https://github.com/jyygithub/koonny-dialog","last_synced_at":"2025-03-21T12:33:06.198Z","repository":{"id":144634860,"uuid":"99698882","full_name":"jyygithub/koonny-dialog","owner":"jyygithub","description":"对DialogFragment进行封装","archived":false,"fork":false,"pushed_at":"2023-11-06T06:59:38.000Z","size":2106,"stargazers_count":55,"open_issues_count":1,"forks_count":11,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2025-03-18T01:40:35.041Z","etag":null,"topics":["android","dialog","dialogfragment"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jyygithub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-08-08T13:57:46.000Z","updated_at":"2023-03-15T05:12:29.000Z","dependencies_parsed_at":"2023-11-06T07:50:53.313Z","dependency_job_id":null,"html_url":"https://github.com/jyygithub/koonny-dialog","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/jyygithub%2Fkoonny-dialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jyygithub%2Fkoonny-dialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jyygithub%2Fkoonny-dialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jyygithub%2Fkoonny-dialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jyygithub","download_url":"https://codeload.github.com/jyygithub/koonny-dialog/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244799589,"owners_count":20512280,"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","dialogfragment"],"created_at":"2024-10-11T22:35:10.132Z","updated_at":"2025-03-21T12:33:05.873Z","avatar_url":"https://github.com/jyygithub.png","language":"Kotlin","readme":"\u003ch2 align=\"center\"\u003e\n  对DialogFragment的封装使用\n\u003c/h2\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jyygithub/koonny-dialog\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/min--sdk-21+-%23A97BFF\" alt=\"minSdk\"\u003e\n    \u003cimg alt=\"Maven Central\" src=\"https://img.shields.io/maven-central/v/jyygithub/koonny-dialog\"\u003e\n    \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/jyygithub/koonny-dialog\"\u003e\n    \u003cimg alt=\"GitHub code size in bytes\" src=\"https://img.shields.io/github/languages/code-size/jyygithub/koonny-dialog\"\u003e\n    \u003cimg alt=\"GitHub top language\" src=\"https://img.shields.io/github/languages/top/jyygithub/koonny-dialog\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Gradle\n\n```groovy\nimplementation 'com.koonny.dialog:dialog:LATEST_VERSION' \n```\n\n## 使用文档\n\n### 内置Dialog\n\n- ConfirmDialog\n\n```kotlin\nConfirmDialog()\n    .title(\"提示\")\n    .message(\"确认退出当前账号？\")\n    .positive(\"Go\") {\n        dismiss()\n    }\n    .negative(\"YES\")\n    .show(supportFragmentManager)\n```\n\n- BottomListDialog\n\n```kotlin\nBottomListDialog\u003cString\u003e()\n    .title(\"提示\")\n    .negative(\"Go\") {\n        setTextColor(Color.RED)\n        setTypeface(null, Typeface.BOLD)\n    }\n    .items(\"Item1\", \"Item2\", \"Item3\") { _, _ -\u003e\n\n    }\n    .show(supportFragmentManager)\n```\n\n```kotlin\nBottomListDialog\u003cUser\u003e()\n    .title(\"提示\")\n    .negative(\"Go\")\n    .bind { user -\u003e user.name }\n    .items(User(\"张三\"), User(\"李四\")) { _, _ -\u003e\n\n    }\n    .show(supportFragmentManager)\n```\n\n- BottomMenuDialog\n\n```kotlin\nBottomMenuDialog()\n    .title(\"提示\")\n    .negative(\"Go\")\n    .items(\"Item1\" to R.mipmap.ic_launcher, \"Item2\" to R.mipmap.ic_launcher, \"Item3\" to R.mipmap.ic_launcher) {\n\n    }\n    .show(supportFragmentManager)\n```\n\n### 自定义Dialog\n\n- 自定义\n\n```kotlin\nclass CustomDialog : BaseDialogFragment(R.layout.dialog_custom) {\n\n    private lateinit var binding: DialogCustomBinding\n\n    override fun config(): DialogConfig {\n        return super.config().apply {\n            width = 0.7f\n            gravity = Gravity.CENTER\n            dismissOnBackPressed = false\n            dismissOnTouchOutside = false\n        }\n    }\n\n    override fun preView(rootView: View) {\n        binding = DialogCustomBinding.bind(rootView)\n    }\n\n    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {\n        super.onViewCreated(view, savedInstanceState)\n        binding.image.load(\"https://s1.ax1x.com/2023/03/01/ppia5Wj.png\")\n        binding.ivClose.setOnClickListener { dismiss() }\n    }\n\n}\n```\n\n- 直接使用\n\n```kotlin\nCustomDialog().show(supportFragmentManager)\n```\n\n## Licenses\n\n```\nCopyright 2023 jyygithub\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":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjyygithub%2Fkoonny-dialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjyygithub%2Fkoonny-dialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjyygithub%2Fkoonny-dialog/lists"}