All Projects → creageek → un-material-tab

creageek / un-material-tab

Licence: Apache-2.0 license
(deprecated) Custom tab layout which can be used as a material TabLayout alternative and contains basic functionality which Google's TabLayout has.

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to un-material-tab

Animatedtablayout
Yet another android tab layout
Stars: ✭ 572 (+589.16%)
Mutual labels:  tabs, tablayout
Jpagerslidingtabstrip
🔥A useful tablayout modify from astuetz/PagerSlidingTabStrip
Stars: ✭ 233 (+180.72%)
Mutual labels:  custom-view, tablayout
Material-BottomBarLayout
🎉A material navigation bar library which has pretty animations and different ways of arrangement.
Stars: ✭ 56 (-32.53%)
Mutual labels:  tabs, tablayout
Apporder
骚操作之改造TabLayout,修改指示线宽增加切Tab过渡动画
Stars: ✭ 246 (+196.39%)
Mutual labels:  custom-view, tablayout
Labelsview
Android的标签列表控件。可以设置标签的选中效果。 可以设置标签的选中类型:不可选中、单选、限数量多选和不限数量多选等, 并支持设置必选项、单行显示、最大显示行数等功能。
Stars: ✭ 777 (+836.14%)
Mutual labels:  tabs, custom-view
Android Tablayouthelper
A small library which helps to use TabLayout with ViewPager more easily.
Stars: ✭ 181 (+118.07%)
Mutual labels:  tabs, tablayout
PagerSlidingTabStrip
An interactive indicator to navigate between the different pages of a ViewPager
Stars: ✭ 2,194 (+2543.37%)
Mutual labels:  tabs, tablayout
SquaresLoadingView
A SquaresLoadingView based on android.View, nicely rotation、easy to use.
Stars: ✭ 26 (-68.67%)
Mutual labels:  custom-view
flasto
A FLoating ASsistive TOuch library for android!
Stars: ✭ 15 (-81.93%)
Mutual labels:  custom-view
GlueTabLayout
能精确修改TabLayout的下划线指示器的宽度,能使用粘动动画。
Stars: ✭ 39 (-53.01%)
Mutual labels:  tablayout
react-native-viewpager-carousel
a flexible viewpager library with carousel functionality
Stars: ✭ 39 (-53.01%)
Mutual labels:  tabs
YuanaItemSettingView
Customizable Item Setting View Android
Stars: ✭ 15 (-81.93%)
Mutual labels:  custom-view
MenuPopupView
一款仿iOS长按菜单弹窗的自定义控件
Stars: ✭ 26 (-68.67%)
Mutual labels:  custom-view
multilayout
一个可以支持自动将分类标签拆分多行Tab标签的Layout
Stars: ✭ 14 (-83.13%)
Mutual labels:  tablayout
SocialOrbitLayout
Kotlin based custom view to show floating objects that can be used for social apps.
Stars: ✭ 28 (-66.27%)
Mutual labels:  custom-view
tabs
Guitar tabs transcribed by me, primarily in the stoner/doom/sludge metal genres... plus a few random other things.
Stars: ✭ 34 (-59.04%)
Mutual labels:  tabs
nova-tabs
Another Laravel Nova Tabs Package
Stars: ✭ 60 (-27.71%)
Mutual labels:  tabs
SoundLine
An Android custom view which offers an audio timeline controller as the SoundCloud Sound Wave
Stars: ✭ 53 (-36.14%)
Mutual labels:  custom-view
react-native-paper-tabs
Smooth and fast cross platform Material Design Tabs for React Native Paper
Stars: ✭ 112 (+34.94%)
Mutual labels:  tabs
AACustomFont
[UNMAINTAINED] AACustomFont is a lightweight custom font binder in XML directly in TextView, Button, EditText, RadioButton, CheckBox tags. The library is aimed to avoid custom views for custom fonts in XML and to minimize the JAVA code for setting the TypeFaces for each view.
Stars: ✭ 76 (-8.43%)
Mutual labels:  custom-view

(deprecated) un-material-tab library

I don't have time to maintain this. I basically wrote this small library in a rush, without tests, while working on my own project as a beginner. As a result, there's a lot of things that aren't that great as well as the missing features. Don't really know if I would have some time to finish it completely.

I'd recommend you to use the official TabLayout from Google or another 3rd party library.

If someone wants to pick up where I left off, make a fork of this, notify me and I'll link to your repo here.


A customizable alternative of TabLayout from Support Design library which provides almost the same functionality.

Currently working on

  • RoundTabLayout#onTabSelected & RoundTabLayout#onTabReselected callbacks
  • reducing number of GPU view updates
  • new tab animations

If you have any suggestions - feel free to open an issue.

How to add?

I. In your build.gradle file add the following dependency:

dependencies {
    compile 'com.ruslankishai:unmaterialtabs:0.1a'
}

II. Declare RoundTabLayout inside your layout.xml file:

<com.ruslankishai.unmaterialtab.tabs.RoundTabLayout
            android:id="@+id/round_tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/colorPrimary"
            app:accent="@color/colorAccent" />

III. Declare RoundTabLayout with ViewPager in your 'class.java':

ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);

//set adapter to your ViewPager
viewPager.setAdapter(new TabPagerAdapter(getFragmentManager()));

RoundTabLayout tabLayout = (RoundTabLayout) findViewById(R.id.roundTabLayout);
tabLayout.setupWithViewPager(viewPager);

IV. Override you getPageTitle method in your ViewPager’s adapter to return tab title.

@Override
public CharSequence getPageTitle(int position) {  
     switch (position) {
          case 0:
               return "First item";
          ...
     }
}

How to customize?

I. In your layout.xml file you can set a few attributes to RoundedTabLayout:

  • android:background
    • This attribute works just like usual background attribute (reference to a color).
  • app:accent
    • This attribute allows you to set accent color for tab selection, stroke and text (reference to a color).
  • app:cornerRadius
    • This attribute sets the tab corner radius. Possible values are:
      • circle (default)
      • rounded
      • rectangle
      • value in px from 0 to 50

II. In your class.java you can set some values to customize specific tab:

  • Use RoundTab#setIcon method to change icon. You can get RoundTab object via RoundTabLayout#getTab method which accept tab index as parameter. To enable tab icon, you should also use RoundTab#setHasIcon.
//after initializing RoundTabLayout and ViewPager
RoundTab tab = tabLayout.getTab(0);
Drawable icon = getResources().getDrawable(R.drawable.globe);
tab.setIcon(icon);
//enable icon in current tab
tab.setHasIcon(true);

//repeat this code for another tabs
  • To disable tab stroke use RoundTab#setHasStroke method.
//after initializing RoundTabLayout and ViewPager
RoundTab tab = tabLayout.getTab(0);
tab.setHasStroke(true);
…
  • To change corners radius use RoundTab#setCornerRadius which accept values from 0 to 50 as a parameter.
//after initializing RoundTabLayout and ViewPager
RoundTab tab = tabLayout.getTab(0);
tab.setCornerRadius(35);
…
  • To change tab text use RoundTab#setText which accept String as a parameter.
//after initializing RoundTabLayout and ViewPager
RoundTab tab = tabLayout.getTab(0);
tab.setText(“Usage example”);
…

Where is un-material-tab demo app?

The app works just as an example of usage with different options. Will be uploaded to Play Store sooner.

What about contributions?

This is my first public repo and first library so I’m trying to keep this code as much clean and well-commented as I can. Feel free to contribute :)

License

Copyright (C) 2017 Ruslan Kishai

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