Commit ecd387d3 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

XML factorization for TabLayout

parent 7599afd3
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/background_actionbar"
app:tabSelectedTextColor="?attr/font_actionbar_selected"
app:tabTextColor="?attr/font_actionbar"
app:tabIndicatorColor="?attr/font_actionbar_selected"/>
<include layout="@layout/tab_layout" />
<android.support.v4.view.ViewPager
android:id="@+id/pager"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/background_actionbar"
app:tabSelectedTextColor="?attr/font_actionbar_selected"
app:tabTextColor="?attr/font_actionbar"
app:tabIndicatorColor="?attr/font_actionbar_selected"/>
<include layout="@layout/tab_layout" />
<org.videolan.vlc.widget.SwipeRefreshLayout
android:id="@+id/swipeLayout"
......
......@@ -5,14 +5,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/background_actionbar"
app:tabSelectedTextColor="?attr/font_actionbar_selected"
app:tabTextColor="?attr/font_actionbar"
app:tabIndicatorColor="?attr/font_actionbar_selected"/>
<include layout="@layout/tab_layout" />
<TextView
android:id="@+id/no_media"
......
<android.support.design.widget.TabLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/background_actionbar"
app:tabMode="scrollable"
app:tabSelectedTextColor="?attr/font_actionbar_selected"
app:tabTextColor="?attr/font_actionbar"
app:tabIndicatorColor="?attr/font_actionbar_selected"/>
\ No newline at end of file
......@@ -98,7 +98,6 @@ public class AboutFragment extends Fragment {
mTabLayout = (TabLayout) v.findViewById(R.id.sliding_tabs);
mTabLayout.setupWithViewPager(mViewPager);
mTabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
return v;
}
......
......@@ -135,7 +135,6 @@ public class AudioAlbumsSongsFragment extends Fragment implements SwipeRefreshLa
mViewPager.setOnTouchListener(mSwipeFilter);
TabLayout mTabLayout = (TabLayout) v.findViewById(R.id.sliding_tabs);
mTabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
mTabLayout.setupWithViewPager(mViewPager);
songsList.setAdapter(mSongsAdapter);
......
......@@ -167,7 +167,6 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements SwipeR
mTabLayout = (TabLayout) v.findViewById(R.id.sliding_tabs);
mTabLayout.setupWithViewPager(mViewPager);
mTabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
mViewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(mTabLayout));
mTabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
......
Supports Markdown
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