All Projects → Comcast → blueprint

Comcast / blueprint

Licence: Apache-2.0 license
Blueprint is a compact framework for constructing mvp architecture within a scrollable, multi-view-type list UI. It uses the Android RecyclerView library, and currently only supports LinearLayouts

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to blueprint

MultiTypeAdapter
RecyclerView通用多类型适配器MultiTypeAdapter,以布局文件为单位更细粒度的条目复用。
Stars: ✭ 18 (-5.26%)
Mutual labels:  recyclerview
ShimmerRecyclerView
A custom Shimmer RecyclerView which adopt to list / grid transition automatically and also supports multiple view types while shimmering.
Stars: ✭ 184 (+868.42%)
Mutual labels:  recyclerview
ParkingDemo
Taipei City Parking Lot Information Query System Demo
Stars: ✭ 18 (-5.26%)
Mutual labels:  recyclerview
android-thinkmap-treeview
Tree View; Mind map; Think map; tree map; custom view; 自定义;关系图;树状图;思维导图;组织机构图;层次图
Stars: ✭ 314 (+1552.63%)
Mutual labels:  recyclerview
recyclerview-expandable
RecyclerView implementation of traex's ExpandableLayout
Stars: ✭ 70 (+268.42%)
Mutual labels:  recyclerview
TabSync
A lightweight synchronizer between Android's Tabs and Lists. Available on the View system and Jetpack Compose.
Stars: ✭ 98 (+415.79%)
Mutual labels:  recyclerview
FastWaiMai
仿写美团外卖电商项目
Stars: ✭ 123 (+547.37%)
Mutual labels:  recyclerview
Recycling
A Library for make an easy and faster RecyclerView without adapter
Stars: ✭ 57 (+200%)
Mutual labels:  recyclerview
AdapterCommands
Drop in solution to animate RecyclerView's dataset changes by using command pattern
Stars: ✭ 74 (+289.47%)
Mutual labels:  recyclerview
RecyclerViewExtensionsDemo
RecyclerView列表优化方案
Stars: ✭ 45 (+136.84%)
Mutual labels:  recyclerview
Modular2Recycler
Modular²Recycler is a RecyclerView.Adapter that is modular squared.
Stars: ✭ 72 (+278.95%)
Mutual labels:  recyclerview
SmartStickyHeader
A Custom Header View With Multiple Items to make selection from categories
Stars: ✭ 36 (+89.47%)
Mutual labels:  recyclerview
SwipeAndDragRecyclerView
通过 ItemTouchHelper.Callback 实现 RecyclerView Item 的拖拽和侧滑删除
Stars: ✭ 39 (+105.26%)
Mutual labels:  recyclerview
HoveringCallback
Drag & drop item decorator for RecyclerView with support for highlighting hovered items.
Stars: ✭ 15 (-21.05%)
Mutual labels:  recyclerview
Pursuit-Core-Android
Pursuit Core Android
Stars: ✭ 45 (+136.84%)
Mutual labels:  recyclerview
MetalRecyclerPagerView
RecyclerView implementation for Android which makes it look and feel like ViewPager with item margins support (mutliple views effect).
Stars: ✭ 26 (+36.84%)
Mutual labels:  recyclerview
swipeablerecyclerview
SwipeableRecyclerView provides a wrapper class SwipeItemTouchHelperCallback which can be used to add Dragging capability to your RecyclerView items. You can make use of DataBinding to bind it via XML.
Stars: ✭ 16 (-15.79%)
Mutual labels:  recyclerview
Android-HeaderAndFooterRecyclerView
Let RecyclerView support add HeaderView and FooterView.
Stars: ✭ 36 (+89.47%)
Mutual labels:  recyclerview
ZigzagRecyclerView
A library that gives you a slant on the traditional Grid Recycler View ♻️
Stars: ✭ 27 (+42.11%)
Mutual labels:  recyclerview
RollingLayoutManager
vrgsoft.net
Stars: ✭ 57 (+200%)
Mutual labels:  recyclerview

Maven Central

Blueprint

Blueprint is a library that provides a compact framework for constructing mvp architecture within a multi-view type recycling, scrollable list UI. It uses the Android RecyclerView library, and currently only support LinearLayouts

Design

Presenter

There are two presentation layers, the ScreenPresenter, and the ComponentViewPresenter. The ScreenPresenter is repsonsible for creating two things : the list of view types the screen will show (in the correct order), and a map of ComponentViewPresenters, one for each view type in the list

View

There are, analogously, two view layers, the ScreenView and the ComponentViews. The ScreenView's only responsibility is adding and holding the component view types specified by the ScreenPresenter. A ScreenViewDelegate is provided as a default implementation. The ScreenViewDelegate also contains a convenience function for instantiating the Adapter. ComponentViews are POJOs representing the views of the different components. ComponentViews are

ComponentRegistry

Each Component should have a view class that implements ComponentView. The concrete ComponentViews must be registered with a ComponentRegistry that maps ComponentView classes with view types. Optionally, clients can also mark presenters with the annotation @DefaultPresenter, and pass the annotation a ComponentView class to be associated with. ScreenPresenters then only need to specify presenters in the presenterMap if they wish to override the default.

Adapter

The ComponentAdapter is a RecyclerView Adapter that delegates presentation of each item to the appropriate ComponentViewPresenter, based on the view type. To create one, you need a list of view types in order, and a map of ComponentViewPresenters to view types with which to present each view. in onCreateViewHolder, the Adapter queries the ComponentRegistry and instantiates a concrete ComponentView class for the view type, and holds that instance in a List. Then, in onBindViewHolder, the adapter gets the ComponentView class at the bind position, retrieves the ComponentViewPresenter for that ComponentView's view type, and asks the presenter to present the data for that bind position into that ComponentView.

Setup

To use Blueprint, in your project build.gradle add

compile 'com.xfinity:blueprint-library:<version>'
compile 'com.xfinity:blueprint-annotations:<version>'

and either

annotationProcessor "com.xfinity:blueprint-compiler:<version>"

or, if you're using kotlin,

kapt "com.xfinity:blueprint-compiler:<version>"

Usage

Creating Components

After creating your layout, create a view holder class and annotate with @ComponentViewHolder(viewType = R.layout.layout_name)

alt text

Next, create a view class and annotate it with @ComponentViewClass(viewHolderClass = yourViewHolderClass). Blueprint will generate a base class for you, based on your viewholder. If your view class is call MyComponentView, then the generated base class will be called MyComponentViewBase. This class will have auto-generated view control methods, and auto-generated view-holder creation and bind methods. Your view class should extend from your base class, e.g.

MyComponentView extends MyComponentViewBase

The base class will be generated the first time you compile after creating the view class.

alt text

Finally, if you have a model that you wish to use in the component, you can simply extend from ComponentModel. To create your component presenter, you need to extend from ComponentPresenter by passing view and model as Type parameters.

alt text

At this point, the your component presenter should give you the view and model with present(view, model) method.

To display this component, simply add to your screenView in any of your screen presenter.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].