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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:31:07+00:00 2026-05-26T14:31:07+00:00

To apply left to right scale toa button i have used the following code.

  • 0

To apply left to right scale toa button i have used the following code. My button is in the right of layout. I want the button should start from its right X position and scale to left X position how to achieve this?

view.startAnimation(new ScaleAnimation(0.0f, 1.0f, 1.0f, 1.0f));
  • 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-26T14:31:08+00:00Added an answer on May 26, 2026 at 2:31 pm

    You need to set the starting point to the middle right, you also need to set the duration of the animation like this:

    ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 1.0f, 1.0f, Animation.RELATIVE_TO_SELF,1.0f, Animation.RELATIVE_TO_SELF, 0.5f);
    anim.setDuration(700);
    view.startAnimation(anim);
    

    in your case the Y start location is not important.

    if you don’t get it read about this constructor:

    public ScaleAnimation (float fromX, float toX, float fromY, float toY, int pivotXType, float pivotXValue, int pivotYType, float
    pivotYValue)

    Since: API Level 1

    Constructor to use when building a ScaleAnimation from code

    Parameters:

    fromX: Horizontal scaling factor to apply at the start of the animation

    toX: Horizontal scaling factor to apply at the end of the animation

    fromY: Vertical scaling factor to apply at the start of the animation

    toY: Vertical scaling factor to apply at the end of the animation

    pivotXType: Specifies how pivotXValue should be interpreted. One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or
    Animation.RELATIVE_TO_PARENT.

    pivotXValue: The X coordinate of the point about which the object is being scaled, specified as an absolute number where 0 is the left
    edge. (This point remains fixed while the object changes size.) This
    value can either be an absolute number if pivotXType is ABSOLUTE, or a
    percentage (where 1.0 is 100%) otherwise.

    pivotYType: Specifies how pivotYValue should be interpreted. One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or
    Animation.RELATIVE_TO_PARENT.

    pivotYValue: The Y coordinate of the point about which the object is being scaled, specified as an absolute number where 0 is the top
    edge. (This point remains fixed while the object changes size.) This
    value can either be an absolute number if pivotYType is ABSOLUTE, or a
    percentage (where 1.0 is 100%) otherwise.

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

Sidebar

Related Questions

In C/C++, is there an easy way to apply bitwise operators (specifically left/right shifts)
I have the following code and was expecting TABLE will shrink with browser window.
I understand that Composite Indexes are always used Left to Right (e.g. if an
Can I apply both position: relative and float: left on one element? Like this:
I want to apply an XSLT Stylesheet to an XML Document using C# and
How do I apply the MarshalAsAttribute to the return type of the code below?
How do I apply 'use base' in Perl to inherit subs from some base
Imagine I have a rectangle say 400px x 300px. Then let’s say I want
i have a 3x? grid of divs. I want to select div's marked a
I have a button that loads more data into a datagrid when clicked. To

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.