• Stars
    star
    187
  • Rank 200,110 (Top 5 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 9 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A small library which helps to use TabLayout with ViewPager more easily.

TabLayoutHelper

A small library which helps to use TabLayout with ViewPager more easily.

Maven Central Android Arsenal


  • Automatically switch TabLayout.MODE_FIXED and TabLayout.MODE_SCROLLABLE depends on total tab width.
  • Easily to implement custom tab views

Example app

Target platforms

  • API level 14 or later

Latest version

  • Version 1.0.0 (September 24, 2018)

Getting started

This library is published on Maven Central. Just add these lines to build.gradle.

dependencies {
    implementation 'com.h6ah4i.android.tablayouthelper:tablayouthelper:1.0.0'
}

NOTE

  • Since v1.0.0, this library has been migrated to AndroidX. If you still need to use support libraries, use v0.9.1 instead.

Usage

ViewPager viewPager = (ViewPager) findViewById(...);
TabLayout tabLayout = (TabLayout) findViewById(...);
PagerAdapter adapter = new XXXPagerAdapter();

viewPager.setAdapter(adapter);

// initialize the TabLayoutHelper instance
mTabLayoutHelper = new TabLayoutHelper(tabLayout, viewPager);

// [Optional] enables auto tab mode adjustment
mTabLayoutHelper.setAutoAdjustTabModeEnabled(true);

License

This library is licensed under the Apache Software License, Version 2.0.

See LICENSE for full of the license text.

Copyright (C) 2015 Haruki Hasegawa

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.

More Repositories

1

android-advancedrecyclerview

RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)
Java
5,304
star
2

android-verticalseekbar

Vertical SeekBar class which supports Android 4.x - 9.x.
Java
504
star
3

android-materialshadowninepatch

Provides 9-patch based drop shadow for view elements. Works on API level 9 or later.
Java
482
star
4

android-openslmediaplayer

Re-implementation of Android's MediaPlayer and audio effect classes based on OpenSL ES APIs.
Java
415
star
5

android-scrollableviewpagercontent

Prioritize ViewPager's horizontal swipe action over vertical scroll action of inner contents
Java
39
star
6

mulsellistprefcompat

Backport MultiSelectListPreference class to older android devices
Java
32
star
7

cxxdasp

"cxxdasp" : Digital Audio Signal Processing library for C++
C++
31
star
8

RecyclerViewiOSMailAppLikeSwipe

A simple demo app how to implement iOS Mail app like swipe action
Java
20
star
9

android-numberpickercompat

Backport Material Design NumberPicker widget
Java
7
star
10

android-numberpickerprefcompat

A Preference widget with NumberPicker dialog. Works on API level 14+ devices.
Java
6
star
11

ARVExpandableGridLayout

GridLayoutManager + RecyclerViewExpandableItemManager demo app
Java
5
star
12

tunnel_player_workaround

This sample code shows how to avoid the Tunnel Player, and get visualizer work on Galaxy S4.
Java
3
star
13

MusicVisualizerTaskerPlugin

Official Music Visualizer plugin for integrating with Tasker automation utility app.
Kotlin
2
star
14

AnimatedVectorDrawableCompatProGuardIssue

Java
2
star
15

android-colortransitiondrawable

A Drawable class which supports color transition animation
Java
2
star
16

android-arduino-fullcolorled

Android + Arduino test program (Full color LED controls)
Shell
2
star
17

cxxporthelper

"cxxporthelper": Portable code helper library for C++.
C++
2
star
18

openslescxx

Provides C++ friendly wrapped OpenSL ES APIs
C++
1
star
19

FlexibleSpaceHeaderWithAdvancedRecyclerView

Java
1
star
20

Media2Experiment

Simple demo app using the new androidx.media2's MediaPlayer
Kotlin
1
star
21

DaydreamServiceLeakCheck

Bug check code for "Issue 73652: DreamService instance leaked due to inner DreamServiceWrapper class"
Groovy
1
star
22

MusicVisualizerAPI

Official Intent based API for the Music Visualizer app.
Java
1
star
23

NdkCxxdaspSkeltonApp

Demo Android Studio project integrated with cxxdasp library
Makefile
1
star
24

SwipeableWithSectionRecyclerViewDemo

Java
1
star
25

liblfds-android

Unofficial utility to build liblfds for Android
Shell
1
star
26

mkninepatch

Simple 9-patch image file generator command line tool
Python
1
star