--ADVERTISEMENT--

A skeleton of google's appcompat android navigation drawer with material design.

Lollipop AppCompat Skeleton

Compatible to work on 4.0+
Based on Google IO, makes easier for developers to add features from the app.
Features include:
  • FAB
  • Google+ Progress Dialog
  • CardView
  • AppCompat Switch
  • Tint EditText
  • Tint CheckBox
  • Tint RadioButton
  • Toolbar Tabs
  • TextViewCompat
  • SnackBar
  • Drawer Layout
  • Bezel ImageView
  • Lollipop's New swipe down to refresh

DEMO:

alt text

Download From GitHub

Navigation Drawer Activity with material design style and simplified methods.

MaterialNavigationDrawer

It requires 10+ API and android support v7 (Toolbar)

How to import

Add this to your build.gradle:
repositories {
    mavenCentral()
}

dependencies {
    compile 'it.neokree:MaterialNavigationDrawer:1.3.3'
}

IMPORTANT NOTICE

I'm working on the version 2 of this library, but I want to restart from scratch. If you need a stable version you can use the first version of this library, available here

Useful issues

For open a useful issue, please follow this little guide:
  1. Check if your issue is not opened yet. This prevent to have different questions to the same problem.
  2. When you open an issue, please add the library version used, devices tested and related api.


An interactive indicator to navigate between the different pages of a ViewPager


Android PagerSlidingTabStrip

Interactive paging indicator widget, compatible with the ViewPager from the Android Support Library.
Try out the sample application on the Play Store.
PagerSlidingTabStrip Sample Screenshot 1PagerSlidingTabStrip Sample Screenshot 2

Usage

For a working implementation of this project see the sample/ folder.
  1. Include the library as local library project or add the dependency in your build.gradle.
    dependencies { compile 'com.astuetz:pagerslidingtabstrip:1.0.1' }
  2. Include the PagerSlidingTabStrip widget in your layout. This should usually be placed above the ViewPager it represents.
    <com.astuetz.PagerSlidingTabStrip android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="48dip" />
  3. In your onCreate method (or onCreateView for a fragment), bind the widget to the ViewPager.
    // Initialize the ViewPager and set an adapter
    ViewPager pager = (ViewPager) findViewById(R.id.pager);
    pager.setAdapter(new TestAdapter(getSupportFragmentManager()));
    
    // Bind the tabs to the ViewPager
    PagerSlidingTabStrip tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
    tabs.setViewPager(pager);
    
  4. (Optional) If you use an OnPageChangeListener with your view pager you should set it in the widget rather than on the pager directly.
    // continued from above
    tabs.setOnPageChangeListener(mPageChangeListener);
    

Customization

To not just look like another Play Store styled app, go and adjust these values to match your brand:
  • pstsIndicatorColor Color of the sliding indicator
  • pstsUnderlineColor Color of the full-width line on the bottom of the view
  • pstsDividerColor Color of the dividers between tabs
  • pstsIndicatorHeightHeight of the sliding indicator
  • pstsUnderlineHeight Height of the full-width line on the bottom of the view
  • pstsDividerPadding Top and bottom padding of the dividers
  • pstsTabPaddingLeftRight Left and right padding of each tab
  • pstsScrollOffset Scroll offset of the selected tab
  • pstsTabBackground Background drawable of each tab, should be a StateListDrawable
  • pstsShouldExpand If set to true, each tab is given the same weight, default false
  • pstsTextAllCaps If true, all tab titles will be upper case, default true
All attributes have their respective getters and setters to change them at runtime
Download From GitHub

Download Full Project Code From GitHub

RecyclerTabLayout

An efficient TabLayout library implemented with RecyclerView.

Features

  • Efficient when having many tabs
  • Easy setup with ViewPager (same as TabLayout of Android Design Support Library)
  • RTL layout support

UseCase

  • Many tabs layout
  • Infinite loop scrolling (imitated)

Demos

Years
Loop
Basic
Icon

Samples

Getting started

In your build.gradle:
repositories {
    jcenter()
}

dependencies {
   compile 'com.nshmura:recyclertablayout:1.5.0'
}
Define RecyclerTabLayout in xml layout with custom attributes.
<com.nshmura.recyclertablayout.RecyclerTabLayout
        android:id="@+id/recycler_tab_layout"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        rtl_tabIndicatorColor="?attr/colorAccent"
        rtl_tabIndicatorHeight="2dp"
        rtl_tabBackground="?attr/selectableItemBackground"
        rtl_tabTextAppearance="@android:style/TextAppearance.Small"
        rtl_tabSelectedTextColor="?android:textColorPrimary"
        rtl_tabMinWidth="72dp"
        rtl_tabMaxWidth="264dp"
        rtl_tabPaddingStart="12dp"
        rtl_tabPaddingTop="0dp"
        rtl_tabPaddingEnd="12dp"
        rtl_tabPaddingBottom="0dp"
        rtl_tabPadding="0dp"/>
Set up with the ViewPager.
ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
viewPager.setAdapter(adapter);

RecyclerTabLayout recyclerTabLayout = (RecyclerTabLayout) findViewById(R.id.recycler_tab_layout);
recyclerTabLayout.setUpWithViewPager(viewPager);
Or set up with ViewPager and Custom RecyclerView.Adapter that's extends RecyclerTabLayout.Adapter.
ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
viewPager.setAdapter(adapter);

