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

  • Home
  • SEARCH
  • 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 6172747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:26:45+00:00 2026-05-23T23:26:45+00:00

I have five shape draw able rectangular, I have to set the rectangle at

  • 0

I have five shape draw able rectangular, I have to set the rectangle at angle of (-20,-15,-10,-5,0)Degree. Each Rectangular have four colors shade. Now I need to animate each rectangle one by one and if user drag left to right then top rectangle moves to left to right.

Problem is, I can’t move each rectangle separately. How I can identify and implement each rectangle separately?

Here sample snapshot that i have to do.
http://postimage.org/image/13sa96sbo/

public ColorFanDraw(Context context) {
    super(context);
    // TODO Auto-generated constructor stub
}


@Override
protected void onDraw(Canvas canvasObject) {

    int x = 100;
    int y = 50;
    int width = 70;
    int convasSize =200;       

    Paint thePaint = new Paint();

    thePaint.setColor(mTouchedColor-200);   
    canvasObject.rotate(-15, centerX,centerY); 
    canvasObject.drawRect(new Rect(x,y,x+width,y+convasSize), thePaint);

    thePaint.setColor(mTouchedColor-50);    
    canvasObject.rotate(10, centerX,centerY);
    canvasObject.drawRect(new Rect(x,y,x+width,y+convasSize), thePaint);

    canvasObject.rotate(10, centerX,centerY);
    thePaint.setColor(mTouchedColor);
    canvasObject.drawRect(new Rect(x,y,x+width,y+convasSize), thePaint);

    rotation = AnimationUtils.loadAnimation(contextObj,
                                     R.anim.view_transition_in_left);

    ImageView img = new ImageView(contextObj);

    img.startAnimation(rotation);


}
  • 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-23T23:26:46+00:00Added an answer on May 23, 2026 at 11:26 pm

    You would need to store the rectangle objects in a variable before you draw them onto the Canvas.

    Rect rectangle1 = new Rect(x,y,x+width,y+convasSize);
    canvasObject.drawRect(rectangel1, thePaint);
    
    Rect rectangle2 = new Rect(x,y,x+width,y+convasSize);
    canvasObject.drawRect(rectangel2, thePaint);
    

    and so on.

    Then you can refer to the individual rectangles wherever you are doing your animation.

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

Sidebar

Related Questions

I have five different websites set up using Wordpress 3.0 Multisite. They each contain
I have five divs on my page (#art #fashion, #self, #nightlife, #community). right now,
I have a set of five boolean values. If more than one of these
I have a solution consisting of five projects, each of which compile to separate
I have been away from BCB for over five years, and now I am
I have five map reduce that I am running each separately. I want to
I have five consumers and one producer. The five consumers each output different data,
I have five movie clips in my library. I want to load each to
I have five text files that are produced by an R program, (each of
hi i have five buttons in a view and i am able to tap

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.