Home

Awesome

TabView for Android

License API Download

Demos

Setup

Maven:

<dependency>
  <groupId>com.dsiner.lib</groupId>
  <artifactId>tabview</artifactId>
  <version>1.0.2</version>
</dependency>

or Gradle:

compile 'com.dsiner.lib:tabview:1.0.2'

Usage

    <com.d.lib.tabview.TabView
        android:id="@+id/tabv_tab"
        android:layout_width="365dp"
        android:layout_height="36dp"
        app:tabv_colorMain="#4577B7"
        app:tabv_colorSub="#ffffff"
        app:tabv_duration="250"
        app:tabv_padding="2px"
        app:tabv_textSize="14dp"
        app:tabv_title="TAB1;TAB2;TAB3;TAB4" />

Operation

app:tabv_title指定标题(或代码中设置标题,如下)
        tabView.setTitle(new String[]{"TAB1", "TAB2", "TAB3", "TAB4"});
其他参数都具有默认值(可选)

SetListener(可选)

        tabView.setOnTabSelectedListener(new TabView.OnTabSelectedListener() {
            @Override
            public void onTabSelected(int index) {
                
            }
        });

Parameter

AttrsTypeFunction
tabv_titlestring标题(各个标题以";"分隔)
tabv_textSizedimension标题文字大小
tabv_colorMaincolor主颜色
tabv_colorSubcolor辅颜色
tabv_paddingdimension边框宽度
tabv_paddingSidedimension两端预留间距
tabv_durationinteger动画时长(ms)

More usage see Demo

Licence

Copyright 2017 D

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.