{"id":20331225,"url":"https://github.com/comcast/blueprint","last_synced_at":"2026-04-02T15:59:22.984Z","repository":{"id":25103832,"uuid":"103149221","full_name":"Comcast/blueprint","owner":"Comcast","description":"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","archived":false,"fork":false,"pushed_at":"2023-07-18T19:40:46.000Z","size":753,"stargazers_count":21,"open_issues_count":13,"forks_count":15,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-11T21:08:15.527Z","etag":null,"topics":["android","recyclerview"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/Comcast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-11T14:53:42.000Z","updated_at":"2024-02-12T01:15:06.000Z","dependencies_parsed_at":"2024-11-14T20:29:30.735Z","dependency_job_id":null,"html_url":"https://github.com/Comcast/blueprint","commit_stats":null,"previous_names":["comcast/rmvp"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Comcast/blueprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fblueprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fblueprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fblueprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fblueprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Comcast","download_url":"https://codeload.github.com/Comcast/blueprint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fblueprint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261756747,"owners_count":23205157,"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","recyclerview"],"created_at":"2024-11-14T20:19:19.650Z","updated_at":"2026-04-02T15:59:22.952Z","avatar_url":"https://github.com/Comcast.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central][mavenbadge-svg]][mavencentral]\n\n# Blueprint\nBlueprint is a library that provides a compact framework for constructing mvp architecture within a multi-view type recycling, scrollable\nlist UI.  It uses the Android RecyclerView library, and currently only support LinearLayouts\n\n## Design\n\n### Presenter\nThere are two presentation layers, the ScreenPresenter, and the ComponentViewPresenter.  The ScreenPresenter is repsonsible for creating two things : the list of \n  view types the screen will show (in the correct order), and a map of ComponentViewPresenters, one for each\n   view type in the list\n   \n### View\nThere are, analogously, two view layers, the ScreenView and the ComponentViews.  The ScreenView's only responsibility is\nadding and holding the component view types specified by the ScreenPresenter.  A ScreenViewDelegate is provided as a default\nimplementation.  The ScreenViewDelegate also contains a convenience function for instantiating the Adapter.  ComponentViews are POJOs\nrepresenting the views of the different components.  ComponentViews are \n\n### ComponentRegistry\nEach Component should have a view class that implements ComponentView.  The concrete ComponentViews must be registered with\na ComponentRegistry that maps ComponentView classes with view types.  Optionally, clients can also mark presenters with the\nannotation @DefaultPresenter, and pass the annotation a ComponentView class to be associated with.  ScreenPresenters then only\nneed to specify presenters in the presenterMap if they wish to override the default.\n\n### Adapter\nThe ComponentAdapter is a RecyclerView Adapter that delegates presentation of each item to the appropriate ComponentViewPresenter, \nbased on the view type.  To create one, you need a list of view types in order, and a map of ComponentViewPresenters to view types \nwith which to present each view.  in onCreateViewHolder, the Adapter queries the ComponentRegistry and instantiates a concrete\n ComponentView class for the view type, and holds that instance in a List.  Then, in onBindViewHolder, the adapter gets the ComponentView class\n at the bind position, retrieves the ComponentViewPresenter for that ComponentView's view type, and asks the presenter to\n present the data for that bind position into that ComponentView. \n\n   \n### Setup\n\nTo use Blueprint, in your project build.gradle add\n\n```xml\ncompile 'com.xfinity:blueprint-library:\u003cversion\u003e'\ncompile 'com.xfinity:blueprint-annotations:\u003cversion\u003e'\n```\n\nand either\n\n```xml\nannotationProcessor \"com.xfinity:blueprint-compiler:\u003cversion\u003e\"\n```\n\nor, if you're using kotlin,\n```xml\nkapt \"com.xfinity:blueprint-compiler:\u003cversion\u003e\"\n```\n\n[mavenbadge-svg]: https://maven-badges.herokuapp.com/maven-central/com.xfinity/blueprint-library/badge.svg\n[mavencentral]: https://search.maven.org/artifact/com.xfinity/blueprint-library\n\n### Usage\n\n#### Creating Components\nAfter creating your layout, create a view holder class and annotate with @ComponentViewHolder(viewType = R.layout.layout_name) \n\n![alt text](https://github.com/Comcast/blueprint/blob/mrtvrgn-doc-v2/layout_viewHolder.PNG)\n\nNext, 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. \n\n```java\nMyComponentView extends MyComponentViewBase\n```\n\nThe base class will be generated the first time you compile after creating the view class.\n\n![alt text](https://github.com/Comcast/blueprint/blob/mrtvrgn-doc-v2/viewClass.PNG)\n\nFinally, 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.\n\n![alt text](https://github.com/Comcast/blueprint/blob/mrtvrgn-doc-v2/componentModel.PNG)\n\nAt this point, the your component presenter should give you the view and model with present(view, model) method.\n\nTo display this component, simply add to your screenView in any of your screen presenter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fblueprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomcast%2Fblueprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fblueprint/lists"}