{"id":3491,"url":"https://github.com/facebook/litho","last_synced_at":"2025-05-13T21:02:46.343Z","repository":{"id":37752117,"uuid":"80179724","full_name":"facebook/litho","owner":"facebook","description":"A declarative framework for building efficient UIs on Android.","archived":false,"fork":false,"pushed_at":"2025-05-05T18:25:29.000Z","size":802091,"stargazers_count":7738,"open_issues_count":100,"forks_count":762,"subscribers_count":182,"default_branch":"master","last_synced_at":"2025-05-06T20:19:06.276Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://fblitho.com","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/facebook.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2017-01-27T03:59:11.000Z","updated_at":"2025-05-05T18:17:14.000Z","dependencies_parsed_at":"2022-07-14T04:40:31.924Z","dependency_job_id":"e054d88a-5154-4e0e-a67a-d55be459b64f","html_url":"https://github.com/facebook/litho","commit_stats":{"total_commits":18366,"total_committers":737,"mean_commits":"24.919945725915873","dds":0.9384188173799412,"last_synced_commit":"92d9c80acf8ef32838bd8084696156b98972d04f"},"previous_names":[],"tags_count":363,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Flitho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Flitho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Flitho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebook%2Flitho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebook","download_url":"https://codeload.github.com/facebook/litho/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254027338,"owners_count":22002039,"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-01-05T20:16:43.019Z","updated_at":"2025-05-13T21:02:41.335Z","avatar_url":"https://github.com/facebook.png","language":"Kotlin","readme":"# Litho [![GithubCI](https://github.com/facebook/litho/actions/workflows/ci.yml/badge.svg)](https://github.com/facebook/litho/actions/workflows/ci.yml) [![Bintray](https://img.shields.io/maven-metadata/v/https/jcenter.bintray.com/com/facebook/litho/litho-core/maven-metadata.xml.svg?color=orange\u0026label=bintray)](https://bintray.com/facebook/maven/com.facebook.litho%3Alitho-core/_latestVersion) [![Join the chat at https://gitter.im/facebook/litho](https://badges.gitter.im/facebook/litho.svg)](https://gitter.im/facebook/litho?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/facebook/litho/blob/master/LICENSE)\n\n\u003cimg src=\"website/static/logo.png\" width=150 align=right\u003e\n\nLitho is a declarative framework for building efficient UIs on Android.\n\n* **Declarative:** Litho uses a declarative API to define UI components. You simply describe the layout for your UI based on a set of immutable inputs and the framework takes care of the rest.\n* **Asynchronous layout:** Litho can measure and layout your UI ahead of time without blocking the UI thread.\n* **View flattening:** Litho uses [Yoga](https://facebook.github.io/yoga/) for layout and automatically reduces the number of ViewGroups that your UI contains.\n* **Fine-grained recycling:** Any component such as a text or image can be recycled and reused anywhere in the UI.\n\nTo get started, check out these links:\n\n* [Learn how to use Litho in your project.](http://fblitho.com/docs/getting-started)\n* [Get started with our tutorial.](http://fblitho.com/docs/tutorial)\n* [Read more about Litho in our docs.](http://fblitho.com/docs/intro)\n\n## Installation\nLitho can be integrated either in Gradle or Buck projects. Read our [Getting Started](http://fblitho.com/docs/getting-started) guide for installation instructions.\n\n## Quick start\n### 1. Initialize `SoLoader` in your `Application` class.\n```java\npublic class SampleApplication extends Application {\n  @Override\n  public void onCreate() {\n    super.onCreate();\n    SoLoader.init(this, false);\n  }\n}\n```\n### 2. Create and display a component in your Activity\n```java\n@Override\npublic void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n\n    final ComponentContext c = new ComponentContext(this);\n\n    final Component component = Text.create(c)\n        .text(\"Hello World\")\n        .textSizeDip(50)\n        .build();\n\n    setContentView(LithoView.create(c, component));\n}\n```\n## Run sample\nYou can find more examples in our [sample app](https://github.com/facebook/litho/tree/master/sample).\n\nTo build and run (on an attached device/emulator) the sample app, execute\n\n    $ buck fetch sample\n    $ buck install -r sample\n\nor, if you prefer Gradle,\n\n    $ ./gradlew :sample:installDebug\n\n## Contributing\n\nBefore contributing to Litho, please first read the [Code of\nConduct](https://code.facebook.com/codeofconduct) that we expect\nproject participants to adhere to.\n\nFor pull requests, please see our [CONTRIBUTING](CONTRIBUTING.md) guide.\n\nSee our [issues](https://github.com/facebook/litho/issues/) page for ideas on how to contribute or to let us know of any problems.\n\nPlease also read our [Coding Style](http://fblitho.com/docs/best-practices#coding-style) and [Code of Conduct](https://code.facebook.com/codeofconduct) before you contribute.\n\n## Getting Help\n\n- Post on [StackOverflow](https://stackoverflow.com/questions/tagged/litho)\n  using the `#litho` tag.\n- Chat with us on [Gitter](https://gitter.im/facebook/litho).\n- Join our [Facebook Group](https://www.facebook.com/groups/litho.android/) to\n  stay up-to-date with announcements.\n- Please open GitHub issues only if you suspect a bug in the framework or have a\n  feature request and not for general questions.\n\n## License\n\nLitho is licensed under the [Apache 2.0 License](LICENSE).\n","funding_links":[],"categories":["Kotlin","其他","Libraries","Java"],"sub_categories":["GUI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebook%2Flitho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebook%2Flitho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebook%2Flitho/lists"}