{"id":13628961,"url":"https://github.com/RomainPiel/Michelangelo","last_synced_at":"2025-04-17T04:32:37.820Z","repository":{"id":13446617,"uuid":"16135991","full_name":"romainpiel/Michelangelo","owner":"romainpiel","description":"Layout inflation library for Android based on annotations","archived":true,"fork":false,"pushed_at":"2014-01-23T21:44:01.000Z","size":336,"stargazers_count":142,"open_issues_count":3,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-08T19:42:49.250Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/romainpiel.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}},"created_at":"2014-01-22T10:24:37.000Z","updated_at":"2023-01-28T12:03:48.000Z","dependencies_parsed_at":"2022-09-23T13:00:39.333Z","dependency_job_id":null,"html_url":"https://github.com/romainpiel/Michelangelo","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/romainpiel%2FMichelangelo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romainpiel%2FMichelangelo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romainpiel%2FMichelangelo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romainpiel%2FMichelangelo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romainpiel","download_url":"https://codeload.github.com/romainpiel/Michelangelo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249316005,"owners_count":21249873,"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-08-01T22:01:00.300Z","updated_at":"2025-04-17T04:32:35.171Z","avatar_url":"https://github.com/romainpiel.png","language":"Java","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Michelangelo\n\nLayout inflation library for Android which uses annotation processing to write the code you don't want to write and simplify your compound views.\n\n## How to use\n\nAn example of use:\n\n```java\n@InflateLayout(R.layout.custom_view)\npublic class MyCustomView extends FrameLayout {\n\n    public MyCustomView(Context context) {\n        super(context);\n    }\n\n    @AfterInflate\n    public void updateTextView() {\n        ((TextView) findViewById(R.id.my_text_view)).setText(\"hey!\");\n    }\n}\n```\n\n`R.layout.custom_view`:\n```xml\n\u003cmerge xmlns:android=\"http://schemas.android.com/apk/res/android\"\u003e\n\n    \u003cTextView\n            android:id=\"@+id/my_text_view\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"/\u003e\n\n\u003c/merge\u003e\n```\n\nInflating that View is pretty straightforward:\n```java\nMyCustomView view = Michelangelo.build(this, MyCustomView.class);\n```\n\n## Post inflate methods\n\nUse the annotation `@AfterInflate` on your compound view's methods you want to run straight after the layout is inflated with Michelangelo.\n\n## Michelangelo and ButterKnife\n\nMichelangelo plays very well with Jake Wharton's library [ButterKnife](https://github.com/JakeWharton/butterknife). Just add the annotation `@InjectViews` to your `ViewGroup` and Michelangelo will do the rest.\n\nExample using ButterKnife:\n\n```java\n@InflateLayout(R.layout.item_painting)\n@InjectViews\npublic class PaintingItemView extends LinearLayout {\n\n    @InjectView(R.id.image) ImageView image;\n    @InjectView(R.id.title) TextView title;\n\n    public PaintingItemView(Context context) {\n        super(context);\n        setOrientation(HORIZONTAL);\n    }\n\n    public void bind(Painting painting) {\n        image.setImageResource(painting.getDrawableResId());\n        title.setText(painting.getTitle());\n    }\n}\n```\n\n## Order of events\n\nWhen you call `Michelangelo.build()`:\n\n1. The view gets inflated\n2. If specified, the injector is applied (`ButterKnife.inject(view)`)\n3. If exist, methods annotated with `@AfterInflate` are run.\n\n## Sample\n\nSee the [sample](https://github.com/RomainPiel/Michelangelo/tree/master/michelangelo-sample/src/main) for a common use of this library with `ListView` adapters.\n\n## License\n```\nCopyright 2014 Romain Piel\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```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRomainPiel%2FMichelangelo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRomainPiel%2FMichelangelo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRomainPiel%2FMichelangelo/lists"}