RecyclerTabLayout recyclerTabLayout = (RecyclerTabLayout) findViewById(R.id.recycler_tab_layout);
recyclerTabLayout.setUpWithAdapter(new CustomRecyclerViewAdapter(viewPager));
Here's sample of custom RecyclerView adapter.
public class CustomRecyclerViewAdapter extends RecyclerTabLayout.Adapter<CustomRecyclerViewAdapter.ViewHolder> {

    public DemoCustomView01Adapter(ViewPager viewPager) {
        super(viewPager);
        ...
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        // Inflate your view.
        View view = ...;
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        // Bind data
        ...
        
        if (position == getCurrentIndicatorPosition()) {
            //Highlight view
        }
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        ...
        
        public ViewHolder(View itemView) {
            super(itemView);
        ...
        }
    }
}

Attributes

attrdescription
rtl_tabIndicatorColorIndicator color
rtl_tabIndicatorHeightIndicator height
rtl_tabBackgroundBackground drawable of each tab
rtl_tabTextAppearanceTextAppearence of each tab
rtl_tabSelectedTextColorText color of selected tab
rtl_tabOnScreenLimitThe number of OnScreen tabs. If this value is larger than 0, rtl_tabMinWidth and rtl_tabMaxWidth are ignored.
rtl_tabMinWidthMinimum width of each tab
rtl_tabMaxWidthMaximum width of each tab
rtl_tabPaddingStartThe padding of the start edge of each tab
rtl_tabPaddingTopThe padding of the top edge of each tab
rtl_tabPaddingEndThe padding of the end edge of each tab
rtl_tabPaddingBottomThe padding of the bottom edge of each tab
rtl_tabPaddingThe padding of all four edges of each tab
rtl_scrollEnabledSets whether tab scrolling is enabled

Download From GitHub

NavigationTabStrip

Navigation tab strip with smooth interaction.
You can check the sample app here.
Navigation tab strip with smooth interaction
Navigation-tab-strip-with-smooth-interaction

Download

You can download a .aar from GitHub's releases page.
Or use Gradle jCenter:
dependencies {
    repositories {
        mavenCentral()
        maven {
            url  'http://dl.bintray.com/gigamole/maven/'
        }
    }
    compile 'com.github.devlight.navigationtabstrip:navigationtabstrip:+'
}
Or Gradle Maven Central:
compile 'com.github.devlight.navigationtabstrip:navigationtabstrip:1.0.4'
Or Maven:
<dependency>
    <groupId>com.github.devlight.navigationtabstrip</groupId>
    <artifactId>navigationtabstrip</artifactId>
    <version>1.0.4</version>
    <type>aar</type>
</dependency>

Android SDK Version

NavigationTabStrip requires a minimum SDK version of 11.

Sample

Parameters
For NTS you can set such parameters as:
  • color:
    allows you to set strip color.
  • size:
    allows you to set titles size. By default NTS use auto titles size.
  • weight:
    allows you to set weight(height) of strip.
  • factor:
    allows you to set strip resize factor.
  • titles:
    allows you to set NTS titles. This is your tabs.
  • type:
    allows you to set strip type - line or point.
  • gravity:
    allows you to set strip gravity - top or bottom.
  • view pager:
    allows you to connect NTS with ViewPager. If you want your can also set OnPageChangeListener.
  • typeface:
    allows you to set custom typeface to your titles.
  • corners radius:
    allows you to set corners radius of strip.
  • animation duration:
    allows you to set animation duration.
  • inactive color:
    allows you to set inactive titles color.
  • active color:
    allows you to set active title color.
  • tab strip listener:
    allows you to set listener which triggering on start or on end when you set tab index.
Tips
If your set ViewPager you can action down on active tab and do like drag.
NTS use only upper case titles.
Init
Check out in code init:
final NavigationTabStrip navigationTabStrip = (NavigationTabStrip) findViewById(R.id.nts);
navigationTabStrip.setTitles("Nav", "Tab", "Strip");
navigationTabStrip.setTabIndex(0, true);
navigationTabStrip.setTitleSize(15);
navigationTabStrip.setStripColor(Color.RED);
navigationTabStrip.setStripWeight(6);
navigationTabStrip.setStripFactor(2);
navigationTabStrip.setStripType(NavigationTabStrip.StripType.LINE);
navigationTabStrip.setStripGravity(NavigationTabStrip.StripGravity.BOTTOM);
navigationTabStrip.setTypeface("fonts/typeface.ttf");
navigationTabStrip.setCornersRadius(3);
navigationTabStrip.setAnimationDuration(300);
navigationTabStrip.setInactiveColor(Color.GRAY);
navigationTabStrip.setActiveColor(Color.WHITE);
navigationTabStrip.setOnPageChangeListener(...);
navigationTabStrip.setOnTabStripSelectedIndexListener(...);
Other methods check out in sample.
And XML init:

<com.gigamole.navigationtabstrip.NavigationTabStrip android:layout_width="match_parent" android:layout_height="50dp" app:nts_color="#000" app:nts_size="15sp" app:nts_weight="3dp" app:nts_factor="2.5" app:nts_titles="@array/titles" app:nts_type="point" app:nts_gravity="top" app:nts_typeface="fonts/typeface.otf" app:nts_corners_radius="1.5dp" app:nts_animation_duration="300" app:nts_active_color="#000" app:nts_inactive_color="#c4c4c4"/>
Download From GitHub
Powered by Blogger.