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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:29:57+00:00 2026-05-27T08:29:57+00:00

I am trying to create a mini progress bar that will indicate how much

  • 0

I am trying to create a mini progress bar that will indicate how much data a user has used. It doesn’t even need to animate, I just need it to change in size based on a variable I have set up. So when I load up the screen, how much of the progress bar is filled up will depend on a variable I have set up in Java.

I have managed to get this working horizontally by using

scale =  new ScaleAnimation(0.0f, 1.5f, 1.0f, 1.0f,1.0f, 1.0f);

This will start the image from nothing and stretching out to its full size, so I can use it as a horizontal progress bar which is great.

Now I woulda thought doing this vertically instead would be a simple matter of just changing the fromY to 0 and the toY to the new size I want. However when I do this, by changing the fromY to 0.0f and the toY to 2.0f, the image actually moves and stretches at the same time rather than stretching. Also the image moves position for some reason. It starts off higher up than where I positioned in using XML, and moves down to the original position and stretches out to the new scale I set up.

The code I use to try and stretch it vertically is

scale =  new ScaleAnimation(1.0f, 1.0f, 0.0f, 2.0f, 1.0f, 1.0f);

So can someone please explain why it stretches horizontally fine, but when I try to stretch it vertically, it suddenly moves and stretchs at the same time.

Would be very grateful for any help.

  • 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-27T08:29:58+00:00Added an answer on May 27, 2026 at 8:29 am

    I appreciate you have solved the animation issue you mentioned, but based on you saying you don’t even need the bar to animate, the ClipDrawable class may make your life simpler. You can define one in an xml layout and then set the clip level from your code, which will clip the given drawable by the given amount.

    Check this out for more details on how to use it:

    http://developer.android.com/guide/topics/resources/drawable-resource.html#Clip

    Hope that’s of some help.

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

Sidebar

Related Questions

I'm currently trying create a service that will return results of a OLAP cube
I'm new to js. trying to create mini validation function which will check fields
I'm trying to create a menu that will stick at the bottom of the
I am trying create a small web application that allows a user to login
I am trying create a WCF service that leverages the WPF MediaPlayer on the
Trying to create a user account in a test. But getting a Object reference
Trying to create my first iPhone app that would play back audio. When I
Trying to create a small monitor application that displays current internet usage as percentage
Trying to create a list to return some JSON data to a view. Following
I'm trying to use code similar to clrdump to create mini dumps in my

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.