Android library for fluid tablayout animation as seen on Snapchat.
SnapTabLayout 
Show some :heart: and star the repo to support the project
This library is the implementation of TabLayout as seen on popular messaging app Snapchat Snapchat.com.
It can be used to animate Three or Five tabs.
๐ Demo
Contents
- Installation - How to use / Sample - Customization - Bugs and feedback๐ป Installation
implementation 'com.fridayof1995.tabanimation:SnapTablayout:0.0.7'
โ Usage
Step 1
<com.fridayof1995.tabanimation.SnapTabLayout
android:id="@+id/tabLayout"
android:layoutwidth="matchparent"
android:layoutheight="wrapcontent"
android:layout_alignParentBottom="true"
.
.
custom:numOfTabs="three"
/>
Step 2
- ### Tab Number (Required)
setNumOfTabs(SnapTabLayout.NumOfTabs.THREE);
or
setNumOfTabs(SnapTabLayout.NumOfTabs.FIVE);
- ### Setting the icons (Required)
tabLayout.smallCenterButton.setImageResource()
tabLayout.largeCenterButton.setImageResource()
tabLayout.startButton.setImageResource()
tabLayout.endButton.setImageResource()
//Below required only when using five tabs. tabLayout.midStart.setImageResource() tabLayout.midEnd.setImageResource()
๐ Customization
- ### Background (Optional)
tabLayout.setBackgroundCollapsed(R.drawable.tabgradientcollapsed) // By default black fall gradient.
tabLayout.setBackgroundExpanded(R.drawable.tabgradientexpanded)
- ### Color Transition in Icons (Optional)
// When the layout moves from expanded to collapsed: Icons color transitions from white to black.
tabLayout.setTransitionIconColors(R.color.white, R.color.black)
- ### Color Transition in ViewPager Background (Optional)
tabLayout.setVpTransitionBgColors(LeftSideColor: android.R.color.holo_purple
, CenterColor: android.R.color.black
, RightSideColor: android.R.color.holoorangedark)
Bugs and Feedback
For bugs, feature requests, and discussion please use GitHub Issues.
๐จ Developed By
Niranjan Kurambhatti
๐ License
Copyright 2018 Niranjan Kurambhatti
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.