This article by Jimmy – Sun contribute authorized author’s blog: https://blog.csdn.net/u013541140/article/details/89517186

Readers familiar with Ali’s vlayout know that VLayout greatly expands RecyclerView’s LayoutManager, thus providing a set of RecyclerView layouts.

Using this open source project, we can process linear, grid, and other complex layouts in the same RecyclerView. However, when using VLayout, everything needs to be implemented in Java code, and it is written on the client side. Once it needs to be modified, it has to be issued, which is not very flexible. Therefore, Ali proposed Tangram, which can use JSON to configure the layout, which can be said to greatly improve flexibility.

Tangram is a framework model produced by Ali for fast realization of combined layout, which is widely used in Android and iOS versions of mobile phone Tmall, as shown below:

Mobile phone Tmall

Tangram is a framework that provides a set of basic unit layouts that can be quickly assembled to create a page with multiple layouts. It provides several layout styles such as streaming layout, rolling layout, waterfall flow layout, and fixed layout. Layout provides style parameters for adjustment, and any View can be filled inside the layout, which makes the Native developed page have certain dynamic characteristics and provide the ultimate performance.

The official demo screenshot is as follows:

Tangram contains the following features:

  • Android iOS dual-platform support.

  • Page views are created through JSON and a default parser is provided.

  • Page view can be easily recycled and reused.

  • The framework provides multiple default layouts.

  • Support for custom layout styles through JSON data or code.

  • High-performance, based on vlayout.

  • Support extended function modules.

Although the official documents are provided, they are not very suitable for getting started. Therefore, I realized a demo by myself by referring to the official documents and various articles, and summarized into an article, which I share with you here.

Tangram Android dynamic interface development framework USES full tutorial: https://blog.csdn.net/u013541140/article/details/89517186

In this article, you can follow my guide to understand Tangram’s concepts, learn how to use the open source framework, and get comfortable using it for layout and component development. A screenshot of the article’s table of contents is as follows:

As you can see from reading the above article, in Tangram, the page structure can be dynamically updated through configuration. However, the business components are still implemented through Java code and cannot be updated dynamically.

VirtualView, therefore, is designed to address the dynamic updating of business components. It provides a set of basic UI components and layout component capabilities that build business components from XML and compile XML templates into binary data, which are then parsed and rendered by the main framework. When XML template data can be delivered dynamically, the business component view on the client side can also be updated dynamically.

VirtualView is a new component development technology introduced during the Tangram upgrade. Key features include:

  • One template, supported by both ends.

  • Provides basic atomic and container controls and supports adding custom components.

  • Supports a protocol for virtualizing controls, mixing virtual and physical controls in templates.

  • Support for writing data-bound expressions in templates.

  • Support for writing event-triggered logical expressions in templates.

  • Provide supporting development tools, auxiliary template development tools.

In the following article, I show you how to use the Open source framework VirtualView:

Android dynamic interface development framework VirtualView use full tutorial at https://blog.csdn.net/u013541140/article/details/89519912

By studying this article, you can:

  • Understand the format of VirtualView template data

  • Understand the basic principles of VirtualView, including compiling, parsing, and binding data from templates

  • Understand the basic access methods of VirtualView, including initialization, adding custom basic controls, and adding logical interactions with external devices

  • Understand the features of VirtualView’s built-in base controls to avoid repetitive development

A screenshot of the article’s table of contents is as follows:

These two articles in the implementation on the demo has been uploaded to the lot of the open source address link: https://github.com/jimmysuncpt/TangramDemo

You can learn through my article and demo, thank you for your support!

A new version of Kotlin is available, cross-platform support! Must-see Android source debugging tips

Programming · thinking · workplace welcome scan code attention