[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4096":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":22,"defaultBranch":23,"hasWiki":21,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":34,"discoverSource":35},4096,"vlayout","alibaba\u002Fvlayout","alibaba","Project vlayout is a powerfull LayoutManager extension for RecyclerView, it provides a group of layouts for RecyclerView. Make it able to handle a complicate situation when grid, list and other layouts in the same recyclerview. ","http:\u002F\u002Ftangram.pingguohe.net\u002F",null,"Java",10740,1784,10,190,0,2,5,44.75,"MIT License",true,false,"master",[25,26,27,28,29,30],"android","layout","layout-manager","layoutmanager","recyclerview-multi-type","tangram","2026-06-12 02:00:58","# Attention. This project is not maintained any more !!!\n\n# vlayout\n\n[中文文档](README-ch.md)\n\n## Projects of Tangram\n\n### Android\n\n+ [Tangram-Android](https:\u002F\u002Fgithub.com\u002Falibaba\u002FTangram-Android)\n+ [Virtualview-Android](https:\u002F\u002Fgithub.com\u002Falibaba\u002FVirtualview-Android)\n+ [vlayout](https:\u002F\u002Fgithub.com\u002Falibaba\u002Fvlayout)\n+ [UltraViewPager](https:\u002F\u002Fgithub.com\u002Falibaba\u002FUltraViewPager)\n\n### iOS\n\n+ [Tangram-iOS](https:\u002F\u002Fgithub.com\u002Falibaba\u002FTangram-iOS)\n+ [Virtualview-iOS](https:\u002F\u002Fgithub.com\u002Falibaba\u002FVirtualView-iOS)\n+ [LazyScrollView](https:\u002F\u002Fgithub.com\u002Falibaba\u002Flazyscrollview)\n\nProject `vlayout` is a powerful LayoutManager extension for RecyclerView, it provides a group of layouts for RecyclerView. Make it able to handle a complicate situation when grid, list and other layouts in the same recyclerview.\n\n## Design\n\nBy providing a custom LayoutManager to RecyclerView, VirtualLayout is able to layout child views with different style at single view elegantly. The custom LayoutManager manages a serial of layoutHelpers where each one implements the specific layout logic for a certain position range items. By the way, implementing your custom layoutHelper and provding it to the framework is also supported.\n\n## Main Feature\n* Provide default common layout implementation, decouple the View and Layout. Default layout implementations are:\n\t* LinearLayoutHelper: provide linear layout as LinearLayoutManager.\n\t* GridLayoutHelper: provide grid layout as GridLayoutManager, but with more feature.\n\t* FixLayoutHelper: fix the view at certain position of screen, the view does not scroll with whole page.\n\t* ScrollFixLayoutHelper: fix the view at certain position of screen, but the view does not show until it scrolls to it position.\n\t* FloatLayoutHelper: float the view on top of page, user can drag and drop it.\n\t* ColumnLayoutHelper: perform like GridLayoutHelper but layouts all child views in one line.\n\t* SingleLayoutHelper: contain only one child view.\n\t* OnePlusNLayoutHelper: a custom layout with one child view layouted at left and the others at right, you may not need this.\n\t* StickyLayoutHelper: scroll the view when its position is inside the screen, but fix the view at start or end when its position is outside the screen.\n\t* StaggeredGridLayoutHelper: provide waterfall like layout as StaggeredGridLayoutManager.\n* LayoutHelpers provided by default can be generally divided into two categories. One is non-fix LayoutHelper such as LinearLayoutHelper, GridLayoutHelper, etc which means the children of these LayoutHelper will be layouted in the flow of parent container and will be scrolled with the container scrolling. While the other is fix LayoutHelper which means the child of these is always fix in parent container.\n\n\n## Usage\n\n### Import Library\n\nPlease find the latest version in [release notes](https:\u002F\u002Fgithub.com\u002Falibaba\u002Fvlayout\u002Freleases). The newest version has been upload to jcenter and MavenCentral, make sure you have added at least one of these repositories. As follow:\n\nFor gradle:\n``` gradle\ncompile ('com.alibaba.android:vlayout:1.2.8@aar') {\n\ttransitive = true\n}\n```\n\nOr in maven:  \npom.xml\n``` xml\n\u003Cdependency>\n  \u003CgroupId>com.alibaba.android\u003C\u002FgroupId>\n  \u003CartifactId>vlayout\u003C\u002FartifactId>\n  \u003Cversion>1.2.8\u003C\u002Fversion>\n  \u003Ctype>aar\u003C\u002Ftype>\n\u003C\u002Fdependency>\n```\n\n### Initialize LayoutManager\n``` java\nfinal RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);\nfinal VirtualLayoutManager layoutManager = new VirtualLayoutManager(this);\n\nrecyclerView.setLayoutManager(layoutManager);\n```\n\n### Initialize recycled pool's size\nProvide a reasonable recycled pool's size to your recyclerView, since the default value may not meet your situation and cause re-create views when scrolling.\n\n``` java\nRecyclerView.RecycledViewPool viewPool = new RecyclerView.RecycledViewPool();\nrecyclerView.setRecycledViewPool(viewPool);\nviewPool.setMaxRecycledViews(0, 10);\n```\n\n**Attention: the demo code above only modify the recycle pool size of item with type = 0, it you has more than one type in your adapter, you should update recycle pool size for each type.**\n\n### Set Adapters\n\n* You can use `DelegateAdapter` for as a root adapter to make combination of your own adapters. Just make it extend ```DelegateAdapter.Adapter``` and overrides ```onCreateLayoutHelper``` method.\n\n``` java\nDelegateAdapter delegateAdapter = new DelegateAdapter(layoutManager, hasConsistItemType);\nrecycler.setAdapter(delegateAdapter);\n\n\u002F\u002F Then you can set sub- adapters\n\ndelegateAdapter.setAdapters(adapters);\n\n\u002F\u002F or\nCustomAdapter adapter = new CustomAdapter(data, new GridLayoutHelper());\ndelegateAdapter.addAdapter(adapter);\n\n\u002F\u002F call notify change when data changes\nadapter.notifyDataSetChanged();\n\n```\n\n**Attention: When `hasConsistItemType = true`, items with same type value in different sub-adapters share the same type, their view would be reused during scroll. When `hasConsistItemType = false`, items with same type value in different sub-adapters do not share the same type internally.**\n\n* The other way to set adapter is extending ```VirtualLayoutAdapter``` and implementing it to make deep combination to your business code.\n\n``` java\npublic class MyAdapter extends VirtualLayoutAdapter {\n   ......\n}\n\nMyAdapter myAdapter = new MyAdapter(layoutManager);\n\n\u002F\u002Fcreate layoutHelper list\nList\u003CLayoutHelper> helpers = new LinkedList\u003C>();\nGridLayoutHelper gridLayoutHelper = new GridLayoutHelper(4);\ngridLayoutHelper.setItemCount(25);\nhelpers.add(gridLayoutHelper);\n\nGridLayoutHelper gridLayoutHelper2 = new GridLayoutHelper(2);\ngridLayoutHelper2.setItemCount(25);\nhelpers.add(gridLayoutHelper2);\n\n\u002F\u002Fset layoutHelper list to adapter\nmyAdapter.setLayoutHelpers(helpers);\n\n\u002F\u002Fset adapter to recyclerView\nrecycler.setAdapter(myAdapter);\n\n```\n\nIn this way, one thing you should note is that you should call ```setLayoutHelpers``` when the data of Adapter changes.\n\n### Config proguard\n\nAdd following configs in your proguard file if your app is released with proguard.\n\n```\n-keepattributes InnerClasses\n-keep class com.alibaba.android.vlayout.ExposeLinearLayoutManagerEx { *; }\n-keep class android.support.v7.widget.RecyclerView$LayoutParams { *; }\n-keep class android.support.v7.widget.RecyclerView$ViewHolder { *; }\n-keep class android.support.v7.widget.ChildHelper { *; }\n-keep class android.support.v7.widget.ChildHelper$Bucket { *; }\n-keep class android.support.v7.widget.RecyclerView$LayoutManager { *; }\n```\n\n# Demo\n\n![](http:\u002F\u002Fimg3.tbcdn.cn\u002FL1\u002F461\u002F1\u002F1b9bfb42009047f75cee08ae741505de2c74ac0a)\n\n[Demo Project](https:\u002F\u002Fgithub.com\u002Falibaba\u002Fvlayout\u002Ftree\u002Fmaster\u002Fexamples)\n\n# FAQ\n\nRead FAQ(In Chinese language only now) before submitting issue: [FAQ](docs\u002FVLayoutFAQ.md)。\n\n# Layout Attributes\n\nEach layoutHelper has a few attributes to control its layout style. See [this](docs\u002FATTRIBUTES.md) to read more.\n\n# Contributing\n\nBefore you open an issue or create a pull request, please read [Contributing Guide](CONTRIBUTING.md) first.\n\n# LICENSE\n\nVlayout is available under the MIT license.\n","vlayout 是一个强大的 RecyclerView LayoutManager 扩展，它为 RecyclerView 提供了一组布局方案，能够处理在同一 RecyclerView 中同时存在网格、列表等多种布局的复杂情况。其核心功能包括多种预定义布局助手（如线性布局、网格布局、固定布局等），这些布局助手允许开发者根据需要灵活组合不同样式的视图，并且支持自定义布局助手以满足特定需求。适用于 Android 应用开发中需要在单个滚动视图内展示多样化内容布局的场景，比如商品列表页面中混合显示不同类型的商品卡片。尽管项目已不再维护，但其设计理念和技术实现仍具有参考价值。","2026-06-11 02:58:25","top_language"]