{"id":17066803,"url":"https://github.com/fabianterhorst/fastlayout","last_synced_at":"2025-04-06T16:14:42.715Z","repository":{"id":46697561,"uuid":"58396529","full_name":"FabianTerhorst/FastLayout","owner":"FabianTerhorst","description":"Generates a Java Object for your xml layout to reduce inflate time to zero","archived":false,"fork":false,"pushed_at":"2019-01-24T03:22:35.000Z","size":351,"stargazers_count":444,"open_issues_count":11,"forks_count":35,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-30T15:09:20.473Z","etag":null,"topics":["android","android-performance","java","xml-layout"],"latest_commit_sha":null,"homepage":"","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/FabianTerhorst.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}},"created_at":"2016-05-09T17:51:44.000Z","updated_at":"2025-01-09T21:29:23.000Z","dependencies_parsed_at":"2022-09-13T15:45:09.922Z","dependency_job_id":null,"html_url":"https://github.com/FabianTerhorst/FastLayout","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabianTerhorst%2FFastLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabianTerhorst%2FFastLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabianTerhorst%2FFastLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabianTerhorst%2FFastLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FabianTerhorst","download_url":"https://codeload.github.com/FabianTerhorst/FastLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509237,"owners_count":20950232,"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-performance","java","xml-layout"],"created_at":"2024-10-14T11:08:23.818Z","updated_at":"2025-04-06T16:14:42.686Z","avatar_url":"https://github.com/FabianTerhorst.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastLayout\n### Generates a Java Object for your xml layout to reduce inflate time to zero\n\n\u003ca href=\"http://www.methodscount.com/?lib=io.fabianterhorst%3Afastlayout%3A%2B\"\u003e\u003cimg src=\"https://img.shields.io/badge/Methods and size-12 | 4 KB-e91e63.svg\"\u003e\u003c/img\u003e\u003c/a\u003e\n\n#### This projects methodcount is very low, because everything happens on compile time.\n\n### Add the dependencies\nmain build.gradle\n```groovy\nbuildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        ...\n\t\tclasspath 'io.fabianterhorst:fastlayout-gradle-plugin:0.0.2-alpha37'\n\t\t...\n\t}\n}\n```\napp build.gradle\n```groovy\n...\napply plugin: 'fastlayout'\n...\n```\n\n### First create your layout java class\nThis is needed to filter the layouts you want to compile\n```java\n//this is compiling all layouts in layout folder\n@Layouts(all = true, exclude = {R.layout.sample_item})\n//there you can specify the layouts\n//@Layouts(layouts = {\"activity_main\", \"fragment_one\"})\n//@Layouts(ids = {R.layout.activity_main, R.layout.fragment_one})\n//this is needed when you want to use the class fields\n//@Layouts\npublic class AppLayouts {\n}\n```\n### Now use the layout inside your Activity for example\n```java\npublic class MainActivity extends AppCompatActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        //when you don´t wanna use the cache you can also just initiate the object\n        //setContentView(new ActivityMainLayout(this));\n        //The cache is reusing the object to improve the performance\n        ActivityMainLayout layout = LayoutCache.getInstance().getLayout(context, LayoutCache.Activity_Main_Layout);\n        setContentView(layout);\n    }\n}\n```\n### Limitations\n## Specify a id for every view, otherwise the id is generated and can change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabianterhorst%2Ffastlayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabianterhorst%2Ffastlayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabianterhorst%2Ffastlayout/lists"}