Commit b18d3456 authored by Robert Hitt's avatar Robert Hitt

Switched 3rd party TabLayout with Support library's

parent 4525f2ab
......@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
......@@ -16,8 +17,6 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.ProgressBar;
import com.astuetz.PagerSlidingTabStrip;
import butterknife.BindView;
import butterknife.ButterKnife;
import srct.whatsopen.MyApplication;
......@@ -106,9 +105,8 @@ public class MainActivity extends AppCompatActivity implements MainView {
mViewPager.setAdapter(new FacilityListFragmentPagerAdapter(getSupportFragmentManager()));
// Now give the TabStrip the ViewPager
PagerSlidingTabStrip tabStrip = ButterKnife.findById(this, R.id.tabs);
tabStrip.setTabPaddingLeftRight(0);
tabStrip.setViewPager(mViewPager);
TabLayout tabLayout = ButterKnife.findById(this, R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
// Set the default tab to 'All'
int tabNumber = getDefaultTabNumber();
......
......@@ -14,7 +14,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.realm.Realm;
import io.realm.Sort;
......
......@@ -17,14 +17,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.astuetz.PagerSlidingTabStrip
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="48dp"
app:pstsIndicatorColor="@color/colorPrimary"
app:pstsIndicatorHeight="6dp"
app:pstsShouldExpand="true"
app:pstsTabBackground="@drawable/button_bg" />
android:layout_height="wrap_content"
android:layout_gravity="top"
app:tabIndicatorColor="@color/colorPrimary"
app:tabIndicatorHeight="6dp"
app:tabBackground="@drawable/button_bg"
app:tabMode="fixed" />
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment