Not able to fix PagerTitleStrip in android - android

The PagerTitleStrip is overflowing. I am not able to see all the title at a time. Not able to make out what i am missing here. I have attached the screenshots.
Also how do i add material UI theme to these tabs. which library is required and how to i apply the theme for the tab or for the entire application
My adapter code
public class MyAdapter extends FragmentPagerAdapter
{
int totalFragments = 3;
public MyAdapter(FragmentManager fm) {
super(fm);
}
#Override
public Fragment getItem(int position) {
return MyFragment.newInstance(position);
}
#Override
public int getCount() {
return totalFragments;
}
#Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return "Tab One";
case 1:
return "Tab Two";
case 2:
return "Tab Three";
}
return null;
}
}
Layout file:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.3"
android:orientation="vertical" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.7"
android:orientation="vertical" >
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<android.support.v4.view.PagerTitleStrip
android:id="#+id/pager_title_strip"
android:scrollbarSize="200dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="#33b5e5"
android:paddingBottom="4dp"
android:paddingTop="4dp"
android:textColor="#fff" />
</android.support.v4.view.ViewPager>
</LinearLayout>
</LinearLayout>

First, where you have used fill_parent, replace those with match_parent, since filling is deprecated.
Second, the common settings for ViewPager size are
android:layout_width="match_parent"
android:layout_height="0px"
and possibly
android:layout_weight="1"
After these, for your PagerTitleStrip, try
android:layout_width="wrap_content"
Third, The material way of designing tabbed vies is with TabLayout, which Google has some tutorials and examples for.

Related

How to place PagerTabStrip in single page

I am trying to design this page
but I have design like this ( both fragment are there but the pagertabstrip of unseen page only see when I moved to this page )
Issue Facing
How would I set the width of the PagerTabStrip so that both login and register( highlighted in the first image) is visible in the same page.
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:weightSum="2"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_weight="1.6"
android:gravity="center"
android:id="#+id/logo"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textSize="25dp"
android:gravity="center"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Large"
android:textStyle="bold"
android:text=""
android:visibility="visible"
android:src="#drawable/logo_new"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/textView8" />
</LinearLayout>
<LinearLayout
android:layout_weight="0.4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v4.view.ViewPager
app:tabMode="fixed"
android:id="#+id/vpPager"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.PagerTabStrip
app:tabMode="fixed"
android:id="#+id/pager_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:paddingBottom="4dp"
android:paddingTop="4dp" />
</android.support.v4.view.ViewPager>
</LinearLayout>
</LinearLayout>
Java File
public class Authentication extends AppCompatActivity {
FragmentPagerAdapter adapterViewPager;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.authentication);
SharedPreferences app_preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
Boolean login_already=app_preferences.getBoolean("login",false);
if (login_already)
{
startActivity(new Intent(Authentication.this,MainActivity.class));
finish();
}
ViewPager vpPager = (ViewPager) findViewById(R.id.vpPager);
adapterViewPager = new MyPagerAdapter(getSupportFragmentManager());
vpPager.setAdapter(adapterViewPager);
// Attach the page change listener inside the activity
vpPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
// This method will be invoked when a new page becomes selected.
#Override
public void onPageSelected(int position) {
Toast.makeText(Authentication.this,
"Selected page position: " + position, Toast.LENGTH_SHORT).show();
}
// This method will be invoked when the current page is scrolled
#Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
// Code goes here
}
// Called when the scroll state changes:
// SCROLL_STATE_IDLE, SCROLL_STATE_DRAGGING, SCROLL_STATE_SETTLING
#Override
public void onPageScrollStateChanged(int state) {
// Code goes here
}
});
}
public static class MyPagerAdapter extends FragmentPagerAdapter {
private static int NUM_ITEMS = 2;
public MyPagerAdapter(FragmentManager fragmentManager) {
super(fragmentManager);
}
// Returns total number of pages
#Override
public int getCount() {
return NUM_ITEMS;
}
// Returns the fragment to display for that page
#Override
public Fragment getItem(int position) {
switch (position) {
case 0: // Fragment # 0 - This will show FirstFragment
return Login.newInstance(0, "Login");
case 1: // Fragment # 0 - This will show FirstFragment different title
return Registration.newInstance(1, "Register");
default:
return null;
}
}
// Returns the page title for the top indicator
#Override
public CharSequence getPageTitle(int position) {
if (position==0)
return "Login";
else
return "Register";
//return "Page " + position;
}
}
}
That layout xml worked for me...
EDIT: Oh sry i'm using another lib:
https://github.com/jpardogo/PagerSlidingTabStrip
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.astuetz.PagerSlidingTabStrip
android:id="#android:id/tabs"
android:layout_width="match_parent"
android:layout_height="48dip"
android:textColor="#FFFFFFFF"
app:pstsDividerColor="#FFFFFFFF"
app:pstsDividerPadding="10dp"
app:pstsDividerWidth="1dp"
app:pstsIndicatorColor="#FF33B5E6"
app:pstsIndicatorHeight="5dp"
app:pstsTabPaddingLeftRight="20dip"
app:pstsUnderlineColor="#FF33B5E6">
</com.astuetz.PagerSlidingTabStrip>
<FrameLayout
android:id="#+id/movie_framelayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v4.view.ViewPager
android:id="#+id/movie_pager"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.v4.view.ViewPager>
</FrameLayout>
</LinearLayout>
</FrameLayout>
When you want to display only selected tab and other will hide then set your PagerTabStrip as bellow.
<android.support.v4.view.PagerTabStrip
android:id="#+id/pager_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:paddingBottom="4dp"
android:paddingTop="4dp"
app:tabMode="scrollable"
app:tabTextColor="#000000"
app:tabSelectedTextColor="#ff0000"
app:tabIndicatorColor="#ff0000"/>
app:tabTextColor="" is your normal tab text color.
app:tabSelectedTextColor="" is color of your selected tab.
app:tabIndicatorColor="" is your selected tab indicatore color.
So use as per your requirement. For detail that how to use tab layout then check this tutorial.

