is there way to create white dot using code that shows progress of onboarding?

As you can see in this link(http://amyjokim.com/wp-content/uploads/2014/05/Duolingo-Onboarding-3.jpg)

AT the bottom of picture, There are dots to show the progress of onboarding. is there way to create white dot using code that shows progress of onboarding? What is the best way to create them? using image?

is there way to create white dot using code that shows progress of onboarding?

Answers


those are called ViewPagerIndicator.

This library provide options for a lot of shapes and sizes in viewpager indicator with sample application.

Include one of the widgets in your view. This should usually be placed adjacent to the ViewPager it represents.

<com.viewpagerindicator.TitlePageIndicator
    android:id="@+id/titles"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent" />

In your onCreate method (or onCreateView for a fragment), bind the indicator to the ViewPager.

//Set the pager with an adapter
 ViewPager pager = (ViewPager)findViewById(R.id.pager);
 pager.setAdapter(new TestAdapter(getSupportFragmentManager()));

 //Bind the title indicator to the adapter
 TitlePageIndicator titleIndicator = (TitlePageIndicator)findViewById(R.id.titles);
 titleIndicator.setViewPager(pager);

(Optional) If you use an OnPageChangeListener with your view pager you should set it in the indicator rather than on the pager directly.

 //continued from above
 titleIndicator.setOnPageChangeListener(mPageChangeListener);

try this code. Create a xml in drawables copy below code. If you want different colors changes ffffff to your_color

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape android:shape="oval">
        <solid android:color="#ffffff" />
        <size
            android:width="8dp"
            android:height="8dp" />
    </shape>
</item>

</layer-list>

Need Your Help

SQLite android NDK

sqlite android android-ndk

I'm trying to use a custom function in sqlite3.

How to get just one file from another branch, but which does not exist in the current branch?

git git-checkout

I have very a similar question to this question: https://stackoverflow.com/a/2364223/1716560