{"id":13482774,"url":"https://github.com/JakeWharton/butterknife","last_synced_at":"2025-03-27T13:32:36.231Z","repository":{"id":7262707,"uuid":"8575137","full_name":"JakeWharton/butterknife","owner":"JakeWharton","description":"Bind Android views and callbacks to fields and methods.","archived":false,"fork":false,"pushed_at":"2023-09-02T07:41:30.000Z","size":3909,"stargazers_count":25559,"open_issues_count":120,"forks_count":4602,"subscribers_count":1045,"default_branch":"master","last_synced_at":"2024-10-25T06:36:58.910Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jakewharton.github.io/butterknife/","language":"Java","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/JakeWharton.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-03-05T08:18:59.000Z","updated_at":"2024-10-24T14:52:21.000Z","dependencies_parsed_at":"2022-07-13T09:00:45.995Z","dependency_job_id":"af719a37-3999-434c-9bdc-73779bea975c","html_url":"https://github.com/JakeWharton/butterknife","commit_stats":{"total_commits":685,"total_committers":110,"mean_commits":"6.2272727272727275","dds":0.4642335766423358,"last_synced_commit":"fcdebedf3276096db2f51bf6372b849b5a9c75ed"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeWharton%2Fbutterknife","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeWharton%2Fbutterknife/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeWharton%2Fbutterknife/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeWharton%2Fbutterknife/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JakeWharton","download_url":"https://codeload.github.com/JakeWharton/butterknife/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245401395,"owners_count":20609167,"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":[],"created_at":"2024-07-31T17:01:05.383Z","updated_at":"2025-03-27T13:32:35.835Z","avatar_url":"https://github.com/JakeWharton.png","language":"Java","funding_links":[],"categories":[":shamrock:  **Categories**","Java","CN","Index","Libraries","Uncategorized","Libs","第四部分 开发工具及测试工具","Annotation"],"sub_categories":[":books: Libraries","[Jake Wharton](https://github.com/JakeWharton)","Dependency Injections","Dependency Injection","Uncategorized","\u003cA NAME=\"Injector\"\u003e\u003c/A\u003eInjector"],"readme":"Butter Knife\n============\n\n**Attention**: This tool is now deprecated. Please switch to\n[view binding](https://developer.android.com/topic/libraries/view-binding).\nExisting versions will continue to work, obviously, but only critical bug fixes for integration\nwith AGP will be considered. Feature development and general bug fixes have stopped.\n\n![Logo](website/static/logo.png)\n\nField and method binding for Android views which uses annotation processing to generate boilerplate\ncode for you.\n\n * Eliminate `findViewById` calls by using `@BindView` on fields.\n * Group multiple views in a list or array. Operate on all of them at once with actions,\n   setters, or properties.\n * Eliminate anonymous inner-classes for listeners by annotating methods with `@OnClick` and others.\n * Eliminate resource lookups by using resource annotations on fields.\n\n```java\nclass ExampleActivity extends Activity {\n  @BindView(R.id.user) EditText username;\n  @BindView(R.id.pass) EditText password;\n\n  @BindString(R.string.login_error) String loginErrorMessage;\n\n  @OnClick(R.id.submit) void submit() {\n    // TODO call server...\n  }\n\n  @Override public void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    setContentView(R.layout.simple_activity);\n    ButterKnife.bind(this);\n    // TODO Use fields...\n  }\n}\n```\n\nFor documentation and additional information see [the website][3].\n\n__Remember: A butter knife is like a [dagger][1], only infinitely less sharp.__\n\n\n\nDownload\n--------\n\n```groovy\nandroid {\n  ...\n  // Butterknife requires Java 8.\n  compileOptions {\n    sourceCompatibility JavaVersion.VERSION_1_8\n    targetCompatibility JavaVersion.VERSION_1_8\n  }\n}\n\ndependencies {\n  implementation 'com.jakewharton:butterknife:10.2.3'\n  annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'\n}\n```\n\nIf you are using Kotlin, replace `annotationProcessor` with `kapt`.\n\nSnapshots of the development version are available in [Sonatype's `snapshots` repository][snap].\n\n\n\nLibrary projects\n--------------------\n\nTo use Butter Knife in a library, add the plugin to your `buildscript`:\n\n```groovy\nbuildscript {\n  repositories {\n    mavenCentral()\n    google()\n  }\n  dependencies {\n    classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'\n  }\n}\n```\n\nand then apply it in your module:\n\n```groovy\napply plugin: 'com.android.library'\napply plugin: 'com.jakewharton.butterknife'\n```\n\nNow make sure you use `R2` instead of `R` inside all Butter Knife annotations.\n\n```java\nclass ExampleActivity extends Activity {\n  @BindView(R2.id.user) EditText username;\n  @BindView(R2.id.pass) EditText password;\n...\n}\n```\n\n\n\nLicense\n-------\n\n    Copyright 2013 Jake Wharton\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\n\n\n [1]: https://dagger.dev/\n [2]: https://search.maven.org/remote_content?g=com.jakewharton\u0026a=butterknife\u0026v=LATEST\n [3]: http://jakewharton.github.com/butterknife/\n [snap]: https://oss.sonatype.org/content/repositories/snapshots/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJakeWharton%2Fbutterknife","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJakeWharton%2Fbutterknife","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJakeWharton%2Fbutterknife/lists"}