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 6222073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:14:58+00:00 2026-05-24T08:14:58+00:00

I have a very specific component to realize. I don’t really know how to

  • 0

I have a very specific component to realize. I don’t really know how to do it.
The component is a segmented bar with a cursor that can select any segment. A segment selection should update the number of segment in the bar. A segment could have two “state” which is represented with 2 differents graphics.

IE : enter image description here

This may sound like a rating Bar but i really don’t know how to proceed (new with java and android).
Should i use Rating Bar and just change the stars by segments ?
Should i extend RatingBar (how ?) ?

Any help will be appreciated

  • 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-24T08:14:59+00:00Added an answer on May 24, 2026 at 8:14 am

    Looks like you’re going to have to write your own view. Don’t worry – it’s not so difficult (I did my first one without any sweat after 2 days of doing Android). Basically you have a class which extends View and you override the onDraw function which draws directly to the supplied Canvas. Make sure you override the onMeasure function too or your view will have no height!

    Have a look at the android page on Building Custom Components – a quick google or stack overflow search will give you many hints as to how to proceed too.

    Once you work out how to write a custom view (start with a small prototype) then you just need the logic of how this specific controller works. I’d probably have a collection to hold each of your segments, with each item being a class representing your data. In your onDraw then you just have to process the collection and draw to the screen.

    To get your touch to zoom, override the onTouchEventmethod, which will give you a MotionEvent object which you can call getX() and getY() on to return the coordinates of where the user touched your view – from there you can work out what segment the user touched and process the zoom.

    Let me know if you need any more help.

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

Sidebar

Related Questions

I have a very specific html table construct that seems to reveal a Gecko
I have a particular application that needs to calculate something very specific, and while
I have a component with two Pie Charts that display percentages at two specific
I have a very odd issue. When I execute a specific database stored procedure
i have very simple problem. I need to create model, that represent element of
I have very simple select like this: SELECT * FROM table WHERE column1 IN
I have a weird issue (weird because it is specific to one component) with
I have a 3rd party component that includes a .LIB and .DLL file. In
Very specific question but we have some good Ada people here so I would
I have very specific problem running PHP as Apache 2.2 module. When running PHP

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.