I have to click twice to make it work, scroll or click event

I have a viewPager that has 6 pages and in each page there is a PullToRefreshGridView.
I found that I have to click twice to triggered the click event or scroll the GridView.
The first click didn't triggered the click event.
These 6 pages have the same situation.
Please can someone help me to debug and tell me what am I doing wrong here.
This is my code:
viewPager = (ViewPager)findViewById(R.id.viewPager);
adapterViewPager = new MyPagerAdapter(getSupportFragmentManager());
viewPager.setAdapter(adapterViewPager);
viewPager.setCurrentItem(0);
viewPager.addOnPageChangeListener(this);
viewPager.setOffscreenPageLimit(0);
and MyPagerAdapter is:
public static class MyPagerAdapter extends FragmentStatePagerAdapter {
private static int NUM_ITEMS = 6;
public MyPagerAdapter(FragmentManager fragmentManager) {
super(fragmentManager);
}
#Override
public void destroyItem(View collection, int position, Object o) {
Log.d("DESTROY", "destroying view at position " + position);
View view = (View) o;
((ViewPager) collection).removeView(view);
view = null;
}
// Returns total number of pages
#Override
public int getCount() {
return NUM_ITEMS;
}
// Returns the fragment to display for that page
#Override
public Fragment getItem(int position) {
switch (position)
{
case 0:
return TypeZero.newInstance("", "Page # 1");
case 1:
return TypeOne.newInstance("", "Page # 2");
case 2:
return TypeTwo.newInstance("", "Page # 3");
case 3:
return TypeThree.newInstance("", "Page # 4");
case 4:
return TypeFour.newInstance("", "Page # 5");
case 5:
return TypeFive.newInstance("", "Page # 6");
default:
return null;
}
}
// Returns the page title for the top indicator
#Override
public CharSequence getPageTitle(int position) {
switch(position)
{
case 0:
return "Zero";
case 1:
return "One";
case 2:
return "Two";
case 3:
return "Three";
case 4:
return "Four";
case 5:
return "Five";
default:
return null;
}
}
here is my layout activity_main.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#556fa5"
android:minHeight="?attr/actionBarSize">
</android.support.v7.widget.Toolbar>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/toolbar">
<RelativeLayout
android:id="#+id/main_content"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TabLayout
android:id="#+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorColor="#f44336"
app:tabSelectedTextColor="#FFFFFF"
app:tabTextColor="#03A9F4" />
<android.support.v4.view.ViewPager
android:id="#+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/tabLayout" />
</RelativeLayout>
<!-- Listview to display slider menu -->
<ListView
android:id="#+id/list_slidermenu"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#color/list_divider"
android:dividerHeight="1dp"
android:listSelector="#drawable/list_selector"
android:background="#color/list_background"/>
</android.support.v4.widget.DrawerLayout>
The PullToRefreshGridView layout as below:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.handmark.pulltorefresh.MainActivity" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<!-- The PullToRefreshGridView replaces a standard GridView widget. -->
<com.handmark.pulltorefresh.PullToRefreshGridView
xmlns:ptr="http://schemas.android.com/apk/res-auto"
android:id="#+id/pull_refresh_grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:columnWidth="0dp"
android:gravity="center"
android:layout_gravity="center"
android:horizontalSpacing="10dp"
android:verticalSpacing="10dp"
android:numColumns="2"
android:stretchMode="columnWidth"
ptr:ptrDrawable="#drawable/ic_launcher"
ptr:ptrMode="both" />
</LinearLayout>
Please try this before setting the adapter.
viewPager.invalidate();
viewPager.requestLayout();
I found that I add
main_layout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
at every activity of gridview inside the viewPager.
This one cause the focus false.

Pager Sliding Tab Strip with Buttons and Edit Text for appropriate tab

I referred this Pager Sliding Tab Strip.I am getting the output as it is.
But my only problem is I didn't know how to add the button for categories tab,Textview for Home tab,Edittext for Top Paid tab.
There I seen only two layout :
activity_main.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.astuetz.PagerSlidingTabStrip
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="48dip"
android:background="#drawable/background_tabs" />
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/colors"
android:layout_below="#+id/tabs"
tools:context=".MainActivity" />
<LinearLayout
android:id="#+id/colors"
android:layout_width="match_parent"
android:layout_height="48dip"
android:layout_alignParentBottom="true"
android:layout_marginBottom="8dip"
android:layout_marginLeft="4dip"
android:layout_marginRight="4dip"
android:orientation="horizontal" >
</LinearLayout>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/colors"
android:layout_alignTop="#+id/pager"
android:layout_marginLeft="58dp"
android:layout_marginTop="46dp"
android:text="Button" />
</RelativeLayout>
fragment_quick_contact.xml:
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/image"
android:layout_width="match_parent"
android:layout_height="170dip"
android:scaleType="centerCrop"
android:src="#drawable/contact" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/image"
android:background="#77000000"
android:paddingBottom="14dip"
android:paddingLeft="8dip"
android:paddingTop="14dip"
android:text="Quick Contact"
android:textColor="#FFFFFFFF"
android:textSize="18sp" />
<com.astuetz.PagerSlidingTabStrip
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="62dip"
android:layout_below="#+id/image"
android:background="#drawable/background_tabs_diagonal"
app:pstsDividerColor="#00000000"
app:pstsIndicatorColor="#FF33B5E6"
app:pstsTabPaddingLeftRight="14dip"
app:pstsUnderlineColor="#FF33B5E6" />
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="96dip"
android:layout_below="#+id/tabs" />
</RelativeLayout>
MainActivity,java:
public class MyPagerAdapter extends FragmentPagerAdapter {
private final String[] TITLES = { "Categories", "Home","Profile" };
public MyPagerAdapter(FragmentManager fm) {
super(fm);
}
#Override
public CharSequence getPageTitle(int position) {
return TITLES[position];
}
#Override
public int getCount() {
return TITLES.length;
}
return SuperAwesomeCardFragment.newInstance(position);
}
}
If I add a button in activity_main.xml. It just add the button not only in Category tab.But, it added the button in all tabs.
I need to add the button in category tab.Then I have to add the edit text in Home tab.is it possible to do this in Pager Sliding Tab Strip.
Edit: There was no xml layout separately for category tab and home tab.That's why I am getting confused with this.
you should add the button on Category Tab fragment layout, not activity_main layout
The user #Calvinfly suggested me,so I can found out the answer.To be more Clear:
In my MainActivity.java inside MyPagerAdapter I set the position like this
#Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return new Category();
case 1:
return new Home();
case 2:
return new TopPaid();
}
return SuperAwesomeCardFragment.newInstance(position);
}

