All Projects → Andy671 → Dachshund Tab Layout

Andy671 / Dachshund Tab Layout

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

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Dachshund Tab Layout

Customfloatingactionbutton
This view is for replacement of standard Floating Action Button from Google Support Library. It is easy to use, customizable and you can also add text to button
Stars: ✭ 222 (-73.97%)
Mutual labels:  android-development, view, android-ui
Textwriter
Animate your texts like never before
Stars: ✭ 140 (-83.59%)
Mutual labels:  android-development, view, android-ui
recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (-85.46%)
Mutual labels:  view, android-development, android-ui
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+548.65%)
Mutual labels:  android-development, view, android-ui
Slidingrootnav
DrawerLayout-like ViewGroup, where a "drawer" is hidden under the content view, which can be shifted to make the drawer visible.
Stars: ✭ 2,939 (+244.55%)
Mutual labels:  android-development, view, android-ui
Musicindicator
Music indicator for Android. Easy to use. 🎧 ✨
Stars: ✭ 475 (-44.31%)
Mutual labels:  android-development, android-ui
Happybubble
💭BubbleLayout随意变化的气泡布局、消息对话框,可定制颜色,背景、弧度、尖角弧度、边框等等。BubbleDialog气泡弹窗根据点击View的位置定位它的弹窗位置,BubbleDialog可定制方向等!(BubbleLayout changes freely,BubbleDialog click on the location of View positioning its location,BubbleDialog can be customized directions.)
Stars: ✭ 487 (-42.91%)
Mutual labels:  view, android-ui
Cookiebar2
Android library for displaying text messages, notifications and alerts at the top or bottom of the screen. A great alternative for toast and snackbar alerts.
Stars: ✭ 499 (-41.5%)
Mutual labels:  android-development, android-ui
Alerter
An Android Alerting Library
Stars: ✭ 5,213 (+511.14%)
Mutual labels:  android-development, android-ui
Awesome Android Ui
😎 A curated list of awesome Android UI/UX libraries
Stars: ✭ 353 (-58.62%)
Mutual labels:  android-development, android-ui
Android Arsenal.com
Source to android-arsenal.herokuapp.com
Stars: ✭ 541 (-36.58%)
Mutual labels:  android-development, android-ui
Android Customtoast
Easy to use Custom Toast Library for Android
Stars: ✭ 24 (-97.19%)
Mutual labels:  android-development, android-ui
Freepager
ViewPagers library for Android
Stars: ✭ 461 (-45.96%)
Mutual labels:  view, android-ui
Drawer Behavior
Drawer behavior is a library that provide an extra behavior on drawer, such as, move view or scaling view's height while drawer on slide.
Stars: ✭ 394 (-53.81%)
Mutual labels:  android-development, android-ui
Android Ecosystem Cheat Sheet
🤖Android Ecosystem Cheatsheet 2020
Stars: ✭ 488 (-42.79%)
Mutual labels:  android-development, android-ui
Themed Toggle Button Group
Customisable toggle buttons inside a FlexboxLayout.
Stars: ✭ 357 (-58.15%)
Mutual labels:  android-development, android-ui
Superbottomsheet
Android native BottomSheet on steroids 💪
Stars: ✭ 548 (-35.76%)
Mutual labels:  android-development, android-ui
Music Player Go
🎶🎼 Very slim music player 👨‍🎤 100% made in Italy 🍕🌳🌞🍝🌄
Stars: ✭ 654 (-23.33%)
Mutual labels:  android-development, android-ui
Motiontoast
🌈 A Beautiful Motion Toast Library for Kotlin Android
Stars: ✭ 767 (-10.08%)
Mutual labels:  android-development, android-ui
Animatedbottombar
A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.
Stars: ✭ 797 (-6.57%)
Mutual labels:  animations, android-ui

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.3'
	}

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);

Center align

In v0.3.2 I've added ddCenterAlign parameter. You can use it when you want to center the tabs in scrollable tabMode. Working behavior from Stackoverflow question.

<com.kekstudio.dachshundtablayout.DachshundTabLayout
		...
		custom:tabMode="scrollable"
		custom:ddCenterAlign="true"/>

Creating custom AnimatedIndicator

If 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):

public class CustomIndicator implements AnimatedIndicatorInterface, ValueAnimator.AnimatorUpdateListener {

    private DachshundTabLayout dachshundTabLayout;

    public CustomIndicator(DachshundTabLayout dachshundTabLayout){
        this.dachshundTabLayout = dachshundTabLayout;

    	//here set-up your Animators, Paints etc.
    }

    @Override
    public void onAnimationUpdate(ValueAnimator animator) {
    	// when animator updates - invalidate your canvas, and draw what you want.
    }

    @Override
    public void setSelectedTabIndicatorColor(@ColorInt int color) {
        // customization of color
    }

    @Override
    public void setSelectedTabIndicatorHeight(int height) {
        // customization of height
    }

    @Override
    public void setIntValues(int startXLeft, int endXLeft,
                             int startXCenter, int endXCenter,
                             int startXRight, int endXRight){
        // X-positions of the target and current tabs
    }

    @Override
    public void setCurrentPlayTime(long currentPlayTime) {
        // current play time of the animation
    }

    @Override
    public void draw(Canvas canvas) {
        //Make your draw calls here
    }

    @Override
    public long getDuration() {
        return DEFAULT_DURATION;
    }
}

XML Attributes

Attribute Type Default
ddIndicatorHeight dimension 6dp
ddIndicatorColor color Color.WHITE
ddAnimatedIndicator enum [dachshund, pointMove, lineMove, pointFade, lineFade] 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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].