Package com.xa.xpensauditor
Class ViewPageAdapter
- java.lang.Object
-
- androidx.viewpager.widget.PagerAdapter
-
- androidx.fragment.app.FragmentPagerAdapter
-
- com.xa.xpensauditor.ViewPageAdapter
-
public class ViewPageAdapter extends androidx.fragment.app.FragmentPagerAdapter
Manages two tabs in main page for Categorized and un-Categorized
-
-
Constructor Summary
Constructors Constructor Description ViewPageAdapter(androidx.fragment.app.FragmentManager manager)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFragment(androidx.fragment.app.Fragment fragment, String title)
To add a new fragment to pageint
getCount()
Get item countandroidx.fragment.app.Fragment
getItem(int position)
Get item with positionCharSequence
getPageTitle(int position)
Get title of the page-
Methods inherited from class androidx.fragment.app.FragmentPagerAdapter
destroyItem, finishUpdate, getItemId, instantiateItem, isViewFromObject, restoreState, saveState, setPrimaryItem, startUpdate
-
-
-
-
Method Detail
-
getItem
public androidx.fragment.app.Fragment getItem(int position)
Get item with position- Specified by:
getItem
in classandroidx.fragment.app.FragmentPagerAdapter
- Parameters:
position
-- Returns:
-
getCount
public int getCount()
Get item count- Specified by:
getCount
in classandroidx.viewpager.widget.PagerAdapter
- Returns:
-
addFragment
public void addFragment(androidx.fragment.app.Fragment fragment, String title)
To add a new fragment to page- Parameters:
fragment
-title
-
-
getPageTitle
public CharSequence getPageTitle(int position)
Get title of the page- Overrides:
getPageTitle
in classandroidx.viewpager.widget.PagerAdapter
- Parameters:
position
-- Returns:
-
-