Adding tabs to Android 5.0 toolbar?

I am in the process of creating my first app and learning java for the first time as well, and am stuck on creating tabs on the toolbar..
I took a look at this post. However I was still confused on how to properly implement them. Should I be downloading the SlidingTabsColors file, and then adding it as a dependency in gradle.build?
In this section: fragment_sample.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/my_awesome_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:theme="#style/ThemeOverlay.AppCompat.ActionBar">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<com.example.android.common.view.SlidingTabLayout
android:id="#+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:background="#android:color/white" />
</LinearLayout>
I can not add com.example.android.common.view.SlidingTabLayout to the layout.
Thank you
Try this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/my_awesome_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:theme="#style/ThemeOverlay.AppCompat.ActionBar">
</android.support.v7.widget.Toolbar>
<com.example.android.common.view.SlidingTabLayout
android:id="#+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:background="#android:color/white" />
</LinearLayout>
For a better implementation try:
add this to your gradle dependences
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
Then instead of the SlidingTabLayout use
<com.astuetz.PagerSlidingTabStrip
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="48dip" />
In your activity where you want to call the ViewPager You have to
// Initialize the ViewPager and set an adapter
ViewPager pager = (ViewPager) findViewById(R.id.viewpager);
pager.setAdapter(new YourCustomAdapter(getSupportFragmentManager()));
// Bind the tabs to the ViewPager
PagerSlidingTabStrip tabs = (PagerSlidingTabStrip) findViewById(R.id.tabs);
tabs.setViewPager(pager);
You might want to implement your adapter like this:
public class YourCustomAdapter extends FragmentStatePagerAdapter {
private String[] titles = { "Item 1", "Item 2", "Item 3" };
public YourCustomAdapter(FragmentManager fm) {
super(fm);
}
#Override
public Fragment getItem(int position) {
switch(position){
case 0:{
return new YourFragment();
}
case 1:{
return new YourFragment();
}
case 2:{
return new YourFragment();
}
}
return null;
}
#Override
public int getCount() {
return titles.length;
}
#Override
public CharSequence getPageTitle(int position) {
return titles[position];
}
}
Hope it helps!!!

