本文整理匯總了Java中com.viewpagerindicator.PageIndicator.setOnPageChangeListener方法的典型用法代碼示例。如果您正苦於以下問題:Java PageIndicator.setOnPageChangeListener方法的具體用法?Java PageIndicator.setOnPageChangeListener怎麽用?Java PageIndicator.setOnPageChangeListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.viewpagerindicator.PageIndicator
的用法示例。
在下文中一共展示了PageIndicator.setOnPageChangeListener方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import com.viewpagerindicator.PageIndicator; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.page_user_guide);
mCustomerViewPager = (CustomerViewPager) findViewById(R.id.guide_view_pager);
mMyPagerAdapter = new MyPagerAdapter();
mCustomerViewPager.setAdapter(mMyPagerAdapter);
mStartFrom = getIntent().getIntExtra(EXTRAS_START_FROM, START_FROM_SPLASH);
indicator = (PageIndicator) findViewById(R.id.indicator);
indicator.setViewPager(mCustomerViewPager);
indicator.setOnPageChangeListener(onPageChangeListener);
// Already show the user guide.
AppPreference.getInstance(getApplicationContext()).setShouldShowUserGuard(false);
}
示例2: TabsAdapter
import com.viewpagerindicator.PageIndicator; //導入方法依賴的package包/類
public TabsAdapter(Context context, FragmentManager fm, PageIndicator pageIndicator)
{
super(fm);
this.context = context;
this.pageIndicator = pageIndicator;
fragments = new ArrayList<IKlyphFragment>();
titles = new ArrayList<String>();
List<String> headerValues = new ArrayList<String>();
List<String> headerTitles = new ArrayList<String>();
List<IKlyphFragment> fragmentList = new ArrayList<IKlyphFragment>();
headerValues.add(context.getString(R.string.fragment_header_events_preference_value));
headerValues.add(context.getString(R.string.fragment_header_about_preference_value));
headerValues.add(context.getString(R.string.fragment_header_timeline_preference_value));
headerValues.add(context.getString(R.string.fragment_header_albums_preference_value));
headerValues.add(context.getString(R.string.fragment_header_pages_preference_value));
headerTitles.add(context.getString(R.string.fragment_header_events));
headerTitles.add(context.getString(R.string.fragment_header_about));
headerTitles.add(context.getString(R.string.fragment_header_timeline));
headerTitles.add(context.getString(R.string.fragment_header_albums));
headerTitles.add(context.getString(R.string.fragment_header_pages));
fragmentList.add(new ElementEvents());
fragmentList.add(new UserAbout());
timelineFragment = new UserTimeline();
fragmentList.add(timelineFragment);
fragmentList.add(new ElementAlbums());
fragmentList.add(new Pages());
List<String> tabs = KlyphPreferences.getUserActivityTabs();
int n = tabs.size();
for (int i = 0; i < n; i++)
{
String tab = tabs.get(i);
int m = headerValues.size();
for (int j = 0; j < m; j++)
{
String value = headerValues.get(j);
if (tab.equals(value))
{
IKlyphFragment fragment = fragmentList.get(j);
fragment.setAutoLoad(false);
fragments.add(fragment);
titles.add(headerTitles.get(j));
}
}
}
pageIndicator.setOnPageChangeListener(this);
}
示例3: TabsAdapter
import com.viewpagerindicator.PageIndicator; //導入方法依賴的package包/類
public TabsAdapter(Context context, FragmentManager fm, PageIndicator pageIndicator)
{
super(fm);
this.context = context;
this.pageIndicator = pageIndicator;
List<String> headerValues = new ArrayList<String>();
List<String> headerTitles = new ArrayList<String>();
List<IKlyphFragment> fragmentList = new ArrayList<IKlyphFragment>();
headerValues.add(context.getString(R.string.fragment_header_about_preference_value));
headerValues.add(context.getString(R.string.fragment_header_timeline_preference_value));
headerValues.add(context.getString(R.string.fragment_header_albums_preference_value));
headerValues.add(context.getString(R.string.fragment_header_pages_preference_value));
headerValues.add(context.getString(R.string.fragment_header_events_preference_value));
headerTitles.add(context.getString(R.string.fragment_header_about));
headerTitles.add(context.getString(R.string.fragment_header_timeline));
headerTitles.add(context.getString(R.string.fragment_header_albums));
headerTitles.add(context.getString(R.string.fragment_header_pages));
headerTitles.add(context.getString(R.string.fragment_header_events));
fragmentList.add(new PageAbout());
timelineFragment = new PageTimeline();
fragmentList.add(timelineFragment);
fragmentList.add(new ElementAlbums());
fragmentList.add(new Pages());
fragmentList.add(new ElementEvents());
List<String> tabs = KlyphPreferences.getPageActivityTabs();
fragments = new ArrayList<IKlyphFragment>();
titles = new ArrayList<String>();
int n = tabs.size();
for (int i = 0; i < n; i++)
{
String tab = tabs.get(i);
int m = headerValues.size();
for (int j = 0; j < m; j++)
{
String value = headerValues.get(j);
if (tab.equals(value))
{
IKlyphFragment fragment = fragmentList.get(j);
fragment.setAutoLoad(false);
fragments.add(fragment);
titles.add(headerTitles.get(j));
}
}
}
pageIndicator.setOnPageChangeListener(this);
}
示例4: TabsAdapter
import com.viewpagerindicator.PageIndicator; //導入方法依賴的package包/類
public TabsAdapter(Context context, FragmentManager fm, PageIndicator pageIndicator)
{
super(fm);
this.context = context;
this.pageIndicator = pageIndicator;
List<String> headerValues = new ArrayList<String>();
List<String> headerTitles = new ArrayList<String>();
List<IKlyphFragment> fragmentList = new ArrayList<IKlyphFragment>();
headerValues.add(context.getString(R.string.fragment_header_events_preference_value));
headerValues.add(context.getString(R.string.fragment_header_members_preference_value));
headerValues.add(context.getString(R.string.fragment_header_timeline_preference_value));
headerValues.add(context.getString(R.string.fragment_header_photos_preference_value));
headerTitles.add(context.getString(R.string.fragment_header_events));
headerTitles.add(context.getString(R.string.fragment_header_members));
headerTitles.add(context.getString(R.string.fragment_header_timeline));
headerTitles.add(context.getString(R.string.fragment_header_photos));
fragmentList.add(new ElementEvents());
fragmentList.add(new GroupMembers());
timelineFragment = new GroupTimeline();
fragmentList.add(timelineFragment);
fragmentList.add(new GroupPhotos());
List<String> tabs = KlyphPreferences.getGroupActivityTabs();
fragments = new ArrayList<IKlyphFragment>();
titles = new ArrayList<String>();
int n = tabs.size();
for (int i = 0; i < n; i++)
{
String tab = tabs.get(i);
int m = headerValues.size();
for (int j = 0; j < m; j++)
{
String value = headerValues.get(j);
if (tab.equals(value))
{
IKlyphFragment fragment = fragmentList.get(j);
fragment.setAutoLoad(false);
fragments.add(fragment);
titles.add(headerTitles.get(j));
}
}
}
pageIndicator.setOnPageChangeListener(this);
}
示例5: TabsAdapter
import com.viewpagerindicator.PageIndicator; //導入方法依賴的package包/類
public TabsAdapter(Context context, FragmentManager fm, PageIndicator pageIndicator)
{
super(fm);
this.context = context;
this.pageIndicator = pageIndicator;
List<String> headerValues = new ArrayList<String>();
List<String> headerTitles = new ArrayList<String>();
List<IKlyphFragment> fragmentList = new ArrayList<IKlyphFragment>();
headerValues.add(context.getString(R.string.fragment_header_events_preference_value));
headerValues.add(context.getString(R.string.fragment_header_about_preference_value));
headerValues.add(context.getString(R.string.fragment_header_timeline_preference_value));
headerValues.add(context.getString(R.string.fragment_header_albums_preference_value));
headerValues.add(context.getString(R.string.fragment_header_pages_preference_value));
headerTitles.add(context.getString(R.string.fragment_header_events));
headerTitles.add(context.getString(R.string.fragment_header_about));
headerTitles.add(context.getString(R.string.fragment_header_timeline));
headerTitles.add(context.getString(R.string.fragment_header_albums));
headerTitles.add(context.getString(R.string.fragment_header_pages));
fragmentList.add(new ElementEvents());
fragmentList.add(new UserAbout());
fragmentList.add(new UserTimeline());
fragmentList.add(new ElementAlbums());
fragmentList.add(new Pages());
List<String> tabs = KlyphPreferences.getUserActivityTabs();
fragments = new ArrayList<IKlyphFragment>();
titles = new ArrayList<String>();
int n = tabs.size();
for (int i = 0; i < n; i++)
{
String tab = tabs.get(i);
int m = headerValues.size();
for (int j = 0; j < m; j++)
{
String value = headerValues.get(j);
if (tab.equals(value))
{
IKlyphFragment fragment = fragmentList.get(j);
fragment.setAutoLoad(false);
fragments.add(fragment);
titles.add(headerTitles.get(j));
}
}
}
pageIndicator.setOnPageChangeListener(this);
}