{"id":3508,"url":"https://github.com/nshmura/RecyclerTabLayout","last_synced_at":"2025-08-03T20:32:33.162Z","repository":{"id":35499686,"uuid":"39769418","full_name":"nshmura/RecyclerTabLayout","owner":"nshmura","description":"An efficient TabLayout library implemented with RecyclerView.","archived":false,"fork":false,"pushed_at":"2019-08-29T15:28:38.000Z","size":6405,"stargazers_count":1360,"open_issues_count":13,"forks_count":222,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-08-16T14:34:43.138Z","etag":null,"topics":[],"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/nshmura.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-27T10:44:25.000Z","updated_at":"2024-08-16T06:10:38.000Z","dependencies_parsed_at":"2022-09-12T13:01:54.745Z","dependency_job_id":null,"html_url":"https://github.com/nshmura/RecyclerTabLayout","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nshmura%2FRecyclerTabLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nshmura%2FRecyclerTabLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nshmura%2FRecyclerTabLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nshmura%2FRecyclerTabLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nshmura","download_url":"https://codeload.github.com/nshmura/RecyclerTabLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228567009,"owners_count":17937983,"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":[],"created_at":"2024-01-05T20:16:43.521Z","updated_at":"2024-12-07T05:30:34.739Z","avatar_url":"https://github.com/nshmura.png","language":"Java","funding_links":[],"categories":["TabBar","Java","Libraries"],"sub_categories":["GUI"],"readme":"# RecyclerTabLayout\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-RecyclerTabLayout-green.svg?style=flat)](https://android-arsenal.com/details/1/2220)\n\nAn efficient TabLayout library implemented with RecyclerView.\n\n## Features\n- Efficient when having many tabs\n- Easy setup with ViewPager (same as [TabLayout](http://developer.android.com/intl/ja/reference/android/support/design/widget/TabLayout.html) of Android Design Support Library)\n- RTL layout support\n\n## UseCase\n- Many tabs layout\n- Infinite loop scrolling (imitated)\n\n\n## Demos\n![Years](art/years.gif)\n\n![Loop](art/loop.gif)\n\n![Basic](art/basic.gif)\n\n![Icon](art/icon.gif)\n\n\n## Samples\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.nshmura.recyclertablayout.demo\"\u003e\u003cimg src=\"art/googleplay.png\"/\u003e\u003c/a\u003e\n\n## Getting started\nIn your build.gradle:\n\n```\nrepositories {\n    jcenter()\n}\n\ndependencies {\n   compile 'com.nshmura:recyclertablayout:1.5.0'\n}\n```\n\nDefine `RecyclerTabLayout` in xml layout with custom attributes.\n```xml\n\u003ccom.nshmura.recyclertablayout.RecyclerTabLayout\n        android:id=\"@+id/recycler_tab_layout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"48dp\"\n        rtl_tabIndicatorColor=\"?attr/colorAccent\"\n        rtl_tabIndicatorHeight=\"2dp\"\n        rtl_tabBackground=\"?attr/selectableItemBackground\"\n        rtl_tabTextAppearance=\"@android:style/TextAppearance.Small\"\n        rtl_tabSelectedTextColor=\"?android:textColorPrimary\"\n        rtl_tabMinWidth=\"72dp\"\n        rtl_tabMaxWidth=\"264dp\"\n        rtl_tabPaddingStart=\"12dp\"\n        rtl_tabPaddingTop=\"0dp\"\n        rtl_tabPaddingEnd=\"12dp\"\n        rtl_tabPaddingBottom=\"0dp\"\n        rtl_tabPadding=\"0dp\"/\u003e\n```\n\nSet up with the ViewPager.\n```java\nViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);\nviewPager.setAdapter(adapter);\n\nRecyclerTabLayout recyclerTabLayout = (RecyclerTabLayout) findViewById(R.id.recycler_tab_layout);\nrecyclerTabLayout.setUpWithViewPager(viewPager);\n```\n\nOr set up with ViewPager and Custom RecyclerView.Adapter that's extends `RecyclerTabLayout.Adapter`.\n```java\nViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);\nviewPager.setAdapter(adapter);\n\nRecyclerTabLayout recyclerTabLayout = (RecyclerTabLayout) findViewById(R.id.recycler_tab_layout);\nrecyclerTabLayout.setUpWithAdapter(new CustomRecyclerViewAdapter(viewPager));\n```\n\nHere's sample of custom RecyclerView adapter.\n```java\npublic class CustomRecyclerViewAdapter extends RecyclerTabLayout.Adapter\u003cCustomRecyclerViewAdapter.ViewHolder\u003e {\n\n    public DemoCustomView01Adapter(ViewPager viewPager) {\n        super(viewPager);\n        ...\n    }\n\n    @Override\n    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n        // Inflate your view.\n        View view = ...;\n        return new ViewHolder(view);\n    }\n\n    @Override\n    public void onBindViewHolder(ViewHolder holder, int position) {\n        // Bind data\n        ...\n        \n        if (position == getCurrentIndicatorPosition()) {\n            //Highlight view\n        }\n    }\n\n    public class ViewHolder extends RecyclerView.ViewHolder {\n        ...\n        \n        public ViewHolder(View itemView) {\n            super(itemView);\n        ...\n        }\n    }\n}\n```\n\n\n## Attributes\n| attr  | description |\n| ------------- | ------------- |\n| rtl_tabIndicatorColor    | Indicator color |\n| rtl_tabIndicatorHeight   | Indicator height | \n| rtl_tabBackground        | Background drawable of each tab |\n| rtl_tabTextAppearance    | TextAppearence of each tab |\n| rtl_tabSelectedTextColor | Text color of selected tab |\n| rtl_tabOnScreenLimit     | The number of OnScreen tabs. If this value is larger than 0, `rtl_tabMinWidth` and `rtl_tabMaxWidth` are ignored. |\n| rtl_tabMinWidth          | Minimum width of each tab |\n| rtl_tabMaxWidth          | Maximum width of each tab |\n| rtl_tabPaddingStart      | The padding of the start edge of each tab |\n| rtl_tabPaddingTop        | The padding of the top edge of each tab  |\n| rtl_tabPaddingEnd        | The padding of the end edge of each tab  |\n| rtl_tabPaddingBottom     | The padding of the bottom edge of each tab |\n| rtl_tabPadding           | The padding of all four edges of each tab |\n| rtl_scrollEnabled        | Sets whether tab scrolling is enabled |\n\n[default attribute](library/src/main/res/values/styles.xml)\n\n\n## Thanks\nThe demo app uses the following resources.\n\ncolor-names by codebrainz\u003cbr/\u003e\nhttps://github.com/codebrainz/color-names\n\nMaterial Design icons by Google\u003cbr/\u003e\nhttps://github.com/google/material-design-icons\n\n## License\n```\nCopyright (C) 2017 nshmura\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\nhttp://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%2Fnshmura%2FRecyclerTabLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnshmura%2FRecyclerTabLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnshmura%2FRecyclerTabLayout/lists"}