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


Java CirclePageIndicator.setViewPager方法代碼示例

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


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

示例1: 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:Commit451,項目名稱:ViewPagerIndicator,代碼行數:23,代碼來源:SampleCirclesStyledMethods.java

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: onCreate

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

    // Create the adapter that will return a fragment for each of the three
    // primary sections of the app.
    mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

    // Set up the ViewPager with the sections adapter.
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mSectionsPagerAdapter);
    //mViewPager.setPageTransformer(true, new ZoomOutPageTransformer());

    //Bind the title indicator to the adapter
    mPageIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
    mPageIndicator.setViewPager(mViewPager);
}
 
開發者ID:heinrichloewen,項目名稱:qr2locate,代碼行數:19,代碼來源:ActivityFirstLaunch.java

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: onResume

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
@Override
public void onResume() {
	InfoFragmentPagerAdapter adapter = new InfoFragmentPagerAdapter(getChildFragmentManager());
	ArrayList<Integer> lineas = new ArrayList<Integer>();
	for(Integer l : DataStorage.paradas.get(numParada).getLineas()) {
		lineas.add(l);
	}
	adapter.addItem(InfoParadaFragment.newInstance(numParada, lineas));
	Parada paradaActual = DataStorage.paradas.get(numParada);
	if(paradaActual.getRepetida() != null){
		
		int otraParada = paradaActual.getRepetida().getId();
		adapter.addItem(InfoParadaFragment.newInstance(otraParada, lineas));
	}
	vPager.setAdapter(adapter);
	CirclePageIndicator indicator = (CirclePageIndicator) content.findViewById(R.id.indicator);
	if(vPager.getAdapter().getCount() > 1) {
		indicator.setViewPager(vPager);
	} else {
		indicator.setVisibility(View.GONE);
	}
	super.onStart();
}
 
開發者ID:Arasthel,項目名稱:AlmeriBus,代碼行數:24,代碼來源:MostrarInfoParada.java

示例15: onCreateView

import com.viewpagerindicator.CirclePageIndicator; //導入方法依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                         @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.viewpager_view, container, false);

    ViewPager viewPager = (ViewPager) rootView.findViewById(R.id.viewpager);
    CirclePageIndicator indicator = (CirclePageIndicator) rootView.findViewById(R.id.indicator);
    viewPager.setAdapter(new RecyclerViewFragment.ViewPagerAdapter(getChildFragmentManager(), mFragments));
    indicator.setViewPager(viewPager);

    return rootView;
}
 
開發者ID:morogoku,項目名稱:MTweaks-KernelAdiutorMOD,代碼行數:14,代碼來源:ViewPagerDialog.java


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