{"id":15035192,"url":"https://github.com/androidbroadcast/viewbindingpropertydelegate","last_synced_at":"2025-05-14T15:06:48.167Z","repository":{"id":37605264,"uuid":"260762176","full_name":"androidbroadcast/ViewBindingPropertyDelegate","owner":"androidbroadcast","description":"Make work with Android View Binding simpler","archived":false,"fork":false,"pushed_at":"2025-02-13T07:07:10.000Z","size":653,"stargazers_count":1465,"open_issues_count":0,"forks_count":101,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-14T08:00:08.406Z","etag":null,"topics":["android","kotlin","viewbinding"],"latest_commit_sha":null,"homepage":"https://proandroiddev.com/make-android-view-binding-great-with-kotlin-b71dd9c87719","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/androidbroadcast.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":null,"patreon":"android_broadcast","custom":"https://www.donationalerts.com/r/androidbroadcast"}},"created_at":"2020-05-02T19:42:27.000Z","updated_at":"2025-04-12T01:09:49.000Z","dependencies_parsed_at":"2023-10-20T17:16:19.872Z","dependency_job_id":"86f78aaf-cb19-4b7a-bcc8-8028b92c0152","html_url":"https://github.com/androidbroadcast/ViewBindingPropertyDelegate","commit_stats":null,"previous_names":["kirich1409/viewbindingpropertydelegate"],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/androidbroadcast%2FViewBindingPropertyDelegate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/androidbroadcast%2FViewBindingPropertyDelegate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/androidbroadcast%2FViewBindingPropertyDelegate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/androidbroadcast%2FViewBindingPropertyDelegate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/androidbroadcast","download_url":"https://codeload.github.com/androidbroadcast/ViewBindingPropertyDelegate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254169431,"owners_count":22026212,"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","kotlin","viewbinding"],"created_at":"2024-09-24T20:27:46.981Z","updated_at":"2025-05-14T15:06:48.111Z","avatar_url":"https://github.com/androidbroadcast.png","language":"Kotlin","funding_links":["https://patreon.com/android_broadcast","https://www.donationalerts.com/r/androidbroadcast"],"categories":[],"sub_categories":[],"readme":"# ViewBindingPropertyDelegate\n\nMake work with [Android View Binding](https://d.android.com/topic/libraries/view-binding) simpler. The library:\n- manages ViewBinding lifecycle and clears the reference to it to prevent memory leaks\n- eliminates the need to keep nullable references to Views or ViewBindings\n- creates ViewBinding lazily\n\nThe library comes in two variants: with and without reflection. The artifacts are respectively: `vbpd` and `vbpd-reflection`. **Prefer to use the one without reflection for better performance**\n\n## IMPORTANT: Enable ViewBinding before using the library\nEach Gradle module in your project where you need to use ViewBinding must be properly configured. Refer to the [official guide](https://d.android.com/topic/libraries/view-binding) on how to do that \n\n## Add the library to a project\n\n```kotlin\nallprojects {\n  repositories {\n    mavenCentral()\n  }\n}\n\ndependencies {\n    // recommended\n    implementation(\"dev.androidbroadcast.vbpd:vbpd:2.0.4\")\n    \n    // additional factories that use reflection under hood\n    implementation(\"dev.androidbroadcast.vbpd:vbpd-reflection:2.0.4\")\n}\n```\n\n## Samples\n\n```kotlin\nimport javax.swing.text.View\n\nclass ProfileFragment : Fragment(R.layout.profile) {\n   // RECOMMENDED \n   // no reflection API is used under the hood\n   private val profileBinding: ProfileBinding by viewBinding(ProfileBinding::bind)\n\n   override fun onViewCreated(view: View) {\n       super.onViewCreate(view)\n       with(profileBinding) {\n          firstName.text = person.name\n          lastName.text = person.surname\n          email.text = person.email\n       }\n   }\n\n   override fun onViewDestroyed() {\n      super.onViewDestroyed()\n      // profileBinding will be cleared after onViewDestroyed()\n   }\n}\n```\n\n## Migration from 1.0\n\nYou can use 1.X and 2.X in the same project without replacing code\n\n- Replace packages `com.github.kirich1409.viewbindingpropertydelegate` -\u003e `dev.androidbroadcast.vbpd`\n- Replace `onViewDestroyed` with moving code to proper lifecycle callback (Fragment.onViewDestroyed(), Activity.onDestroy(), etc.)\n\n# License\n\n   Copyright 2020-2025 Kirill Rozov\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroidbroadcast%2Fviewbindingpropertydelegate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandroidbroadcast%2Fviewbindingpropertydelegate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroidbroadcast%2Fviewbindingpropertydelegate/lists"}