Skip to content

Extended Android Tab Layout with animated indicators that have continuous feedback.

License

Notifications You must be signed in to change notification settings

CuteAndroid/Dachshund-Tab-Layout

 
 

Repository files navigation

Dachshund Tab Layout

License: MIT

Logo

Introduction

Boosted Android Tab Layout with custom animated indicators including "Dachshund" animation inspired by this.

Sample

Available Animated Indicators

Indicator Example Custom behavior
DachshundIndicator
PointMoveIndicator setInterpolator(TimeInterpolator interpolator)
LineMoveIndicator setEdgeRadius(int edgeRadius)
PointFadeIndicator
LineFadeIndicator setEdgeRadius(int edgeRadius)

Installation

Step 1

Add the JitPack repository to your build file

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Step 2

Add the dependency

	dependencies {
		compile 'com.github.Andy671:Dachshund-Tab-Layout:v0.3.0'
	}

Usage

DachshundTabLayout 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.

Add DachshundTabLayout to xml (after the Toolbar in the AppBarLayout), if you have TabLayout simply replace it:

 <android.support.design.widget.AppBarLayout
 ...
	<android.support.v7.widget.Toolbar           
	.../>
	<com.kekstudio.dachshundtablayout.DachshundTabLayout
		android:id="@+id/tab_layout"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"/>

Setup it with a ViewPager:

	DachshundTabLayout tabLayout = (DachshundTabLayout) findViewById(R.id.tab_layout);
	tabLayout.setupWithViewPager(yourViewPager);

If you want to change animated indicator (see Available Animated Indicators):

	//AvailableAnimatedIndicator - change it with available animated indicator

	AvailableAnimatedIndicator indicator = new AvailableAnimatedIndicator(tabLayout);
	tabLayout.setAnimatedIndicator(indicator);

XML Attributes

Attribute Type Default
ddIndicatorHeight dimension 6dp
ddIndicatorColor color Color.WHITE
ddAnimatedIndicator enum [dachshund, pointMove, lineMove] dachshund

Contribution

  • Feel free to fork the repo, make pull requests or fix existing bug
  • Feel free to open issues if you find some bug or unexpected behaviour

Buy me a cup of coffee

Bitcoin Wallet: 15BuUMAW2jUdStPVkoNPt85P8tJnAy5vD4

About

Extended Android Tab Layout with animated indicators that have continuous feedback.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%