当前位置: 首页>>代码示例>>Java>>正文


Java CirclePageIndicator类代码示例

本文整理汇总了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);
    }
 
开发者ID:beanu,项目名称:smart-farmer-android,代码行数:21,代码来源:GuideActivity.java

示例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);
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:17,代码来源:SampleCirclesInitialPage.java

示例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);
    }
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:18,代码来源:SampleCirclesStyledTheme.java

示例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);
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:23,代码来源:SampleCirclesStyledMethods.java

示例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);
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:17,代码来源:SampleCirclesInitialPage.java

示例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);
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:23,代码来源:SampleCirclesStyledMethods.java

示例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;
}
 
开发者ID:Alviere,项目名称:AndroidDevCV,代码行数:21,代码来源:HomeFragment.java

示例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();
    }

}
 
开发者ID:goodev,项目名称:android-discourse,代码行数:26,代码来源:PhotosActivity.java

示例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;
}
 
开发者ID:lengpiseth,项目名称:material-design-library,代码行数:27,代码来源:ViewPagerFragment.java

示例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);
	}

}
 
开发者ID:TowerLabs,项目名称:YTUYemekhaneAndroid,代码行数:23,代码来源:ViewPagerDinner.java

示例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();
        }
    });
}
 
开发者ID:JMtorii,项目名称:StraightComfort-Android,代码行数:26,代码来源:WelcomePagerAdapter.java

示例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);

}
 
开发者ID:gangeshwark,项目名称:listsketcher,代码行数:22,代码来源:HelpActivity.java

示例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 ));
		}
	});	
}
 
开发者ID:ComputerEngineering,项目名称:iWish,代码行数:24,代码来源:TutorialActivity.java

示例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);
}
 
开发者ID:way1989,项目名称:WayHoo,代码行数:25,代码来源:MainActivity.java

示例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);
}
 
开发者ID:corcoran,项目名称:Hangar,代码行数:22,代码来源:Instructions.java


注:本文中的com.viewpagerindicator.CirclePageIndicator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。