Skip to content
Kiran Kumar edited this page Jan 24, 2017 · 36 revisions

Proteus is meant to be a drop-in replacement to Android’s XML LayoutInflater. Built in order to modify your apps user interface, without a release. You can host your layouts on a server and send them over the wire instead of bundling them in your APK.

Layout

A Layout describes the view hierarchy, think of it as being an XML layout file in Android. In Proteus it is currently represented in JSON. In JSON, the type attribute will contain the value equal to the nodes present in XML.

Head over to the Layouts page for more details.

Data

Data (optional) represents the dynamic parts of the Layout. It is similar to Android Data bindings. The only difference being that this is mostly runtime, whereas Android by default has compile time bindings.

Refer Data as well as Data Bindings for more details.

Layout Builder is the most important component of Proteus. It takes in a Layout, and Data (could be empty) to create a native Android View. This is done using the build method. Since this is just a regular view, you can add it to a View Group or set it as a content view to your activity. If you want to register custom view types or need custom handling of attributes, you can register them here.

Refer the ReadMe and videos for examples on how to use this class.

Layout Builder's build method returns a ProteusView. This is a regular Android View object and can be used just like one. Additionally it hosts the ProteusViewManager inside it which can be called using getViewManager() method on the view.

Note : Every view and child views returned by Proteus will implement the ProteusView Interface.