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