{"id":20457535,"url":"https://github.com/takwolf/android-headerandfooterrecyclerview","last_synced_at":"2025-04-13T05:23:23.755Z","repository":{"id":90053689,"uuid":"92882038","full_name":"TakWolf/Android-HeaderAndFooterRecyclerView","owner":"TakWolf","description":"Let RecyclerView support add header and footer views","archived":false,"fork":false,"pushed_at":"2025-03-22T20:24:06.000Z","size":609,"stargazers_count":42,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-22T21:31:24.562Z","etag":null,"topics":["android","footerview","headerview","recyclerview"],"latest_commit_sha":null,"homepage":"","language":"Java","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/TakWolf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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-05-30T22:36:08.000Z","updated_at":"2025-03-22T20:24:10.000Z","dependencies_parsed_at":"2023-10-02T15:31:28.873Z","dependency_job_id":"c658b568-b807-4ddc-a054-fa2b58f8b6f7","html_url":"https://github.com/TakWolf/Android-HeaderAndFooterRecyclerView","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TakWolf%2FAndroid-HeaderAndFooterRecyclerView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TakWolf%2FAndroid-HeaderAndFooterRecyclerView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TakWolf%2FAndroid-HeaderAndFooterRecyclerView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TakWolf%2FAndroid-HeaderAndFooterRecyclerView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TakWolf","download_url":"https://codeload.github.com/TakWolf/Android-HeaderAndFooterRecyclerView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248666929,"owners_count":21142345,"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","footerview","headerview","recyclerview"],"created_at":"2024-11-15T12:07:45.165Z","updated_at":"2025-04-13T05:23:23.738Z","avatar_url":"https://github.com/TakWolf.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android - HeaderAndFooterRecyclerView\n\n[![Platform](https://img.shields.io/badge/platform-Android-brightgreen)](https://developer.android.com)\n[![API](https://img.shields.io/badge/API-21%2B-brightgreen)](https://android-arsenal.com/api?level=21)\n[![License](https://img.shields.io/github/license/TakWolf/Android-HeaderAndFooterRecyclerView)](https://www.apache.org/licenses/LICENSE-2.0)\n[![JitPack](https://jitpack.io/v/TakWolf/Android-HeaderAndFooterRecyclerView.svg)](https://jitpack.io/#TakWolf/Android-HeaderAndFooterRecyclerView)\n\n`RecyclerView` 添加 `HeaderView` 和 `FooterView` 的解决方案。\n\n拥有如下特性：\n\n- 对业务 `Adapter` 无侵入，也不需要额外的包装 `Adapter`。\n- `HeaderView` 和 `FooterView` 直接挂载在 `RecyclerView` 上，无需手动处理重用问题。\n- 支持 `LinearLayoutManager`、`GridLayoutManager` 和 `StaggeredGridLayoutManager` 三种布局管理器的横向和纵向布局。\n- 支持多个 `HeaderView` 和 `FooterView`，并且可以动态添加和删除。\n- 支持动态切换 `Adapter` 和 `LayoutManager`。\n- 额外提供分页组件，方便快速实现「下拉刷新」和「加载更多」功能。\n\n## Usage\n\n```kotlin\nrepositories { \n    maven { setUrl(\"https://jitpack.io\") }\n}\n\ndependencies {\n    implementation(\"androidx.core:core-ktx:1.15.0\")\n    implementation(\"androidx.recyclerview:recyclerview:1.4.0\")\n    implementation(\"com.github.TakWolf.Android-HeaderAndFooterRecyclerView:hfrecyclerview:0.0.18\")\n    // 可选。分页组件。\n    implementation(\"org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.1\")\n    implementation(\"androidx.lifecycle:lifecycle-common:2.8.7\")\n    implementation(\"androidx.swiperefreshlayout:swiperefreshlayout:1.1.0\")\n    implementation(\"com.github.TakWolf.Android-HeaderAndFooterRecyclerView:paging:0.0.18\")\n}\n```\n\n```xml\n\u003ccom.takwolf.android.hfrecyclerview.HeaderAndFooterRecyclerView\n    android:id=\"@+id/recycler_view\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\" /\u003e\n```\n\n```kotlin\nval recyclerView = findViewById\u003cHeaderAndFooterRecyclerView\u003e(R.id.recycler_view)\nrecyclerView.layoutManager = LinearLayoutManager(context)\nrecyclerView.adapter = adapter\n        \nval headerView = layoutInflater.inflate(R.layout.header, recyclerView.headerViewContainer, false)\nrecyclerView.addHeaderView(headerView)\n        \nval footerView = layoutInflater.inflate(R.layout.footer, recyclerView.footerViewContainer, false)\nrecyclerView.addFooterView(footerView)\n```\n\n## License\n\n```\nCopyright 2022 TakWolf\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakwolf%2Fandroid-headerandfooterrecyclerview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakwolf%2Fandroid-headerandfooterrecyclerview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakwolf%2Fandroid-headerandfooterrecyclerview/lists"}