Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5960885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:53:16+00:00 2026-05-22T18:53:16+00:00

Untitled Question

  • 0

Android Controls

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:53:16+00:00Added an answer on May 22, 2026 at 6:53 pm

    It is non-standard control.

    I’ve implemented it. I’ve done it in easy way and just draw all that I need on ImageView.

    My code looks like this. It can be further improved (e.g. move sizes or definition of colors in xml layout), but you can get the idea from it. And it doesn’t take into account different sizes and densities of devices’ screens.

    /**
    * Padding between circles displaying position
    */
    private static final int PADDING = 20;
    /**
     * Radius of circles displaying position
     */
    private static final int RADIUS = 4;
    // Color of the selected element's indicator
    private int activeColor;
    // Color of the not selected element's indicator
    private int inactiveColor;
    
    // Call this in View constructor or in activity onCreate()
    Resources res = getResources();
    activeColor = res.getColor(R.color.sliderActiveColor);
    inactiveColor = res.getColor(R.color.sliderInactiveColor);
    
    /**
     * Draws position of current element.
     * Call it on fling events.
     * @param currentPosition Current element position
     */
    protected void drawPosition(int currentPosition) {
        // Control height
        final int height = 20;
        // Control width
        final int bmpWidth = 200;
    
        // Count of all elements
        int count = viewFlipper.getChildCount();
    
        // Calculate first element position on canvas  
        float initialPosition = bmpWidth / 2 - (count - 1) * (PADDING / 2 + RADIUS);
        final int shift = PADDING + 2 * RADIUS;
    
        Bitmap bitmap = Bitmap.createBitmap(bmpWidth, height, Config.ARGB_8888);
    
        Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
        paint.setStyle(Style.FILL);
        Canvas c = new Canvas(bitmap);
    
        for (int i = 0; i < count; i++) {
            // Draw circle for each element, current element with different color
            if (i == currentPosition) {
                paint.setColor(activeColor);
            } else {
                paint.setColor(inactiveColor);
            }
            c.drawCircle(initialPosition + i * shift, PADDING / 2, RADIUS, paint);
        }
    
        // Draw on ImageView
        sliderImage.setImageBitmap(bitmap);
    }
    

    And the result:

    Fling indicator

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Untitled Question
Question I'm trying to build a quick and easy ASP.NET page that redirects a
I've asked this question to the forums on the Mootools website and one person
I have a question regarding image alignment with CSS. For example I have created
This might be quite a trivial question, but which of these methods is best
This is related to my previous question here . I want 4 divs (absolute
I have the following code <html> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8 /> <title>Untitled Document</title>
Developing is more of a hobby at the moment; so apologies if this is
I'm developing a platform for developing desktop apps with web technologies. In the course
I have a very big problem solving this issue I have 2 tables first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.