{"id":13642874,"url":"https://github.com/rubengees/easy-header-footer-adapter","last_synced_at":"2026-03-09T07:32:01.140Z","repository":{"id":94425204,"uuid":"69196703","full_name":"rubengees/easy-header-footer-adapter","owner":"rubengees","description":"An Android library which adds headers and footers to the RecyclerView.","archived":false,"fork":false,"pushed_at":"2018-07-23T10:13:34.000Z","size":7203,"stargazers_count":44,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-11T15:50:04.486Z","etag":null,"topics":["adapter","android","footer","header","library","recyclerview"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubengees.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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}},"created_at":"2016-09-25T23:29:58.000Z","updated_at":"2025-06-29T16:19:38.000Z","dependencies_parsed_at":"2023-03-03T19:00:21.767Z","dependency_job_id":null,"html_url":"https://github.com/rubengees/easy-header-footer-adapter","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/rubengees/easy-header-footer-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubengees%2Feasy-header-footer-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubengees%2Feasy-header-footer-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubengees%2Feasy-header-footer-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubengees%2Feasy-header-footer-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubengees","download_url":"https://codeload.github.com/rubengees/easy-header-footer-adapter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubengees%2Feasy-header-footer-adapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30265833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T16:59:11.960Z","status":"ssl_error","status_checked_at":"2026-03-08T16:56:10.879Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["adapter","android","footer","header","library","recyclerview"],"created_at":"2024-08-02T01:01:37.527Z","updated_at":"2026-03-09T07:32:01.102Z","avatar_url":"https://github.com/rubengees.png","language":"Java","funding_links":[],"categories":["RecyclerView"],"sub_categories":[],"readme":"# easy-header-footer-adapter [![Release](https://jitpack.io/v/rubengees/easy-header-footer-adapter.svg)](https://jitpack.io/#rubengees/easy-header-footer-adapter) ![API](https://img.shields.io/badge/API-14%2B-blue.svg) [![CircleCI](https://circleci.com/gh/rubengees/easy-header-footer-adapter.svg?style=shield)](https://circleci.com/gh/rubengees/easy-header-footer-adapter)\n\nAdd a header and/or footer to your `RecyclerView` - the easy way.\n\n![Sample](art/sample.gif)\n\nYou can download the latest sample app [here](https://github.com/rubengees/easy-header-footer-adapter/releases/download/3.0.0/sample-release.apk).\n\n### Features\n\n- Completely hassle-free. You don't have to change your existing implementation.\n- Support for `LinearLayoutManager`, `GridLayoutManager` and `StaggeredGridLayoutManager`.\n- `LayoutParams` of your `View`s are honoured.\n- The `SpanSizeLookup` of your `GridLayoutManager` continues to work without adjustments.\n- Support for stable ids.\n\n### Include in your Project\n\nAdd this to your root `build.gradle` (usually in the root of your project):\n\n```groovy\nrepositories {\n    maven { url \"https://jitpack.io\" }\n}\n```\n\nAnd this to your module `build.gradle` (usually in the `app` directory):\n\n```groovy\ndependencies {\n    compile 'com.github.rubengees:easy-header-footer-adapter:3.0.0@aar'\n}\n```\n\nIf that doesn't work, look if there is a new version and the Readme was not updated yet.\n\n### Usage\n\nThere is almost zero configuration if you already have an adapter.  \nYou wrap your adapter in the `EasyHeaderFooterAdapter` and set it to the `RecyclerView` like this:\n\n```java\nYourAdapter adapter = new YourAdapter();\nEasyHeaderFooterAdapter easyHeaderFooterAdapter = \n                new EasyHeaderFooterAdapter(adapter);\n\n//Always set the LayoutManager BEFORE the adapter.\nrecyclerView.setLayoutManager(new SomeLayoutManager());\nrecyclerView.setAdapter(easyHeaderFooterAdapter);\n```\n\nYou can then set a `header` or `footer` through the `setHeader` and `setFooter` methods:\n\n```java\nheaderFooterAdapter.setHeader(anyView);\nheaderFooterAdapter.setFooter(anotherView);\n```\n\nThose can be removed by setting null to the aforementioned methods:\n\n```java\nheaderFooterAdapter.setHeader(null);\nheaderFooterAdapter.setFooter(null);\n```\n\nAnd that's it! Easy right?\n\nThere are a view things to look out for though.\n\n##### Positions\n\nIf you are using the positions returned by the `ViewHolder`s `getAdapterPosition` method, you have to calculate the real position in your adapter. The method `getRealPosition` does exactly that:\n\n```java\nadapter.setCallback(new MainAdapter.MainAdapterCallback() {\n    @Override\n    public void onItemClick(int position) {\n        int positionInYourDataSet = headerFooterAdapter.getRealPosition(position);\n\n        // Do whatever you wanted to do with it.\n    }\n});\n```\n\nYou can find more info on that in the [sample](sample/src/main/java/com/rubengees/easyheaderfooteradaptersample/MainActivity.java#L58).\n\n##### ViewTypes and Ids\n\nThe following ViewTypes and IDs are used internally, so don't use them yourself:\n\n```java\nTYPE_HEADER = Integer.MIN_VALUE;\nTYPE_FOOTER = Integer.MIN_VALUE + 1;\nID_HEADER = Long.MIN_VALUE;\nID_FOOTER = Long.MIN_VALUE + 1;\n```\n\n##### Changing the `LayoutManager` at runtime\n\nAs the `EasyHeaderFooterAdapter` needs to configure your `LayoutManager`, you have to reset the adapter to the `RecyclerView` if you want to change the `LayoutManager`:\n\n```java\nrecycler.setLayoutManager(new YourNewLayoutManager());\n\n// Remember, always set if after the LayoutManager\nrecycler.setAdapter(headerFooterAdapter);\n```\n\n### Further reading\n\nThe sample features almost all use cases. Have a look [here](sample/src/main/java/com/rubengees/easyheaderfooteradaptersample).  \nYou can find the JavaDoc [here](https://jitpack.io/com/github/rubengees/easy-header-footer-adapter/3.0.0/javadoc/).\n\n### Metrics\n\n\u003ca href=\"http://www.methodscount.com/?lib=com.github.rubengees%3Aeasy-header-footer-adapter%3A3.0.0\"\u003e\u003cimg src=\"https://img.shields.io/badge/Methods and size-83 | 10 KB-e91e63.svg\"/\u003e\u003c/a\u003e\n\n### Contributions and contributors\n\nA guide for contribution can be found [here](.github/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubengees%2Feasy-header-footer-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubengees%2Feasy-header-footer-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubengees%2Feasy-header-footer-adapter/lists"}