{"id":13395874,"url":"https://github.com/jpardogo/PagerSlidingTabStrip","last_synced_at":"2025-03-13T22:31:08.575Z","repository":{"id":22188389,"uuid":"25520515","full_name":"jpardogo/PagerSlidingTabStrip","owner":"jpardogo","description":"An interactive indicator to navigate between the different pages of a ViewPager","archived":false,"fork":true,"pushed_at":"2019-10-16T11:33:41.000Z","size":25520,"stargazers_count":2189,"open_issues_count":13,"forks_count":354,"subscribers_count":80,"default_branch":"master","last_synced_at":"2024-10-01T11:41:13.402Z","etag":null,"topics":["android","android-library","tab","tablayout","tabs","viewpager"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mozuck/PagerSlidingTabStrip","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpardogo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2014-10-21T12:18:56.000Z","updated_at":"2024-09-25T10:51:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jpardogo/PagerSlidingTabStrip","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpardogo%2FPagerSlidingTabStrip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpardogo%2FPagerSlidingTabStrip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpardogo%2FPagerSlidingTabStrip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpardogo%2FPagerSlidingTabStrip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpardogo","download_url":"https://codeload.github.com/jpardogo/PagerSlidingTabStrip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221417229,"owners_count":16816837,"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-library","tab","tablayout","tabs","viewpager"],"created_at":"2024-07-30T18:00:34.618Z","updated_at":"2024-10-25T10:30:51.990Z","avatar_url":"https://github.com/jpardogo.png","language":"Java","funding_links":[],"categories":["Index `(light-weight pages)`","Java","Index"],"sub_categories":[],"readme":"# Android PagerSlidingTabStrip (default Material Design)\n\n**This library is not maintained anymore and there will be no further releases. For most of the cases you can use [TabLayout](https://developer.android.com/reference/com/google/android/material/tabs/TabLayout) instead of this library.**\n\nInteractive paging indicator widget, compatible with the `ViewPager` from the\nAndroid Support Library.\n\n![PagerSlidingTabStrip Sample Material](https://raw.githubusercontent.com/jpardogo/PagerSlidingTabStrip/master/art/material_tabs.gif) ------\n![PagerSlidingTabStrip Sample Material](https://raw.githubusercontent.com/jpardogo/PagerSlidingTabStrip/master/art/material_tabs_middle.gif)\n\n# Usage\n\nFor a working implementation of this project see the `sample/` folder.\n\n1. Include the following dependency in your `build.gradle` file.\n\n```groovy\ncompile 'com.jpardogo.materialtabstrip:library:1.1.1'\n```\n\nOr add the library as a project. I tried to send a pull request, but looks like the original developer doesn't maintain it anymore.\n\n2. Include the `PagerSlidingTabStrip` widget in your layout. This should usually be placed above the `ViewPager` it represents.\n\n```xml\n\u003ccom.astuetz.PagerSlidingTabStrip\n    android:id=\"@+id/tabs\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"?attr/actionBarSize\"\n    android:background=\"?attr/colorPrimary\" /\u003e\n```\n\n3. In your `onCreate` method (or `onCreateView` for a fragment), bind the widget to the `ViewPager`:\n\n```java\n// Initialize the ViewPager and set an adapter\nViewPager pager = (ViewPager) findViewById(R.id.pager);\npager.setAdapter(new TestAdapter(getSupportFragmentManager()));\n\n// Bind the tabs to the ViewPager\nPagerSlidingTabStrip tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);\ntabs.setViewPager(pager);\n```\n\n### That's all you need to do, but if you want to use your own tabs, then...\n\n1. If your adapter implements the interface `CustomTabProvider` you can paste your custom tab view/s.\n\n     - In case the the view returned contains the id `R.id.psts_tab_title`, this view should be a `TextView`  and\n     will be used to placed the title and set the view state (pressed/selected/default).\n\n     - If you don't want the library manage your TextView title for the tab, use a different id than `R.id.psts_tab_title` in your tab layout.\n\n     - The interface provide callbacks for selection and unselection of tabs as well.\n\n     - If your adapter doesn't implement the interface `CustomTabProvider` the default tab will be used, which is a `TextView` with id `R.id.psts_tab_title`).\n\n2. *(Optional)* If you use an `OnPageChangeListener` with your view pager\n     you should set it in the widget rather than on the pager directly.\n\n```java\n// continued from above\ntabs.setOnPageChangeListener(mPageChangeListener);\n```\n\n# Customization\n\nFrom theme:\n\n * `android:textColorPrimary` value (from your theme) will be applied automatically to the tab's text color (Selected tab with 255 alpha and non selected tabs with 150 alpha), underlineColor, dividerColor and indicatorColor, if the values are not defined on the xml layout.\n\nNotes about some of the native attributes:\n\n * `android:paddingLeft` or `android:paddingRight` layout padding. If you apply both, they should be balanced. Check issue [#69](https://github.com/jpardogo/PagerSlidingTabStrip/pull/69) for more information.\n\nCustom attributes:\n\n * `pstsIndicatorColor` Color of the sliding indicator. `textColorPrimary` will be it's default color value.\n * `pstsIndicatorHeight`Height of the sliding indicator.\n * `pstsUnderlineColor` Color of the full-width line on the bottom of the view. `textColorPrimary` will be it's default color value.\n * `pstsUnderlineHeight` Height of the full-width line on the bottom of the view.\n * `pstsDividerColor` Color of the dividers between tabs. `textColorPrimary` will be it's default color value.\n * `pstsDividerWidth` Stroke width of divider line, defaults to 0.\n * `pstsDividerPadding` Top and bottom padding of the dividers.\n * `pstsShouldExpand` If set to true, each tab is given the same weight, default false.\n * `pstsScrollOffset` Scroll offset of the selected tab.\n * `pstsPaddingMiddle` If true, the tabs start at the middle of the view (Like Newsstand google app).\n * `pstsTabPaddingLeftRight` Left and right padding of each tab.\n * `pstsTabBackground` Background drawable of each tab, should be a StateListDrawable.\n * `pstsTabTextSize` Tab text size (sp).\n * `pstsTabTextColor` Tab text color that can either be a color (text color won't changed) or a selector with a color per state: pressed (tab pressed), selected (tab active), default (active non active). The order of states in the selector is important. Check issue [#68](https://github.com/jpardogo/PagerSlidingTabStrip/pull/70) for more information.\n * `pstsTabTextStyle` Set the text style, default normal on API 21, bold on older APIs.\n * `pstsTabTextAllCaps` If true, all tab titles will be upper case, default true.\n * `pstsTabTextAlpha` Set the text alpha transparency for non selected tabs. Range 0..255. 150 is it's default value. It **WON'T** be used if `pstsTabTextColor` is defined in the layout. If `pstsTabTextColor` is **NOT** defined, It will be applied to the non selected tabs.\n * `pstsTabTextFontFamily` Set the font family name. Default `sans-serif-medium` on API 21, `sans-serif` on older APIs.\n\nAlmost all attributes have their respective getters and setters to change them at runtime. To change dynamically `pstsTabTextFontFamily` and  `pstsTabTextStyle` you can call:\n\n * `public void setTypeface(Typeface typeface, int style)`. It can be used to define custom fonts in default tabs. Otherwise you can use custom tabs with `CustomTabProvider`.\n\nPlease open an issue if you find any are missing.\n\n# Developed By\n\n * Javier Pardo de Santayana Gomez - [jpardogo.com](http://www.jpardogo.com) - \u003cjpardogo@gmail.com\u003e\n * Andreas Stuetz - \u003candreas.stuetz@gmail.com\u003e\n * And contributors.\n\n# Contributions\n\n * Please, read the README file before opening an issue, thanks.\n * Please, all the Pull Request must be sent to the dev branch, thanks..\n\n# Credits\n\n * [Kirill Grouchnikov](https://plus.google.com/108761828584265913206/posts) - Author of [an explanation post on Google+](https://plus.google.com/108761828584265913206/posts/Cwk7joBV3AC)\n\n# License\n\n    Copyright 2013 Andreas Stuetz\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpardogo%2FPagerSlidingTabStrip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpardogo%2FPagerSlidingTabStrip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpardogo%2FPagerSlidingTabStrip/lists"}