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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:05:38+00:00 2026-05-27T17:05:38+00:00

How can I rotate the RatingBar? Is there an example for a vertical custom

  • 0

How can I rotate the RatingBar?
Is there an example for a vertical custom RatingBar?

  • 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-27T17:05:38+00:00Added an answer on May 27, 2026 at 5:05 pm

    This is sample code for vertical rating bar…

    public class VerticalRatingBar extends RatingBar {
        private int x, y, z, w;
    
        @Override
        protected void drawableStateChanged() {
            // TODO Auto-generated method stub
            super.drawableStateChanged();
        }
    
        public VerticalRatingBar(Context context) {
            super(context);
        }
    
        public VerticalRatingBar(Context context, AttributeSet attrs, int defStyle) {
            super(context, attrs, defStyle);
        }
    
        public VerticalRatingBar(Context context, AttributeSet attrs) {
            super(context, attrs);
        }
    
        protected void onSizeChanged(int w, int h, int oldw, int oldh) {
            super.onSizeChanged(h, w, oldh, oldw);
            this.x = w;
            this.y = h;
            this.z = oldw;
            this.w = oldh;
        }
    
        @Override
        protected synchronized void onMeasure(int widthMeasureSpec,
                int heightMeasureSpec) {
            super.onMeasure(heightMeasureSpec, widthMeasureSpec);
            setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth());
        }
    
        protected void onDraw(Canvas c) {
            c.rotate(-90);
            c.translate(-getHeight(), 0);
            super.onDraw(c);
        }
    
        @Override
        public boolean onTouchEvent(MotionEvent event) {
            if (!isEnabled()) {
                return false;
            }
    
            switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
    
                setSelected(true);
                setPressed(true);
                break;
            case MotionEvent.ACTION_MOVE:
                setProgress(getMax()
                        - (int) (getMax() * event.getY() / getHeight()));
                onSizeChanged(getWidth(), getHeight(), 0, 0);
    
                break;
            case MotionEvent.ACTION_UP:
                setSelected(false);
                setPressed(false);
                break;
    
            case MotionEvent.ACTION_CANCEL:
                break;
            }
            return true;
        }
    
        @Override
        public synchronized void setProgress(int progress) {
    
            if (progress >= 0)
                super.setProgress(progress);
    
            else
                super.setProgress(0);
            onSizeChanged(x, y, z, w);
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using standart logger library in Python. There are RotatingFileHandler, that can rotate log
HI, Is there a way by which I can rotate an image inside a
I have a simple 3D cube that I can rotate using the following code:
I am trying to change my Sprite anchor point so that I can rotate
How can I rotate the Apache Access and Error logs on a Window 2000
How can I rotate the text within an HSSFCell class of Apache POI?
How can I rotate an Bitmap a given number of degrees while maintaining the
I'm having trouble roating an image around itself using Canvas. Since you can't rotate
My problem is this - I have a UIImageView which a user can rotate
I would like to build turret, that can rotate in all axis. So the

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.