{"id":17987492,"url":"https://github.com/iammert/tabscrollattacher","last_synced_at":"2025-03-25T22:32:04.174Z","repository":{"id":52160107,"uuid":"225558728","full_name":"iammert/TabScrollAttacher","owner":"iammert","description":"Attach TabLayout and RecyclerView. Useful for categorizing RecyclerView items.","archived":false,"fork":false,"pushed_at":"2021-05-12T07:22:39.000Z","size":9401,"stargazers_count":234,"open_issues_count":3,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-20T21:13:57.491Z","etag":null,"topics":["attacher","kotlin","recyclerview","tablayout"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iammert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-03T07:35:51.000Z","updated_at":"2024-11-17T23:30:59.000Z","dependencies_parsed_at":"2022-08-28T15:52:36.775Z","dependency_job_id":null,"html_url":"https://github.com/iammert/TabScrollAttacher","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FTabScrollAttacher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FTabScrollAttacher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FTabScrollAttacher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FTabScrollAttacher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iammert","download_url":"https://codeload.github.com/iammert/TabScrollAttacher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245555068,"owners_count":20634667,"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":["attacher","kotlin","recyclerview","tablayout"],"created_at":"2024-10-29T19:08:57.971Z","updated_at":"2025-03-25T22:32:03.599Z","avatar_url":"https://github.com/iammert.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/iammert/TabScrollAttacher/blob/master/art/artgif.gif\"\u003e\n\u003c/p\u003e\n\n## What? 🤔\nIt is not a custom `TabLayout` or `RecyclerView`. It is just a helper library to attach to your `RecyclerView` with your `TabLayout`. If you don't want to go with sticky header `RecyclerView` or something like that, and also want to provide a good experience when your user is scrolling the content, this small library is for you.\n\n## How? 🤨\n\nYou fetch your product list and their categories. All you need to do is calcualate start index for all categories. Attacher will do the rest.\n\nIf your backend guy returns this json,\n```json\nCategoryA -\u003e 10 items (between 0..10)\nCategoryB -\u003e 20 items (between 10..30)\nCategoryC -\u003e 30 items (between 30..60)\n```\n\nThen your offset list will be,\n\n```kotlin\n//3 tabs and their offset indexes in total list.\nval categoryIndexOffsetList = [0,10,30]\n```\n\n## Then? 🙄\n\nThen you attach.\n```kotlin\nval attacher = TabScrollAttacher(tabLayout, recyclerView, categoryIndexOffsetList)\nattacher.attach()\n```\n\nDetach when you don't need anymore.\n```kotlin\nattacher.detach()\n```\n\n## Configure? 🧑‍🔧\n\n* `scrollDirectly()`: If you don't want to see the scrolling process, use it.\n* `scrollSmoothly()`: If you want to see the flowing items while scrolling, this is for you.\n* `scrollSmoothly(limit = 10)`: If you have a lot of items and smooth scrolling takes too long, you can set a scrolling item limit. It will scroll directly until the `limit` items left, then rest of the items will scroll smoothly.\n```kotlin\nTabScrollAttacher(tabLayout, recyclerView, categoryIndexOffsetList) {\n    // Configuration\n}\n```\n\n## Where? 🤩\n\n```gradle\nmaven { url 'https://jitpack.io' }\n```\n\n```gradle\ndependencies {\n  compile 'com.github.iammert:TabScrollAttacher:1.0.2'\n}\n```\n\n## When? 😇\n\nWhen you have `LinearLayoutManager`, `GridLayoutManager` in any orientation (horizontal or vertical) you can use this library.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/iammert/TabScrollAttacher/master/art/1.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/iammert/TabScrollAttacher/master/art/2.png\"\u003e\n\u003c/p\u003e\n\n## Who? 👻\n\nLicense\n--------\n\n\n    Copyright 2019 Mert Şimşek\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiammert%2Ftabscrollattacher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiammert%2Ftabscrollattacher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiammert%2Ftabscrollattacher/lists"}