How to display ViewPager title?

Hi i have to implement ViewPager in my app. here i have to load ImageAdapter that extends PagerAdapter and i successfully see all the images into viewpager.
Now, i want to display viewpager title as my image counter.
Layout.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/gallery_detail_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/black" >
<android.support.v4.view.ViewPager
android:id="#+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/rel_ig" >
</android.support.v4.view.ViewPager>
</RelativeLayout>
Please some one give me information how i want to do that!
First need to add android.support.v4.view.PagerTabStrip into your Layout.xml file like:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/gallery_detail_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/black" >
<android.support.v4.view.ViewPager
android:id="#+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/rel_ig" >
<android.support.v4.view.PagerTabStrip
android:id="#+id/pts_main"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.v4.view.ViewPager>
</RelativeLayout>
Now, override CharSequence getPageTitle(int position) method int you Adapter like:
public class ImageAdapter extends PagerAdapter {
............
#Override
public CharSequence getPageTitle(int position) {
return (position + 1);
}
...........
}
And implement into your PagerTabStrip like: you can customized PagerTabStrip options
PagerTabStrip strip = (PagerTabStrip)view.findViewById(R.id.pts_main);
strip.setDrawFullUnderline(false);
strip.setTabIndicatorColor(Color.DKGRAY);
strip.setBackgroundColor(Color.GRAY);
strip.setNonPrimaryAlpha(0.5f);
strip.setTextSpacing(25);
strip.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
Try This :-
add a PagerTitleStrip in activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<android.support.v4.view.ViewPager
android:id="#+android:id/viewpager"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<android.support.v4.view.PagerTitleStrip
android:id="#+id/pgrStrp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top" />
</android.support.v4.view.ViewPager>
</LinearLayout>
Then in PageAdapter.java add the following method:
#Override
public CharSequence getPageTitle(int position) {
return "Title Here";
}

Categories

Resources