本文整理汇总了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;
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
}
示例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();
}
});
}
}