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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:36:52+00:00 2026-06-02T19:36:52+00:00

hello i saw this code that make a scale animation for a list view

  • 0

hello i saw this code that make a scale animation for a list view

public class ViewAnimation extends Animation {
float centerX, centerY;
public ViewAnimation3(){}
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
super.initialize(width, height, parentWidth, parentHeight);
centerX = width/2.0f;
centerY = height/2.0f;
setDuration(2500);
setFillAfter(true);
setInterpolator(new LinearInterpolator());
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
final Matrix matrix = t.getMatrix();
matrix.setScale(interpolatedTime, interpolatedTime);
matrix.preTranslate(-centerX, -centerY);
matrix.postTranslate(centerX, centerY);
}
}

i know that this will make the animation from the center of the Activity not from the top-left point but i don’t understand where is these points are( -centerX,-centerY) and respect to what to the animation top-left corner or view !!

  • 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-06-02T19:36:53+00:00Added an answer on June 2, 2026 at 7:36 pm

    If you’re talking about the matrix operations, that’s quite simple: the basic setScale applies a scaling around the origin. So by pre-concatenating a translation of the specified centre point to the origin, and post-concatenating the opposite translation to move back to the centre point, you get a scaling around the centre point instead.

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

Sidebar

Related Questions

i saw this code somewhere switch(greet){ case HELLO: System.out.println(Formal Greeting); break; case HI: System.out.println(Friendly
I use this C++ code for storing x to the variable val. class Hello
I once saw this line of code: std::cout %lt;%lt; Hello world! %lt;%lt; std:: endl;
Recently I saw this piece of JavaScript code, but have been unable to understand
I was browsing the Django source code and I saw this function: def colorize(text='',
I just saw this here #include <stdio.h> int main(int argc, char *argv[printf(Hello, world!\n)]) {}
Hello I'm trying to make a program that check first letter of a word
I saw a piece of code earlier this week (which, unfortunately, I am unable
Hello i would like do somthing like that: <?php $count = 0; foreach($a as
Hello I have this query... if (isset($_REQUEST['deletePost'])) { $q = $dbc -> prepare(DELETE FROM

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.