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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:41:59+00:00 2026-06-01T13:41:59+00:00

Background: I have an Activity that comprises four buttons that each take up a

  • 0

Background:
I have an Activity that comprises four buttons that each take up a quarter of the screen.
It contains a horizontal LinearLayout that is divided in half by two vertical LinearLayouts as shown in the image below:

https://i.stack.imgur.com/P7Wd3.jpg

Desired Effect:
When I touch a button, I would like it to animate and fill up the entire screen.

Issue:
I have accomplished the animation aspect by changing X and Y scales from 1 to 2 onClick.
The problem is, however, that the animated button will not show when it leaves its parent LinearLayout.

Thoughts

  1. I have tried making the non-animated buttons invisible, but the animated button will only show in its parent LinearLayout.

  2. I know this problem would be solved if I had used a single LinearLayout, but I was unable to use the “layout:weight” feature to make each button take up half of both width and length.

So… How should I approach this issue?

I would appreciate 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-06-01T13:42:00+00:00Added an answer on June 1, 2026 at 1:42 pm

    Try using a single RelativeLayout. Check this post for a nice example. You may have to setVisibility(View.INVISIBLE) for the other buttons.

    Alternative:

    1. Construct a RelativeLayout as above but put that as the only child
      of a FrameLayout.
    2. When animating a button, remove it from the RelativeLayout and add it to the FrameLayout specifying the gravity in the LayoutParams appropriately. This way the rest of the buttons will also be seen in the background during the animation.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large activity that contains 100 or more buttons. But it's working
I have an activity that gets some data from the internet in background while
I have an Activity that consists only of a huge EditText, full screen. To
I have a ScrollView in an activity that contains a WebView and it looks
I have an Activity that contains a FrameLayout and two views. The first is
I have a ListView on my Android Activity. When I scroll it, the background
Background: I have a kubuntu laptop right now that I can't use wirelessly, i.e.
Background: we have an application that generates reports from HTML (that may or may
I have an activity that extends ListView. I populate my list with the results
I currently have an Activity that when it gets displayed a Notification will also

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.