{"id":15040885,"url":"https://github.com/andy671/dachshund-tab-layout","last_synced_at":"2025-04-04T09:07:50.269Z","repository":{"id":201755025,"uuid":"81678443","full_name":"Andy671/Dachshund-Tab-Layout","owner":"Andy671","description":"Extended Android Tab Layout with animated indicators that have continuous feedback.","archived":false,"fork":false,"pushed_at":"2022-09-07T10:54:43.000Z","size":164,"stargazers_count":852,"open_issues_count":6,"forks_count":90,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-04T09:07:45.596Z","etag":null,"topics":["android","android-development","android-layout","android-library","android-ui","animations","java","view"],"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/Andy671.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}},"created_at":"2017-02-11T19:58:21.000Z","updated_at":"2025-03-21T06:23:09.000Z","dependencies_parsed_at":"2023-11-10T13:05:56.675Z","dependency_job_id":null,"html_url":"https://github.com/Andy671/Dachshund-Tab-Layout","commit_stats":null,"previous_names":["andy671/dachshund-tab-layout"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andy671%2FDachshund-Tab-Layout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andy671%2FDachshund-Tab-Layout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andy671%2FDachshund-Tab-Layout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andy671%2FDachshund-Tab-Layout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Andy671","download_url":"https://codeload.github.com/Andy671/Dachshund-Tab-Layout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149501,"owners_count":20891954,"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-development","android-layout","android-library","android-ui","animations","java","view"],"created_at":"2024-09-24T20:45:14.234Z","updated_at":"2025-04-04T09:07:50.247Z","avatar_url":"https://github.com/Andy671.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dachshund Tab Layout\n[![](https://img.shields.io/badge/minSDK-15-brightgreen.svg)](https://developer.android.com/training/basics/supporting-devices/platforms.html)\n[![](https://jitpack.io/v/Andy671/Dachshund-Tab-Layout.svg)](https://jitpack.io/#Andy671/Dachshund-Tab-Layout)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n# ![Logo](https://raw.githubusercontent.com/Andy671/Dachshund-Tab-Layout/master/dachshund_logo.png)\n\n## Introduction\nBoosted Android Tab Layout with custom animated indicators including \"Dachshund\" animation inspired by [this](https://material.uplabs.com/posts/tab-interaction).\n\n## Sample\n![](http://i.giphy.com/1VVYHwT4OFf6U.gif)\n\n## Available Animated Indicators\n| Indicator         \t|  Example | Custom behavior |\n|--------------------- \t|--------------------------------| ----- |\n| DachshundIndicator \t| ![](http://i.giphy.com/115nZIzHqsDpcI.gif) | |\n| PointMoveIndicator\t|![](http://i.giphy.com/yK9y4NcPH7wNa.gif)  | setInterpolator(TimeInterpolator interpolator) |\n| LineMoveIndicator \t| ![](http://i.giphy.com/rzvsTmlUOod0I.gif) | setEdgeRadius(int edgeRadius)|\n| PointFadeIndicator\t| ![](http://i.giphy.com/nQZYOyfYH7gJy.gif)  | |\n| LineFadeIndicator \t| ![](http://i.giphy.com/PHUmWmrM0O7YI.gif) | setEdgeRadius(int edgeRadius)|\n\n###\n\n## Installation\n\n### Step 1\nAdd the JitPack repository to your build file\n```gradle\n\tallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n\n### Step 2\nAdd the dependency\n```gradle\n\tdependencies {\n\t\tcompile 'com.github.Andy671:Dachshund-Tab-Layout:v0.3.3'\n\t}\n```\n\n# Usage\nDachshundTabLayout is a subclass of TabLayout, so usage is pretty similar. The most of the original methods should work without any problems. See sample and source code for more info.\n\nAdd DachshundTabLayout to xml (after the Toolbar in the AppBarLayout), if you have TabLayout simply replace it:\n```xml\n \u003candroid.support.design.widget.AppBarLayout\n ...\n\t\u003candroid.support.v7.widget.Toolbar           \n\t.../\u003e\n\t\u003ccom.kekstudio.dachshundtablayout.DachshundTabLayout\n\t\tandroid:id=\"@+id/tab_layout\"\n\t\tandroid:layout_width=\"match_parent\"\n\t\tandroid:layout_height=\"wrap_content\"/\u003e\n```\n\nSetup it with a ViewPager:\n```java\n\tDachshundTabLayout tabLayout = (DachshundTabLayout) findViewById(R.id.tab_layout);\n\ttabLayout.setupWithViewPager(yourViewPager);\n```\n\nIf you want to change animated indicator (see **Available Animated Indicators**):\n```java\n\t//AvailableAnimatedIndicator - change it with available animated indicator\n\n\tAvailableAnimatedIndicator indicator = new AvailableAnimatedIndicator(tabLayout);\n\ttabLayout.setAnimatedIndicator(indicator);\n```\n\n## Center align\nIn **v0.3.2** I've added **ddCenterAlign** parameter. You can use it when you want to center the tabs in **scrollable** tabMode.\nWorking behavior from [Stackoverflow](https://stackoverflow.com/questions/33191794/android-tablayout-with-active-tab-always-at-center-just-like-in-play-newsstand) question.\n```xml\n\u003ccom.kekstudio.dachshundtablayout.DachshundTabLayout\n\t\t...\n\t\tcustom:tabMode=\"scrollable\"\n\t\tcustom:ddCenterAlign=\"true\"/\u003e\n```\n\n## Creating custom AnimatedIndicator\nIf you want to create your own custom AnimatedIndicator - you can implement AnimatedIndicatorInterface and if you want to use animators - AnimatorUpdateListener (See JavaDoc of AnimatedIndicatorInterface for more info):\n```java\npublic class CustomIndicator implements AnimatedIndicatorInterface, ValueAnimator.AnimatorUpdateListener {\n\n    private DachshundTabLayout dachshundTabLayout;\n\n    public CustomIndicator(DachshundTabLayout dachshundTabLayout){\n        this.dachshundTabLayout = dachshundTabLayout;\n\n    \t//here set-up your Animators, Paints etc.\n    }\n\n    @Override\n    public void onAnimationUpdate(ValueAnimator animator) {\n    \t// when animator updates - invalidate your canvas, and draw what you want.\n    }\n\n    @Override\n    public void setSelectedTabIndicatorColor(@ColorInt int color) {\n        // customization of color\n    }\n\n    @Override\n    public void setSelectedTabIndicatorHeight(int height) {\n        // customization of height\n    }\n\n    @Override\n    public void setIntValues(int startXLeft, int endXLeft,\n                             int startXCenter, int endXCenter,\n                             int startXRight, int endXRight){\n        // X-positions of the target and current tabs\n    }\n\n    @Override\n    public void setCurrentPlayTime(long currentPlayTime) {\n        // current play time of the animation\n    }\n\n    @Override\n    public void draw(Canvas canvas) {\n        //Make your draw calls here\n    }\n\n    @Override\n    public long getDuration() {\n        return DEFAULT_DURATION;\n    }\n}\n```\n\n\n## XML Attributes\n| Attribute        \t| Type                | Default     |\n| ----------------------|:-------------------:| :-----------|\n| ddIndicatorHeight   \t| dimension           | 6dp \t    |\n| ddIndicatorColor    \t| color               | Color.WHITE |\n| ddAnimatedIndicator \t| enum [dachshund, pointMove, lineMove, pointFade, lineFade] | dachshund |\n\n## Contribution\n- Feel free to fork the repo, make pull requests or fix existing bug\n- Feel free to open issues if you find some bug or unexpected behaviour\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandy671%2Fdachshund-tab-layout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandy671%2Fdachshund-tab-layout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandy671%2Fdachshund-tab-layout/lists"}