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


Java CirclePageIndicator.setOnPageChangeListener方法代碼示例

本文整理匯總了Java中com.viewpagerindicator.CirclePageIndicator.setOnPageChangeListener方法的典型用法代碼示例。如果您正苦於以下問題:Java CirclePageIndicator.setOnPageChangeListener方法的具體用法?Java CirclePageIndicator.setOnPageChangeListener怎麽用?Java CirclePageIndicator.setOnPageChangeListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.viewpagerindicator.CirclePageIndicator的用法示例。


在下文中一共展示了CirclePageIndicator.setOnPageChangeListener方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreateView

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    Toast.makeText(getActivity(), "onCreateView ViewPagerFragment", Toast.LENGTH_SHORT).show();
    View view = inflater.inflate(R.layout.fragment_view_pager, container, false);

    if (viewPagerItems != null && viewPagerItems.size() > 0) {
        ViewPager pager = (ViewPager) view.findViewById(R.id.viewpager);
        pager.setAdapter(new ViewPagerWithTabsAdapter(getActivity(), getActivity().getSupportFragmentManager(), viewPagerItems));
        int defaultViewPagerItemSelectedPosition = defaultViewPagerItemSelectedPosition();
        if (defaultViewPagerItemSelectedPosition >= 0 && defaultViewPagerItemSelectedPosition < viewPagerItems.size())
            pager.setCurrentItem(defaultViewPagerItemSelectedPosition);

        if (!showViewPagerIndicator()) {
            pager.setOnPageChangeListener(mOnPageChangeListener);
        } else {
            CirclePageIndicator viewPagerIndicator = (CirclePageIndicator) view.findViewById(R.id.viewpagerindicator);
            viewPagerIndicator.setViewPager(pager);
            viewPagerIndicator.setVisibility(View.VISIBLE);
            viewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
        }

        replaceTitle(viewPagerItems.get(0).getTitleResource());
    }
    return view;
}
 
開發者ID:lengpiseth,項目名稱:material-design-library,代碼行數:27,代碼來源:ViewPagerFragment.java

示例2: initViews

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
private void initViews() {
	setSwipeBackEnable(false);
	mBlurImageView = (ImageView) findViewById(R.id.blur_overlay_img);
	mRootView = (FrameLayout) findViewById(R.id.root_view);
	mAddCityBtn = (Button) findViewById(R.id.add_city_btn);
	mAddCityBtn.setOnClickListener(this);
	mTitleTextView = (TextView) findViewById(R.id.location_city_textview);
	mLocationIV = (ImageView) findViewById(R.id.curr_loc_icon);
	mMainViewPager = (ViewPager) findViewById(R.id.main_viewpager);
	ParallaxPagerTransformer pt = new ParallaxPagerTransformer((R.id.top_part));
       //pt.setBorder(20);
       pt.setSpeed(0.5f);
       mMainViewPager.setPageTransformer(false, pt);
	mFragmentAdapter = new WeatherPagerAdapter(this);
	mMainViewPager.setAdapter(mFragmentAdapter);
	mCirclePageIndicator = (CirclePageIndicator) findViewById(R.id.indicator);
	mCirclePageIndicator.setViewPager(mMainViewPager);
	mCirclePageIndicator.setOnPageChangeListener(this);

	mTitleTextView.setOnClickListener(this);
	findViewById(R.id.sidebarButton).setOnClickListener(this);
	mShareBtn = (ImageView) findViewById(R.id.shareButton);
	mShareBtn.setOnClickListener(this);
}
 
開發者ID:way1989,項目名稱:WayHoo,代碼行數:25,代碼來源:MainActivity.java

示例3: showIndicator

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
private void showIndicator(View view, ViewPager pager) {
    if (!showViewPagerIndicator()) pager.setOnPageChangeListener(mOnPageChangeListener);
    else {
        mViewPagerIndicator = (CirclePageIndicator) view.findViewById(R.id.viewpagerindicator);
        mViewPagerIndicator.setViewPager(pager);
        mViewPagerIndicator.setVisibility(View.VISIBLE);
        mViewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
    }
}
 
