當前位置: 首頁>>代碼示例>>Java>>正文


Java PageIndicator類代碼示例

本文整理匯總了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);
}
 
開發者ID:dotcool,項目名稱:mvideo,代碼行數:20,代碼來源:MainActivity.java

示例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();
}
 
開發者ID:Openredu,項目名稱:mobile,代碼行數:25,代碼來源:HomeActivity.java

示例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);
}
 
開發者ID:brk3,項目名稱:glimmr,代碼行數:26,代碼來源:PhotoInfoFragment.java

示例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);
}
 
開發者ID:pjq,項目名稱:pushup,代碼行數:19,代碼來源:UserGuideActivity.java

示例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);
}
 
開發者ID:sysdharma,項目名稱:py-eventos-android,代碼行數:33,代碼來源:TrackScheduleEventActivity.java

示例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);
}
 
開發者ID:Sash0k,項目名稱:Thrift-box,代碼行數:13,代碼來源:MainActivity.java

示例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();
}
 
開發者ID:xiaoma1219,項目名稱:netkuu.player,代碼行數:11,代碼來源:HomeFragment.java

示例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;
}
 
開發者ID:xiaoma1219,項目名稱:netkuu.player,代碼行數:12,代碼來源:ChannelFragment.java

示例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;
}
 
開發者ID:jonathangerbaud,項目名稱:Klyph,代碼行數:12,代碼來源:TitledViewPagerActivity.java

示例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);
}
 
開發者ID:75py,項目名稱:DisableManager,代碼行數:16,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:kortkoll,項目名稱:kortkoll-android,代碼行數:15,代碼來源:CardsActivity.java

示例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);
}
 
開發者ID:ManuelPeinado,項目名稱:NumericPageIndicator,代碼行數:12,代碼來源:ButtonsInLandscapeActivity.java

示例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);
}
 
開發者ID:ManuelPeinado,項目名稱:NumericPageIndicator,代碼行數:12,代碼來源:StylingInLayoutActivity.java

示例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;
				};
			});
}
 
開發者ID:keyboardr,項目名稱:GlassTunes,代碼行數:38,代碼來源:ScreenSlideActivity.java

示例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);
}
 
開發者ID:antonyt,項目名稱:TflTravelAlerts,代碼行數:14,代碼來源:MainActivity.java


注:本文中的com.viewpagerindicator.PageIndicator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。