{"id":18465153,"url":"https://github.com/natario1/elements","last_synced_at":"2025-04-08T08:31:47.634Z","repository":{"id":55940263,"uuid":"135832866","full_name":"natario1/Elements","owner":"natario1","description":"⚒ Modular components for RecyclerView development enforcing clean, reusable and testable code, with built-in support for paging and complex hierarchies of data.","archived":false,"fork":false,"pushed_at":"2020-12-05T16:40:20.000Z","size":1561,"stargazers_count":82,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T09:24:37.167Z","etag":null,"topics":["android","android-paging-library","android-recycler","android-recyclerview","android-recyclerview-pagination","architecture-components","kotlin","kotlin-android","list","livedata","livedata-databinding","pagination","recyclerview","recyclerview-adapter","recyclerview-header","recyclerview-section"],"latest_commit_sha":null,"homepage":"https://natario1.github.io/Elements","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/natario1.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["natario1"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-06-02T16:13:34.000Z","updated_at":"2024-03-22T05:12:02.000Z","dependencies_parsed_at":"2022-08-15T10:00:20.867Z","dependency_job_id":null,"html_url":"https://github.com/natario1/Elements","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natario1%2FElements","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natario1%2FElements/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natario1%2FElements/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natario1%2FElements/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/natario1","download_url":"https://codeload.github.com/natario1/Elements/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247804548,"owners_count":20999010,"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","android-paging-library","android-recycler","android-recyclerview","android-recyclerview-pagination","architecture-components","kotlin","kotlin-android","list","livedata","livedata-databinding","pagination","recyclerview","recyclerview-adapter","recyclerview-header","recyclerview-section"],"created_at":"2024-11-06T09:12:09.298Z","updated_at":"2025-04-08T08:31:46.095Z","avatar_url":"https://github.com/natario1.png","language":"Kotlin","funding_links":["https://github.com/sponsors/natario1","https://github.com/sponsors/natario1)!"],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/natario1/Elements/workflows/Build/badge.svg?event=push)](https://github.com/natario1/Elements/actions)\n[![Release](https://img.shields.io/github/release/natario1/Elements.svg)](https://github.com/natario1/Elements/releases)\n[![Issues](https://img.shields.io/github/issues-raw/natario1/Elements.svg)](https://github.com/natario1/Elements/issues)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/static/banner.png\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n*Need support, consulting, or have any other business-related question? Feel free to \u003ca href=\"mailto:mat.iavarone@gmail.com\"\u003eget in touch\u003c/a\u003e.*\n\n*Like the project, make profit from it, or simply want to thank back? Please consider [sponsoring me](https://github.com/sponsors/natario1)!*\n\n# Elements\n\nA collection of modular elements for `RecyclerView` lists, alternative to\n[Google's Paging library](https://developer.android.com/topic/libraries/architecture/paging/), designed in Kotlin with these goals in mind:\n\n```kotlin\nimplementation(\"com.otaliastudios:elements:0.5.0\")\n```\n\nDesign features:\n\n- Separation of concerns: we split the model component into `Source`s, and the UI component into `Presenter`s. [[docs]](https://natario1.github.io/Elements/docs/sources)\n- Simplicity: No need to extend Adapters, ViewHolders or all that Paging lib. boilerplate.\n- Reusability: as a result, each `Source` and `Presenter` is an independent piece of code that can be reused.\n- Modularity: let the adapter accept multiple `Source`s and `Presenter`s. [[docs]](https://natario1.github.io/Elements/docs/adapter)\n- Testability: a consequence of the above, each component can be independently tested.\n- Coordination: let `Source`s declare dependencies among them, in a `CoordinatorLayout.Behavior` fashion. [[docs]](https://natario1.github.io/Elements/docs/coordination)\n- Paging: built-in concept of `Page`. [[docs]](https://natario1.github.io/Elements/docs/pagination)\n- Integration with Arch components: heavy use of `LiveData` and `Lifecycle`s, extensions for data binding.\n- Animations: give `Presenters`s fine grained control over how to animate each item [[docs]](https://natario1.github.io/Elements/docs/animations)\n\nIf you are curious about how it works in practice, take a look at the sample app in the `app` module.\n\n\u0026#10240;  \u003c!-- Hack to add whitespace --\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/static/screenshot-1.png\" width=\"250\" hspace=\"15\"\u003e\u003cimg src=\"docs/static/screenshot-2.png\" width=\"250\" hspace=\"15\"\u003e\u003cimg src=\"docs/static/screenshot-3.png\" width=\"250\" hspace=\"15\"\u003e\n\u003c/p\u003e\n\n\u0026#10240;  \u003c!-- Hack to add whitespace --\u003e\n\n## Support\n\nIf you like the project, make profit from it, or simply want to thank back, please consider\n[sponsoring me](https://github.com/sponsors/natario1) through the GitHub Sponsors program!\nYou can have your company logo here, get private support hours or simply help me push this forward.\n\nFeel free to \u003ca href=\"mailto:mat.iavarone@gmail.com\"\u003econtact me\u003c/a\u003e for support, consulting or any\nother business-related question.\n\n## Setup\n\nPlease read the [official website](https://natario1.github.io/Elements/home) for setup instructions and documentation.\nYou might also be interested in our [changelog](https://natario1.github.io/Elements/about/changelog). After migrating  \nto Elements, your code will look like the examples below.\n\nSimplest single-paged list:\n\n```kotlin\nval data = listOf(\"Monday\", \"Tuesday\", \"Wednesday\", \"Friday\", \"Saturday\", \"Sunday\")\nAdapter.builder(lifecycle)\n    .addSource(Source.fromList(data))\n    .addPresenter(Presenter.simple(context, R.layout.item, { view, day -\u003e view.text = day }))\n    .into(recyclerView)\n```\n\nPaged list with multiple sources and presenters, headers, ads, error/empty indicators and progress bars:\n\n```kotlin\nAdapter.builder(lifecycle)\n    .addSource(ContactsSource()) // Add a paged list of contacts\n    .addSource(ContactsHeaderSource()) // Add the letters A, B, C as a header\n    .addSource(AdSource(5)) // Add some ads each 5 items\n    .addPresenter(ContactsPresenter(context))\n    .addPresenter(ContactsHeaderPresenter(context))\n    .addPresenter(AdPresenter(context))\n    .addPresenter(Presenter.forLoadingIndicator(context, R.layout.loading))\n    .addPresenter(Presenter.forErrorIndicator(context, R.layout.error))\n    .addPresenter(Presenter.forEmptyIndicator(context, R.layout.empty))\n    .into(recyclerView)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatario1%2Felements","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatario1%2Felements","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatario1%2Felements/lists"}