開發者ID:alessandrogurgel,項目名稱:pedefacil,代碼行數:10,代碼來源:ViewPagerFragment.java

示例4: showIndicator

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
private void showIndicator(ViewPager pager) {
    if (!showViewPagerIndicator()) {
        pager.setOnPageChangeListener(mOnPageChangeListener);
    } else {
        mViewPagerIndicator = (CirclePageIndicator)
                findViewById(R.id.viewpagerindicator);
        mViewPagerIndicator.setViewPager(pager);
        mViewPagerIndicator.setVisibility(View.VISIBLE);
        mViewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
    }
}
 
開發者ID:alessandrogurgel,項目名稱:pedefacil,代碼行數:12,代碼來源:ViewPagerActivity.java

示例5: init

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void init() {
	mSelectedList = (ArrayList<MediaInfo>) getIntent()
			.getSerializableExtra(MediaConstants.MEDIA_REQUEST_DATAS);
	mPosition = getIntent().getIntExtra(MediaConstants.MEDIA_POSITION, 0);
	mV_title_bar = findViewById(R.id.titleBar);
	mPreview_type = getIntent().getIntExtra(
			MediaConstants.MEDIA_PREVIEW_TYPE, 0);
	if (mPreview_type == 0) {
		mV_title_bar.setVisibility(View.GONE);
	} else {
		mV_title_bar.setVisibility(View.VISIBLE);
		findViewById(R.id.iv_left).setOnClickListener(this);
		ImageView iv_right = (ImageView) findViewById(R.id.iv_right);
		iv_right.setOnClickListener(this);
		iv_right.setImageResource(R.drawable.zg_default_delete);
		((TextView) findViewById(R.id.title))
				.setText(R.string.zg_content_media_pic_preview);
	}

	mViewPager = (ViewPager) findViewById(R.id.pager);
	mIndicator = (CirclePageIndicator) findViewById(R.id.indicator);

	mIndicator.setOnPageChangeListener(this);
	mViewPager.setPageMargin(getResources().getDimensionPixelOffset(
			R.dimen.zg_viewpage_margin));

	mHandler.sendEmptyMessage(0);
}
 
開發者ID:BigAppOS,項目名稱:BigApp_WordPress_Android,代碼行數:30,代碼來源:MediaPreviewActivity.java

示例6: showIndicator

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
private void showIndicator(View view, ViewPager pager) {
    if (!showViewPagerIndicator()) pager.addOnPageChangeListener(mOnPageChangeListener);
    else {
        mViewPagerIndicator = (CirclePageIndicator) view.findViewById(R.id.viewpagerindicator);
        mViewPagerIndicator.setViewPager(pager);
        mViewPagerIndicator.setVisibility(View.VISIBLE);
        mViewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
    }
}
 
開發者ID:andreister,項目名稱:hasty,代碼行數:10,代碼來源:ViewPagerFragment.java

示例7: showIndicator

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
private void showIndicator(ViewPager pager) {
    if (!showViewPagerIndicator()) {
        pager.addOnPageChangeListener(mOnPageChangeListener);
    } else {
        mViewPagerIndicator = (CirclePageIndicator)
                findViewById(R.id.viewpagerindicator);
        mViewPagerIndicator.setViewPager(pager);
        mViewPagerIndicator.setVisibility(View.VISIBLE);
        mViewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
    }
}
 
開發者ID:andreister,項目名稱:hasty,代碼行數:12,代碼來源:ViewPagerActivity.java

