本文整理汇总了Java中com.viewpagerindicator.CirclePageIndicator类的典型用法代码示例。如果您正苦于以下问题:Java CirclePageIndicator类的具体用法?Java CirclePageIndicator怎么用?Java CirclePageIndicator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CirclePageIndicator类属于com.viewpagerindicator包,在下文中一共展示了CirclePageIndicator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_guide);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
ViewPager guide_viewpager = (ViewPager) findViewById(R.id.viewpager_guide);
CirclePageIndicator guide_indicator = (CirclePageIndicator) findViewById(R.id.indicator_guide);
String[] fileNames = new String[]{"guide1.png", "guide2.png"};
GuideAdapter adapter = new GuideAdapter(getSupportFragmentManager(), fileNames);
guide_viewpager.setAdapter(adapter);
guide_indicator.setViewPager(guide_viewpager);
KLog.d(BuildConfig.DEBUG + "" + BuildConfig.BUILD_TYPE);
}
示例2: onCreate
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_circles);
mAdapter = new CircleAdapter(getSupportFragmentManager());
mPager = (ViewPager)findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator.setViewPager(mPager);
mIndicator.setCurrentItem(mAdapter.getCount() - 1);
//You can also do: indicator.setViewPager(pager, initialPage);
}
示例3: onCreate
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//The look of this sample is set via a style in the manifest
setContentView(R.layout.simple_circles_stroke);
CircleAdapter mAdapter = new CircleAdapter(getSupportFragmentManager());
mPager = (ViewPager)findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
CirclePageIndicator mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
// mIndicator.setStrokeColor(0x535353);
// indicator.setStrokeColor(0xFF000000);
mIndicator.setViewPager(mPager);
}
示例4: onCreate
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_circles_stroke);
CircleAdapter mAdapter = new CircleAdapter(getSupportFragmentManager());
mPager = (ViewPager)findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator = indicator;
indicator.setViewPager(mPager);
final float density = getResources().getDisplayMetrics().density;
indicator.setBackgroundColor(0xFFCCCCCC);
indicator.setRadius(10 * density);
indicator.setPageColor(0x880000FF);
indicator.setFillColor(0xFF888888);
indicator.setStrokeColor(0xFF000000);
indicator.setStrokeWidth(2 * density);
}
示例5: onCreate
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_circles);
mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
mPager = (ViewPager)findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator.setViewPager(mPager);
mIndicator.setCurrentItem(mAdapter.getCount() - 1);
//You can also do: indicator.setViewPager(pager, initialPage);
}
示例6: onCreate
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_circles);
mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
mPager = (ViewPager)findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator = indicator;
indicator.setViewPager(mPager);
final float density = getResources().getDisplayMetrics().density;
indicator.setBackgroundColor(0xFFCCCCCC);
indicator.setRadius(10 * density);
indicator.setPageColor(0x880000FF);
indicator.setFillColor(0xFF888888);
indicator.setStrokeColor(0xFF000000);
indicator.setStrokeWidth(2 * density);
}
示例7: onCreateView
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_home, container, false);
initializeToolbar(v);
initializeDrawerLayout();
initializeFAB(v);
// Setting activity title
getActivity().setTitle(R.string.title_activity_main);
//Set the pager with an adapter
ViewPager pager = (ViewPager) v.findViewById(R.id.view_pager);
pager.setAdapter(new HomePagerAdapter(getChildFragmentManager()));
CirclePageIndicator indicator = (CirclePageIndicator) v.findViewById(R.id.indicator);
indicator.setViewPager(pager, 0);
return v;
}
示例8: onCreate
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_photos);
getWindow().setBackgroundDrawable(null);
final Intent intent = getIntent();
mAlbumId = intent.getIntExtra(Utils.EXTRA_NUMBER, 0);
mUrls = intent.getStringArrayExtra(Utils.EXTRA_URL);
mViewPager = (ViewPager) findViewById(R.id.content_pager);
mAdapter = new CursorPagerAdapter<PhotoFragment>(getSupportFragmentManager(), PhotoFragment.class, mUrls);
mViewPager.setAdapter(mAdapter);
mIndicator = (CirclePageIndicator) findViewById(R.id.titles);
mIndicator.setViewPager(mViewPager);
mViewPager.setCurrentItem(mAlbumId);
// Show the Up button in the action bar.
setupActionBar();
// setupInitPhotoLayout();
if (Tools.isShowInterstitialAd(this)) {
setupAds();
}
}
示例9: 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;
}
示例10: initComponents
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
private void initComponents(View view) throws IOException,
InterruptedException, ExecutionException, JSONException,
ParseException, LastDayException {
viewPager = (ViewPager) view.findViewById(R.id.viewpager);
indicator = (CirclePageIndicator) view.findViewById(R.id.titless);
httpTask = new HttpTask();
urls = new String[1];
urls[0] = APILink.link;
if (fileIsExist()) {
rawText = readFile();
adapter = new PageAdapter(getChildFragmentManager(), rawText);
viewPager.setAdapter(adapter);
// viewPager.setCurrentItem(3);
indicator.setViewPager(viewPager);
}
}
示例11: onCreate
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.welcome_viewpager_layout);
titleIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
// Instantiate a ViewPager and a PagerAdapter.
mPager = (ViewPager) findViewById(R.id.welcome_viewpager_layout);
mPagerAdapter = new WelcomePagerAdapter2(getFragmentManager()) {};
mPager.setAdapter(mPagerAdapter);
titleIndicator.setViewPager(mPager);
titleIndicator.setCurrentItem(mPagerAdapter.getCount()-1);
titleIndicator.setCurrentItem(0);
mPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
titleIndicator.setCurrentItem(position);
// When changing pages, reset the action bar actions since they are dependent
// on which page is currently active. An alternative approach is to have each
// fragment expose actions itself (rather than the activity exposing actions),
// but for simplicity, the activity provides the actions in this sample.
invalidateOptionsMenu();
}
});
}
示例12: onCreate
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_help);
if(getActionBar()!=null)
getActionBar().hide();
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
mIndicator = (CirclePageIndicator) findViewById(R.id.indicator);
mIndicator.setSnap(true);
mIndicator.setViewPager(mViewPager);
}
示例13: onCreate
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tutorial);
ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
ImagePagerAdapter adapter = new ImagePagerAdapter();
viewPager.setAdapter(adapter);
//Bind the title indicator to the adapter
CirclePageIndicator titleIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
titleIndicator.setViewPager(viewPager);
final TextView saltaTutorial = (TextView) findViewById(R.id.andiamo);
saltaTutorial.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// request your webservice here. Possible use of AsyncTask and ProgressDialog
// show the result here - dialog or Toast
saltaTutorial.setTextColor(getResources().getColor(R.color.bianco));
startActivity(new Intent(TutorialActivity.this,LoginRegActivity.class ));
}
});
}
示例14: 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);
}
示例15: onCreate
import com.viewpagerindicator.CirclePageIndicator; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.instructions);
mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager());
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator.setViewPager(mViewPager);
final float density = getResources().getDisplayMetrics().density;
mIndicator.setRadius(7 * density);
mIndicator.setFillColor(0xFFFFFFFF);
mIndicator.setPageColor(0xFF466066);
mIndicator.setStrokeColor(0xFFFFFFFF);
mIndicator.setStrokeWidth(2 * density);
mIndicator.setSnap(false);
}