All Projects → cats-oss → Android Tab Animation

cats-oss / Android Tab Animation

Licence: apache-2.0
Easily create TabLayout.Tab animations that sync with the scrolling progress of ViewPager

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Android Tab Animation

Whatsappviewpager
Swipeable tabs like WhatsApp in Android
Stars: ✭ 115 (+69.12%)
Mutual labels:  viewpager, tablayout
PagerSlidingTabStrip
An interactive indicator to navigate between the different pages of a ViewPager
Stars: ✭ 2,194 (+3126.47%)
Mutual labels:  viewpager, tablayout
ViewWorld
自定义View合集,展示各种自定义View/控件。项目包含了自定义Banner轮播图控件,自定义验证码输入框,自定义TabLayout等控件,持续更新中😉😉😉
Stars: ✭ 94 (+38.24%)
Mutual labels:  viewpager, tablayout
Magicindicator
A powerful, customizable and extensible ViewPager indicator framework. As the best alternative of ViewPagerIndicator, TabLayout and PagerSlidingTabStrip —— 强大、可定制、易扩展的 ViewPager 指示器框架。是ViewPagerIndicator、TabLayout、PagerSlidingTabStrip的最佳替代品。支持角标,更支持在非ViewPager场景下使用(使用hide()、show()切换Fragment或使用setVisibility切换FrameLayout里的View等),http://www.jianshu…
Stars: ✭ 8,969 (+13089.71%)
Mutual labels:  viewpager, tablayout
Viewpagerhelper
这个一个 viewpager/viewpager2工具类,能够帮你快速实现导航栏轮播图,app引导页,viewpager/viewpager2 + fragment;内置多种tab指示器,让你告别 viewpager 的繁琐操作,专注逻辑功能
Stars: ✭ 957 (+1307.35%)
Mutual labels:  viewpager, tablayout
UltimateTabLayout
A library for tab layout use with viewpager. Very useful, small
Stars: ✭ 33 (-51.47%)
Mutual labels:  viewpager, tablayout
Material-BottomBarLayout
🎉A material navigation bar library which has pretty animations and different ways of arrangement.
Stars: ✭ 56 (-17.65%)
Mutual labels:  viewpager, tablayout
multilayout
一个可以支持自动将分类标签拆分多行Tab标签的Layout
Stars: ✭ 14 (-79.41%)
Mutual labels:  viewpager, tablayout
Changetablayout
[停止维护]一款炫酷的TabLayout
Stars: ✭ 345 (+407.35%)
Mutual labels:  viewpager, tablayout
Flowhelper
帮助您迅速构建顶部Tab,比如今日头条效果,热搜、搜索记录、与ViewPager/ViewPager2搭配的工具类;
Stars: ✭ 295 (+333.82%)
Mutual labels:  viewpager, tablayout
Funtablayout
An efficient tablayout for Android with added FUN!
Stars: ✭ 20 (-70.59%)
Mutual labels:  viewpager, tablayout
Dsltablayout
♥️ Android界最万能的TabLayout(不仅仅是TabLayout), 支持任意类型的item, 支持Drawable类型的指示器,智能开启滚动,支持横竖向布局等
Stars: ✭ 489 (+619.12%)
Mutual labels:  viewpager, tablayout
Snaptablayout
Android library for fluid tablayout animation as seen on Snapchat.
Stars: ✭ 547 (+704.41%)
Mutual labels:  viewpager, tablayout
Adaptablebottomnavigation
A simpler way for implementing the Bottom Navigation View on Android
Stars: ✭ 844 (+1141.18%)
Mutual labels:  viewpager
Concentriconboarding
Android Concentric Onboarding library
Stars: ✭ 42 (-38.24%)
Mutual labels:  viewpager
Multisearchview
Yet another built-in animated search view for Android.
Stars: ✭ 837 (+1130.88%)
Mutual labels:  tablayout
React Native Viewpager
ViewPager and Indicator component for react-native on both android and ios.
Stars: ✭ 921 (+1254.41%)
Mutual labels:  viewpager
Viewpagertransformer
Viewpager动画,包括渐变,旋转,缩放,3D,立方体等多种酷炫效果动画,实现原理是自定义ViewpagerTransformer,当然你也可以自定义多种动画
Stars: ✭ 62 (-8.82%)
Mutual labels:  viewpager
Legacytableview
simple light weight android library for displaying tabulated data
Stars: ✭ 39 (-42.65%)
Mutual labels:  tablayout
Materialdesignsamples
Material Design 系列控件samples,讲了Material Design 系列新控件的使用方法和一些场景示例,使用详情请看对应博客,持续更新中...
Stars: ✭ 900 (+1223.53%)
Mutual labels:  tablayout

Tab Animation

License Release CI

Easily create TabLayout.Tab animations that sync with the scrolling progress of ViewPager.

Features

  • Animate Tab when scrolling ViewPager
  • Animate Tab after selected/unselected
  • Support ViewPager and ViewPager2
  • Create animations with DSL

Demo

Tab Indicator Bottom Navigation

Usage

Gradle

implementation 'jp.co.cyberagent.android:tab-animation:x.y.z'

Step 1

Create animation info for Tab:

val animationInfo = viewIdAnimationInfo {
  animateText<Float> {
    property(View.SCALE_X)
    startValue(0.8f)
    endValue(1f)
  }
  animateText<Float> {
    property(View.SCALE_Y)
    startValue(0.8f)
    endValue(1f)
  }
}

Step 2

Link the TabLayout, ViewPager and animation info:

// TabLayout extension function
tabLayout.setupAnimationTabWithViewPager(
  viewPager,
  animationInfo,
  SimpleTab.TEXT
)

Advanced Usage

Custom tab view

Provide the layout file id instead of SimpleTab:

tabLayout.setupAnimationTabWithViewPager(
  viewPager,
  animationInfo,
  R.layout.my_custom_tab
) { tab, view, position ->
  // bind data here
}

Custom animate target

Specify the target id in viewIdAnimationInfo:

viewIdAnimationInfo {
  animate<MyView, Float>(R.id.my_view) {
    ...
  }
}

Custom property

// Create tint property
animateIcon<ColorStateList> {
  property(
    getter = { ImageViewCompat.getImageTintList(this)!! },
    setter = { ImageViewCompat.setImageTintList(this, it) }
  )
  ...
}

Custom evaluator

Current support property types:

  • Int (ARGB)
  • Float
  • IntArray
  • FloatArray
  • PointF
  • Rect
  • ColorStateList

You must specify the evaluator if the property type you want to animate is not listed:

animate<MyView, MyType> {
  evaluator(MyEvaluator)
  ...
}

Specify KeyFrames

animateText<Float> {
  property(View.ALPHA)
  startValue(0f)
  endValue(1f)
  keyFrame(0.8f, 0.2f)
}

Lazy value

Animation info will be evaluated after the layout of Tab. You can calculate the value based on the view:

animateIcon<Float> {
  property(View.TRANSLATION_X)
  startValue { view ->
    view.width / 2f
  }
  endValue { 0f }
}

License

Copyright 2019 CyberAgent, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].