示例8: onCreate

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_view_pager);

    Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
    toolbar.setTitleTextColor(getResources().getColor(android.R.color.white));
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowHomeEnabled(true);

    ViewPagerHandler handler = getViewPagerHandler();
    if (handler != null && handler.getViewPagerItems() != null)
        viewPagerItems = handler.getViewPagerItems();

    if (viewPagerItems != null && viewPagerItems.size() > 0) {
        ViewPager pager = (ViewPager) findViewById(R.id.viewpager);
        pager.setAdapter(new ViewPagerWithTabsAdapter(this, getSupportFragmentManager(), viewPagerItems));
        int defaultViewPagerItemSelectedPosition = defaultViewPagerItemSelectedPosition();
        if (defaultViewPagerItemSelectedPosition >= 0 && defaultViewPagerItemSelectedPosition < viewPagerItems.size())
            pager.setCurrentItem(defaultViewPagerItemSelectedPosition);

        if (!showViewPagerIndicator()) {
            pager.setOnPageChangeListener(mOnPageChangeListener);
        } else {
            CirclePageIndicator viewPagerIndicator = (CirclePageIndicator) findViewById(R.id.viewpagerindicator);
            viewPagerIndicator.setViewPager(pager);
            viewPagerIndicator.setVisibility(View.VISIBLE);
            viewPagerIndicator.setOnPageChangeListener(mOnPageChangeListener);
        }

        replaceTitle(viewPagerItems.get(0).getTitleResource());
    }
}
 
開發者ID:lengpiseth,項目名稱:material-design-library,代碼行數:34,代碼來源:ViewPagerActivity.java

示例9: onCreate

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

//        Intent intent = new Intent(this, GuestMainActivity.class);
//        intent.putExtra("doctor_id", "5");
//        intent.putExtra("date", "1394/6/");
//        startActivity(intent);
//        finish();
//        if (true) return;
        setContentView(R.layout.intro);
        context = this;
        parallaxContainer = (ParallaxContainer) findViewById(R.id.parallaxcontainer);

        if (parallaxContainer != null) {

            parallaxContainer.setLooping(false);
            parallaxContainer.setOnPageChangeListener(new ParallaxContainer.OnPageChangeListener() {
                @Override
                public void onPageSelected(int position) {
                    if (position + 1 == parallaxContainer.getPageCount()) {
                        startActivity(new Intent(Intro.this, Login.class));
                        Intro.this.finish();
                        Intro.this.overridePendingTransition(R.anim.fade_in, R.anim.nude);
                    }
                }
            });

            indicator = (CirclePageIndicator) findViewById(R.id.indicators);


            final ViewPager vp = parallaxContainer.setupChildren(getLayoutInflater(), R.drawable.intro_background,
                    R.layout.intro_1,
                    R.layout.intro_2,
                    R.layout.intro_3,
                    R.layout.intro_4);

            indicator.setOnPageChangeListener(parallaxContainer);

            indicator.setViewPager(vp);
        }

    }
 
開發者ID:maysamrasoli,項目名稱:Doctor,代碼行數:44,代碼來源:Intro.java

示例10: onCreate

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(com.github.epicprojects.glider.R.layout.activity_walkthrough);
       context = this;
	   parallaxContainer = (ParallaxContainer) findViewById(com.github.epicprojects.glider.R.id.parallaxcontainer);

	    if (parallaxContainer != null) {

	      parallaxContainer.setLooping(false);

              indicator = (CirclePageIndicator) findViewById(com.github.epicprojects.glider.R.id.indicators);


	           final ViewPager vp =  parallaxContainer.setupChildren(getLayoutInflater(), com.github.epicprojects.glider.R.raw.ny_blurred,
                          com.github.epicprojects.glider.R.layout.view_walkthrough1,
                          com.github.epicprojects.glider.R.layout.view_walkthrough2,
                          com.github.epicprojects.glider.R.layout.view_walkthrough3);

               indicator.setOnPageChangeListener(parallaxContainer);

               indicator.setViewPager(vp);


	    btn = (Button) parallaxContainer.findViewById(com.github.epicprojects.glider.R.id.getstarted);
	    btn.setOnClickListener(new  OnClickListener() {
			
			@Override
			public void onClick(View v) {
				
				Toast.makeText(context, "Hello!", Toast.LENGTH_LONG).show();
				
			}
		});
	    }
	    
	
}
 
開發者ID:epicprojects,項目名稱:glider,代碼行數:39,代碼來源:WalkthroughActivity.java


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