Java Code Examples for com.viewpagerindicator.CirclePageIndicator

The following are top voted examples for showing how to use com.viewpagerindicator.CirclePageIndicator. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: smart-farmer-android   File: GuideActivity.java   View source code 6 votes vote down vote up
@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);
    }
 
Example 2
Project: android-open-project-demo-master   File: SampleCirclesInitialPage.java   View source code 6 votes vote down vote up
@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);
}
 
Example 3
Project: android-open-project-demo-master   File: SampleCirclesStyledTheme.java   View source code 6 votes vote down vote up
@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);
    }
 
Example 4
Project: android-open-project-demo-master   File: SampleCirclesStyledMethods.java   View source code 6 votes vote down vote up
@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);
}
 
Example 5
Project: android-open-project-demo-master   File: SampleCirclesInitialPage.java   View source code 6 votes vote down vote up
@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);
}
 
Example 6
Project: android-open-project-demo-master   File: SampleCirclesStyledMethods.java   View source code 6 votes vote down vote up
@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);
}
 
Example 7
Project: ViewPagerIndicator   File: SampleCirclesInitialPage.java   View source code 6 votes vote down vote up
@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);
}
 
Example 8
Project: ViewPagerIndicator   File: SampleCirclesStyledMethods.java   View source code 6 votes vote down vote up
@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);
}
 
Example 9
Project: AndroidDevCV   File: HomeFragment.java   View source code 6 votes vote down vote up
@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;
}
 
Example 10
Project: android-discourse   File: PhotosActivity.java   View source code 6 votes vote down vote up
@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();
    }

}
 
Example 11
Project: material-design-library   File: ViewPagerFragment.java   View source code 6 votes vote down vote up
@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;
}
 
Example 12
Project: YTUYemekhaneAndroid   File: ViewPagerDinner.java   View source code 6 votes vote down vote up
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);
	}

}
 
Example 13
Project: cluster-amap   File: SampleCirclesInitialPage.java   View source code 6 votes vote down vote up
@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);
}
 
Example 14
Project: cluster-amap   File: SampleCirclesStyledMethods.java   View source code 6 votes vote down vote up
@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);
}
 
Example 15
Project: my_ip_address_info   File: SampleCirclesInitialPage.java   View source code 6 votes vote down vote up
@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);
}
 
Example 16
Project: my_ip_address_info   File: SampleCirclesStyledMethods.java   View source code 6 votes vote down vote up
@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);
}
 
Example 17
Project: StraightComfort-Android   File: WelcomePagerAdapter.java   View source code 6 votes vote down vote up
@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();
        }
    });
}
 
Example 18
Project: listsketcher   File: HelpActivity.java   View source code 6 votes vote down vote up
@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);

}
 
Example 19
Project: TutorialView   File: SampleCirclesInitialPage.java   View source code 6 votes vote down vote up
@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);
}
 
Example 20
Project: TutorialView   File: SampleCirclesStyledMethods.java   View source code 6 votes vote down vote up
@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);
}
 
Example 21
Project: iWish   File: TutorialActivity.java   View source code 6 votes vote down vote up
@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 ));
		}
	});	
}
 
Example 22
Project: AndroidClient   File: SampleCirclesInitialPage.java   View source code 6 votes vote down vote up
@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);
}
 
Example 23
Project: AndroidClient   File: SampleCirclesStyledMethods.java   View source code 6 votes vote down vote up
@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);
}
 
Example 24
Project: android-open-project-demo   File: SampleCirclesInitialPage.java   View source code 6 votes vote down vote up
@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);
}
 
Example 25
Project: android-open-project-demo   File: SampleCirclesStyledTheme.java   View source code 6 votes vote down vote up
@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);
    }
 
Example 26
Project: android-open-project-demo   File: SampleCirclesStyledMethods.java   View source code 6 votes vote down vote up
@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);
}
 
Example 27
Project: android-open-project-demo   File: SampleCirclesInitialPage.java   View source code 6 votes vote down vote up
@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);
}
 
Example 28
Project: android-open-project-demo   File: SampleCirclesStyledMethods.java   View source code 6 votes vote down vote up
@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);
}
 
Example 29
Project: WayHoo   File: MainActivity.java   View source code 6 votes vote down vote up
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);
}
 
Example 30
Project: Hangar   File: Instructions.java   View source code 6 votes vote down vote up
@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);
}
 
Example 31
Project: qr2locate   File: ActivityFirstLaunch.java   View source code 6 votes vote down vote up
@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);
}
 
Example 32
Project: AlmeriBus   File: MostrarInfoParada.java   View source code 6 votes vote down vote up
@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();
}
 
Example 33
Project: MTweaks-KernelAdiutorMOD   File: ViewPagerDialog.java   View source code 5 votes vote down vote up
@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;
}
 
Example 34
Project: KernelAdiutor-Mod   File: ViewPagerDialog.java   View source code 5 votes vote down vote up
@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;
}
 
Example 35
Project: scab   File: MainActivity.java   View source code 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    onCreateDrawer();

    this.font = Fonts.getDegaws(null);


    // 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.
    viewPager = (ViewPager) findViewById(R.id.container);
    viewPager.setAdapter(mSectionsPagerAdapter);
    viewPager.setPageTransformer(false, new ViewPager.PageTransformer() {
        @Override
        public void transformPage(View page, float position) {
            // do transformation here
            final float normalizedposition = Math.abs(Math.abs(position) - 1);
            page.setScaleX(normalizedposition / 2 + 0.5f);
            page.setScaleY(normalizedposition / 2 + 0.5f);
        }
    });

    CirclePageIndicator indicator = (CirclePageIndicator) findViewById(R.id.viewpagerindicator);
    indicator.setViewPager(this.viewPager);


}
 
Example 36
Project: monolog-android   File: GuideActivity.java   View source code 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_guide);
    mIndicator = (CirclePageIndicator) findViewById(R.id.indicator);
    mPager = (ViewPager) findViewById(R.id.pager);
    initFragments();
}
 
Example 37
Project: pedefacil   File: ViewPagerFragment.java   View source code 5 votes vote down vote up
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);
    }
}
 
Example 38
Project: pedefacil   File: ViewPagerActivity.java   View source code 5 votes vote down vote up
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);
    }
}
 
Example 39
Project: android-open-project-demo-master   File: SampleCirclesDefault.java   View source code 5 votes vote down vote up
@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);
}
 
Example 40
Project: android-open-project-demo-master   File: SampleCirclesStyledLayout.java   View source code 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.themed_circles);

    CircleAdapter mAdapter = new CircleAdapter(getSupportFragmentManager());

    mPager = (ViewPager)findViewById(R.id.pager);
    mPager.setAdapter(mAdapter);

    mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
    mIndicator.setViewPager(mPager);
}