{"id":16583209,"url":"https://github.com/jyygithub/koonny-appcompat","last_synced_at":"2025-12-02T21:08:26.687Z","repository":{"id":144633644,"uuid":"610076737","full_name":"jyygithub/koonny-appcompat","owner":"jyygithub","description":"Android开发组件封装","archived":false,"fork":false,"pushed_at":"2023-12-19T04:03:01.000Z","size":184,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"canary","last_synced_at":"2025-01-16T12:53:33.879Z","etag":null,"topics":["android","android-library","androidx","app","baseactivity","basefragment","core","toast","viewbinding"],"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":"2023-03-06T03:13:38.000Z","updated_at":"2023-03-10T05:36:13.000Z","dependencies_parsed_at":"2025-01-16T12:46:27.639Z","dependency_job_id":"0af8b3b3-065d-4f8b-8ed7-72f9012a32bc","html_url":"https://github.com/jyygithub/koonny-appcompat","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-appcompat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jyygithub%2Fkoonny-appcompat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jyygithub%2Fkoonny-appcompat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jyygithub%2Fkoonny-appcompat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jyygithub","download_url":"https://codeload.github.com/jyygithub/koonny-appcompat/tar.gz/refs/heads/canary","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242138800,"owners_count":20078007,"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","android-library","androidx","app","baseactivity","basefragment","core","toast","viewbinding"],"created_at":"2024-10-11T22:35:10.245Z","updated_at":"2025-12-02T21:08:21.643Z","avatar_url":"https://github.com/jyygithub.png","language":"Kotlin","readme":"\u003ch2 align=\"center\"\u003e\n  Android通用Core\n\u003c/h2\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jyygithub/koonny-appcompat\" 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-appcompat\"\u003e\n    \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/jyygithub/koonny-appcompat\"\u003e\n    \u003cimg alt=\"GitHub code size in bytes\" src=\"https://img.shields.io/github/languages/code-size/jyygithub/koonny-appcompat\"\u003e\n    \u003cimg alt=\"GitHub top language\" src=\"https://img.shields.io/github/languages/top/jyygithub/koonny-appcompat\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Gradle\n\n```groovy\nimplementation 'com.koonny.appcompat:appcompat:LATEST_VERSION'\n```\n\n## 用法\n\n### BaseActivity/BaseFragment/BaseDialogFragment\n\n```kotlin\nclass MainActivity : BaseActivity\u003cActivityMainBinding\u003e(ActivityMainBinding::inflate) {\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        // TODO\n    }\n\n}\n```\n\n```kotlin\nclass FirstFragment : BaseFragment\u003cActivityMainBinding\u003e(ActivityMainBinding::inflate) {\n\n    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {\n        super.onViewCreated(view, savedInstanceState)\n        // TODO\n    }\n\n}\n```\n\n```kotlin\nclass DoneDialog : BaseDialogFragment\u003cDialogDoneBinding\u003e(DialogDoneBinding::inflate) {\n\n    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {\n        super.onViewCreated(view, savedInstanceState)\n        // TODO\n    }\n\n}\n```\n\n### 点击事件\n\n```kotlin\nclass MainActivity {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        button.click {\n            // 点击间隔3秒\n            // TODO\n        }\n        button.click(200) {\n            // 点击间隔200毫秒\n            // TODO\n        }\n    }\n}\n```\n\n### 日期工具\n\n```kotlin\n// Date、String、Long的格式转换\nclass MainActivity {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        val nowMill = NOW_MILLS\n        val nowDate = NOW_DATE\n        val nowString = NOW_STRING\n        val result = NOW_MILLS.toDate().time.formatString(\"yyyy-MM-dd\")\n    }\n}\n```\n\n### 版本号\n\n```kotlin\nclass MainActivity {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        val versionCode = appVersion.versionCode\n        val versionName = appVersion.versionName\n    }\n}\n```\n\n### Intent封装\n\n```kotlin\nclass FirstActivity {\n    fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        startActivity(\n            Intent(this, MainActivity::class.java).apply {\n                putExtra(\"result\", \"abc\")\n            })\n    }\n}\n```\n\n```kotlin\nclass MainActivity {\n    fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        val result by intentString(\"result\")\n    }\n}\n```\n\n### 正则表达式\n\n```kotlin\nclass MainActivity {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        val result = \"2132133\".isPassword\n        val result1 = \"sdasd\".isPhoneNumber\n    }\n}\n```\n\n### FlowEventBus\n\n```kotlin\nFlowEventBus.post(\"action1\", \"success\")\n```\n\n```kotlin\nFlowEventBus.subscribe\u003cString\u003e(\"action1\") {\n    Log.d(\"event\", it)\n}\n```\n\n## License\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```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjyygithub%2Fkoonny-appcompat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjyygithub%2Fkoonny-appcompat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjyygithub%2Fkoonny-appcompat/lists"}