Coder Social home page Coder Social logo

tabview's Introduction

TabView

supports vertical and horizontal tab style.

Requirements

TabView can be included in any Android application. TabView supports OS on API 15 and above.

include

  • TabView
  • VerticalTabView
  • TabBaseAdapter
  • SimpleTabAdapter
  • SimpleVerticalTabAdapter

Using TabView in your Application

If you are building with Gradle, simply add the following line to the dependencies section of your build.gradle file:

complie 'com.github.looa:TabView:1.0.0'

Sample

screenshots  sreenshots-02

xml

<org.looa.tabview.widget.TabView
        android:id="@+id/tab_simple"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:background="#efeff0"
        android:overScrollMode="never"
        android:scrollbars="none" />

java

        List<String> data = new ArrayList<>();

        data.add("Google");
        data.add("Facebook");
        data.add("Alibaba");
        data.add("Tencent");
        data.add("Microsoft");
        data.add("Baidu");
        data.add("Yahoo");
        data.add("Ebay");
        data.add("Amazon");
        data.add("Magic Leap");

        TabView tabView = (TabView) findViewById(R.id.tab_simple);
        tabView.setSmoothShowEdgeSizeOff(100);
        tabView.setBashLineColor(Color.LTGRAY);
        tabView.setTopLineColor(Color.LTGRAY);
        
        SimpleTabAdapter adapter = new SimpleTabAdapter(getApplicationContext());
        adapter.setData(data);
        adapter.setColorSelected(getResources().getColor(R.color.colorPrimary));

        tabView.setAdapter(adapter);
        /**
        * auto fill parent.
        **/
        tabView.setAutoFillParent(true);
        tabView.setTabCurPosition(0, false);

        //tabView已经实现了OnPageChangeListener
        viewPager.addOnPageChangeListener(tabView);

and you can create your adapter to demand your requirements ↓↓↓

public class SimpleTabAdapter extends TabBaseAdapter{

  protected View onCreateTabView(ViewGroup parentView, int viewType, int position){
    //create the tab view.
  }

  protected View onCreateCursor(View viewParent) {
    //create the cursor, if you need.
    return null;
  }

  protected void onSelectedTabView(View tabView, int position, boolean isSmooth){
    //the tabView is selected.
  }

  protected void resetTabView(View tabView, int position){
    //init or reset your tab view'values.
  }

}

tabview's People

Contributors

looa avatar

Stargazers

Tesla-1i avatar

Watchers

James Cloos avatar  avatar Tesla-1i avatar

Forkers

tesla-1i

tabview's Issues

some recommandations

  • May be Iterator & Page as two components in one View?
  • delete .idea
  • lib project should set "xxxx.library" in project gradle and delete Activity in folder & in Manifest.xml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.