{"id":19224799,"url":"https://github.com/flipkart-incubator/proteus","last_synced_at":"2025-05-16T06:03:30.181Z","repository":{"id":16347696,"uuid":"19097627","full_name":"flipkart-incubator/proteus","owner":"flipkart-incubator","description":"Proteus : A JSON based LayoutInflater for Android","archived":false,"fork":false,"pushed_at":"2021-11-22T11:55:06.000Z","size":3550,"stargazers_count":1309,"open_issues_count":6,"forks_count":191,"subscribers_count":171,"default_branch":"master","last_synced_at":"2025-04-08T15:13:36.919Z","etag":null,"topics":["android","binding","data","data-binding","dynamic-layout","functions","java","json","layout-engine","proteus"],"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/flipkart-incubator.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2014-04-24T06:04:31.000Z","updated_at":"2025-04-02T05:39:40.000Z","dependencies_parsed_at":"2022-08-07T08:15:21.851Z","dependency_job_id":null,"html_url":"https://github.com/flipkart-incubator/proteus","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipkart-incubator%2Fproteus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipkart-incubator%2Fproteus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipkart-incubator%2Fproteus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipkart-incubator%2Fproteus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flipkart-incubator","download_url":"https://codeload.github.com/flipkart-incubator/proteus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478160,"owners_count":22077675,"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","binding","data","data-binding","dynamic-layout","functions","java","json","layout-engine","proteus"],"created_at":"2024-11-09T15:12:53.352Z","updated_at":"2025-05-16T06:03:30.092Z","avatar_url":"https://github.com/flipkart-incubator.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\n  \u003cimg src=\"/assets/proteus-logo.png\" width=\"150px\"/\u003e : Android Layout Engine\n\u003c/h1\u003e\n\n\u003ca target=\"_blank\" href=\"https://travis-ci.org/flipkart-incubator/proteus\"\u003e\n    \u003cimg src=\"https://travis-ci.org/flipkart-incubator/proteus.svg?branch=master\" alt=\"Build Status\"\u003e\n  \u003c/a\u003e\n\u003ca target=\"_blank\" href=\"https://jitpack.io/#flipkart-incubator/proteus\"\u003e\n  \u003cimg src=\"https://jitpack.io/v/flipkart-incubator/proteus.svg\" alt=\"Build Status\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://android-arsenal.com/details/1/5105\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Android%20Arsenal-Proteus-brightgreen.svg?style=flat\" border=\"0\" alt=\"Android Arsenal\"\u003e\n\u003c/a\u003e\n\n**Proteus** is meant to be a drop-in replacement for Android’s `LayoutInflater`; but unlike the compiled XML layouts bundled in the APK, Proteus inflates layouts at runtime.\nWith Proteus, you can control your Apps layout from the backend (no WebViews). Forget the boilerplate code to `findViewById`, cast it to a `TextView`, and then `setText()`. Proteus has runtime data bindings and formatters. Plugin in your own custom views and attributes and functions to flavour proteus to your requirements.\n\n* **[Getting started](#getting-started)**\n* **[How it Works](#how-it-works)**\n* **[Resources](#resources)**\n* **[Contributing](#contributing)**\n* **[License](#license)**\n* **[Contributors](#contributors)**\n* **[StackOverflow](#stackoverflow)**\n\n## Getting Started\n\n#### gradle (gradle 4.10.*)\n\n```javascript\n// Add it in your root build.gradle at the end of repositories:\nallprojects {\n    repositories {\n        google()\n        jcenter()\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n```\n// Add in your app level dependency\ndependencies {\n    implementation 'com.github.flipkart-incubator.proteus:proteus-core:5.0.1'\n    implementation 'com.github.flipkart-incubator.proteus:gson-adapter:5.0.1'\n    implementation 'com.github.flipkart-incubator.proteus:cardview-v7:5.0.1'\n    implementation 'com.github.flipkart-incubator.proteus:design:5.0.1'\n    implementation 'com.github.flipkart-incubator.proteus:recyclerview-v7:5.0.1'\n    implementation 'com.github.flipkart-incubator.proteus:support-v4:5.0.1'\n}\n```\n\n## How it works\n\nInstead of writing layouts in `XML`, in **proteus** layouts are described in `JSON`, which can be used to inflate native Android UI at runtime. The `JSON` layouts can be hosted anywhere (on the device, on servers, etc.).\n\n\nThe [**Layout**](https://github.com/flipkart-incubator/proteus/wiki/Layouts) defines the the view heirarchy, just like XML.\n\nThe [**Data**](https://github.com/flipkart-incubator/proteus/wiki/Data) (optional) defines [data bindings](https://github.com/flipkart-incubator/proteus/wiki/Data-Bindings). These data bindings are similar to Android's [Data Binding](https://developer.android.com/topic/libraries/data-binding/index.html) library.\n\nGive the `layout` and `data` to `ProteusLayoutInflater` and get back a native view hierarchy.\n\nWatch [this video](https://www.youtube.com/watch?v=W2Ord1oB72Q\u0026index=1\u0026list=PLIQ3ghGBPsqu0F-OHhKRq2s76vSkdUlJp) to see it in action.\n\n#### Sample layout\n\n```javascript\n{\n  \"type\": \"LinearLayout\",\n  \"orientation\": \"vertical\",\n  \"padding\": \"16dp\",\n  \"children\": [{\n    \"layout_width\": \"200dp\",\n    \"gravity\": \"center\",\n    \"type\": \"TextView\",\n    \"text\": \"@{user.profile.name}\"\n  }, {\n    \"type\": \"HorizontalProgressBar\",\n    \"layout_width\": \"200dp\",\n    \"layout_marginTop\": \"8dp\",\n    \"max\": 6000,\n    \"progress\": \"@{user.profile.experience}\"\n  }]\n}\n```\n\n#### Sample data\n\n```javascript\n{\n  \"user\": {\n    \"profile\": {\n      \"name\": \"John Doe\",\n      \"experience\": 4192\n    }\n  }\n}\n```\n\n### Sample Java code\n\n```java\nProteusView view = proteusLayoutInflater.inflate(\u003clayout\u003e, \u003cdata\u003e);\ncontainer.addView(view.getAsView());\n```\n\n#### Output\n\n\u003cimg src=\"/assets/example-small.png\" width=\"360px\"/\u003e\n\n\n### Setting up the Demo App\n\nThe demo app will let you play around with proteus as well as help you understand the internals better.\n\n* Install NodeJS [here](https://nodejs.org/en/download/)\n* open a terminal\n* cd into the project directory\n* run `npm start`\n* Start an AVD emulator\n* Install the Demo App\n\n**Ready to tinker**\n\n* Tinker around with the [layout](https://github.com/adityasharat/proteus-demo/blob/develop/data/layout.json) and [data](https://github.com/adityasharat/proteus-demo/blob/develop/data/user.json)\n* Hit the FAB to refresh the app.\n\n## Resources\n\n* [FAQ](https://github.com/flipkart-incubator/proteus/wiki/Frequently-asked-questions)\n* [Detailed Guide](https://github.com/flipkart-incubator/proteus/wiki)\n* [API References]() *under construction*\n* [DroidCon Talk](https://www.youtube.com/watch?v=ue0ax2_18k8)\n* [Demo Videos](https://www.youtube.com/playlist?list=PLIQ3ghGBPsqu0F-OHhKRq2s76vSkdUlJp)\n\n## Supported Modules\n\n* Native Android Widgets\n* CardView v7\n* Android Design Library\n* RecyclerView v7\n* Android Support v4\n\n## Contributing\n\n### How?\n\nThe easiest way to contribute is by [forking the repo](https://help.github.com/articles/fork-a-repo/), making your changes and [creating a pull request](https://help.github.com/articles/creating-a-pull-request/).\n\n### What?\n\n* Adding new Views and Attribute Proccessors.\n* Adding new Functions.\n* Adding JavaDoc and Wiki.\n* Completing TODOs\n* Writing unit tests.\n* Finding bugs and issues. (submit [here](https://github.com/flipkart-incubator/proteus/issues))\n* Fixing bugs and issues.\n* Implement performance/benchmarking tools.\n\n## License\n\n[Apache v2.0](LICENSE)\n\nIf you are using proteus check out the [can, cannot and must](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))\n\n## Contributors\n\nYou can check out the [contributors here](https://github.com/flipkart-incubator/proteus/graphs/contributors), but if you wish to contact us; just drop in a mail.\n\n* [adityasharat](mailto:adityasharat@gmail.com)\n* [thekirankumar](mailto:kiran.kumar@flipkart.com)\n* [yasirmhd](mailto:mohammad.yasir@flipkart.com)\n\n## StackOverflow\n\nFind us on [StackOverflow](http://stackoverflow.com) at [proteus](http://stackoverflow.com/questions/tagged/proteus).\n\n## Plugins\n\n### One click XML to JSON conversion plugin\n\nDownload [this plugin (in beta)](https://github.com/flipkart-incubator/android-studio-proteus-plugin) for Android Studio. Once enabled, you can select any android XML resource file and go to **Tools \u003e Proteus \u003e Convert XML to JSON**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflipkart-incubator%2Fproteus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflipkart-incubator%2Fproteus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflipkart-incubator%2Fproteus/lists"}