本文整理匯總了Java中com.viewpagerindicator.PageIndicator類的典型用法代碼示例。如果您正苦於以下問題:Java PageIndicator類的具體用法?Java PageIndicator怎麽用?Java PageIndicator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PageIndicator類屬於com.viewpagerindicator包,在下文中一共展示了PageIndicator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE); // 無標題
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FragmentPagerAdapter adapter = new MainTabAdapter(
getSupportFragmentManager());
// 視圖切換器
ViewPager pager = (ViewPager) findViewById(R.id.pager);
pager.setOffscreenPageLimit(1);
pager.setAdapter(adapter);
// 頁麵指示器
PageIndicator indicator = (PageIndicator) findViewById(R.id.indicator);
indicator.setViewPager(pager);
SuperID.initFaceSDK(this);
UmengUpdateAgent.update(this);
}
示例2: onCreate
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState, R.layout.activity_home);
popupMenuButton = addActionToActionBar(R.drawable.ic_menu, new OnClickListener() {
@Override
public void onClick(View v) {
onPopupMenuClicked();
}
});
LoadStatusesFromWebTask.run(this);
final ViewPager vp = (ViewPager) findViewById(R.id.vp);
vp.setAdapter(new MainAdapter(getSupportFragmentManager()));
PageIndicator indicator = (TitlePageIndicator) findViewById(R.id.titles);
indicator.setViewPager(vp);
int itemChecked = getIntent().getIntExtra(ITEM_EXTRA_PARAM, ITEM_WALL);
indicator.setCurrentItem(itemChecked);
initializePopupMenu();
}
示例3: initViewPager
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
private void initViewPager() {
ViewPager viewPager = (ViewPager) mLayout.findViewById(R.id.viewPager);
/* http://stackoverflow.com/a/13684139/663370 */
GlimmrPagerAdapter adapter = new GlimmrPagerAdapter(
getChildFragmentManager(), viewPager,
mActivity.getActionBar(), CONTENT) {
@Override
public Fragment getItemImpl(int position) {
switch (position) {
case OVERVIEW_PAGE:
return PhotoOverviewFragment.newInstance(
PhotoInfoFragment.this.mPhoto);
case MORE_PAGE:
return ExifInfoFragment.newInstance(
PhotoInfoFragment.this.mPhoto);
}
return null;
}
};
viewPager.setAdapter(adapter);
PageIndicator indicator =
(TabPageIndicator) mLayout.findViewById(R.id.indicator);
indicator.setViewPager(viewPager);
}
示例4: 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);
}
示例5: onCreate
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.track_schedule_event);
Bundle extras = getIntent().getExtras();
day = extras.getParcelable(EXTRA_DAY);
track = extras.getParcelable(EXTRA_TRACK);
progress = findViewById(R.id.progress);
pager = (ViewPager) findViewById(R.id.pager);
adapter = new TrackScheduleEventAdapter(getSupportFragmentManager());
pageIndicator = (PageIndicator) findViewById(R.id.indicator);
if (savedInstanceState == null) {
initialPosition = extras.getInt(EXTRA_POSITION, -1);
pager.setAdapter(adapter);
pageIndicator.setViewPager(pager);
}
ActionBar bar = getSupportActionBar();
bar.setDisplayHomeAsUpEnabled(true);
bar.setTitle(track.toString());
bar.setSubtitle(day.toString());
// Enable Android Beam
NfcUtils.setAppDataPushMessageCallbackIfAvailable(this, this);
setCustomProgressVisibility(true);
getSupportLoaderManager().initLoader(EVENTS_LOADER_ID, null, this);
}
示例6: onCreate
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
PageIndicator indicator = (PageIndicator) findViewById(R.id.indicator);
indicator.setViewPager(mViewPager);
}
示例7: makeSliderView
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
private void makeSliderView(ViewGroup parent){
View view = mInflater.inflate(R.layout.image_slider_view, parent, false);
ViewPager mViewPager = (ViewPager) view.findViewById(R.id.home_slider_pager);
mSliderAdapter = new SliderAdapter();
mViewPager.setAdapter(mSliderAdapter);
PageIndicator mPageIndicator = (PageIndicator) view.findViewById(R.id.home_slider_indicator);
mPageIndicator.setViewPager(mViewPager);
parent.addView(view);
new LoadSilderDataTask().execute();
}
示例8: getSliderView
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
public View getSliderView(int position, View view, ViewGroup parent) {
if(view == null){
view = mInflater.inflate(R.layout.image_slider_view, parent, false);
ViewPager mViewPager = (ViewPager) view.findViewById(R.id.home_slider_pager);
mViewPager.setAdapter(mSliderAdapter);
PageIndicator mPageIndicator = (PageIndicator) view.findViewById(R.id.home_slider_indicator);
mPageIndicator.setViewPager(mViewPager);
}
return view;
}
示例9: getPageIndicator
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
protected PageIndicator getPageIndicator()
{
TitlePageIndicator titleIndicator = (TitlePageIndicator) findViewById(R.id.title_indicator);
TabPageIndicator tabIndicator = (TabPageIndicator) findViewById(R.id.tab_indicator);
if (KlyphPreferences.showTabPageIndicator())
return tabIndicator;
else
return titleIndicator;
}
示例10: onCreate
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// ツールバーをアクションバーとしてセット
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
pageIndicator = (PageIndicator) findViewById(R.id.indicator);
pageIndicator.setViewPager(mViewPager);
}
示例11: onCreate
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cards);
cards = getIntent().getParcelableArrayListExtra(Card.PARCEL_KEYS);
mAdapter = new MyAdapter(getSupportFragmentManager(), cards);
mPager = (ViewPager) findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
PageIndicator pageIndicator = (PageIndicator) findViewById(R.id.indicator);
pageIndicator.setViewPager(mPager);
}
示例12: onCreate
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
viewPager = (ViewPager) findViewById(R.id.pager);
viewPager.setAdapter(new MyPagerAdapter());
pageIndicator = (PageIndicator) findViewById(R.id.pageIndicator);
pageIndicator.setViewPager(viewPager);
}
示例13: onCreate
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_styling_in_layout);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
viewPager = (ViewPager) findViewById(R.id.pager);
viewPager.setAdapter(new MyPagerAdapter());
pageIndicator = (PageIndicator) findViewById(R.id.pageIndicator);
pageIndicator.setViewPager(viewPager);
}
示例14: onCreate
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addFlags(LayoutParams.FLAG_KEEP_SCREEN_ON);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_screen_slide);
mPager = (ViewPager) findViewById(R.id.pager);
mPager.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
select();
}
});
mPagerAdapter = onCreatePagerAdapter();
mPager.setAdapter(mPagerAdapter);
mPageIndicator = (PageIndicator) findViewById(R.id.vpi);
if (mInitialItem > 0) {
mPageIndicator.setViewPager(mPager, mInitialItem);
} else {
mPageIndicator.setViewPager(mPager);
}
mGestureDetector = new GestureDetector(this,
new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
mPager.performClick();
return true;
};
});
}
示例15: onCreate
import com.viewpagerindicator.PageIndicator; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
analyticsCallback();
setContentView(R.layout.main_activity);
mViewPager = (ViewPager) findViewById(R.id.view_pager);
mViewPagerIndicator = findViewById(R.id.view_pager_indicator);
setupViewPager();
initViewPager(savedInstanceState);
((PageIndicator) mViewPagerIndicator).setViewPager(mViewPager);
getSupportActionBar().setHomeButtonEnabled(true);
}