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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:30:27+00:00 2026-05-30T06:30:27+00:00

I have Four EditText with different background. It looks like this: I want to

  • 0

I have Four EditText with different background.
It looks like this:
enter image description here

I want to cover full screen when a EditText is selected with That EditText. For that I need to change the EditText width and height with some animation on Runtime.

When selected It should look like this:
enter image description here

How can I change EditText size with animation on Runtime ?

  • 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-30T06:30:29+00:00Added an answer on May 30, 2026 at 6:30 am

    I’m not sure if it can be done with Animations. In android view takes all space before animation finished, so you will see that other editTexts disappears and selected one slowly increasing. Here is rough example how to do it without standart animations, but changing weights in separate thread:

    layout:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
    
    <LinearLayout
        android:id="@+id/ll0"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="horizontal" >
    
        <EditText
            android:id="@+id/et00"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:gravity="top|left"
            android:text="00" />
    
        <EditText
            android:id="@+id/et01"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:gravity="top|left"
            android:text="01" />
    </LinearLayout>
    
    <LinearLayout
        android:id="@+id/ll1"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="horizontal" >
    
        <EditText
            android:id="@+id/et10"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:gravity="top|left"
            android:text="10" />
    
        <EditText
            android:id="@+id/et11"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:gravity="top|left"
            android:text="11" />
    </LinearLayout>
    </LinearLayout>
    

    and in code add actions on changing focus:

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        OnFocusChangeListener focusListener = new OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if (hasFocus) {
                    LinearLayout parent = (LinearLayout) v.getParent();
                    EditText forDecresing = null;
                    for (int i = 0; i < parent.getChildCount(); i++) {
                        if (parent.getChildAt(i) != v) {
                            forDecresing = (EditText) parent.getChildAt(i);
                            break;
                        }
                    }
                    LinearLayout pp = (LinearLayout) parent.getParent();
                    LinearLayout layoutForDecreasing = null;
                    for (int i = 0; i < pp.getChildCount(); i++) {
                        if (pp.getChildAt(i) != parent && pp.getChildAt(i) instanceof LinearLayout) {
                            layoutForDecreasing = (LinearLayout) pp.getChildAt(i);
                            break;
                        }
                    }
                    startAnimation((EditText) v, forDecresing, layoutForDecreasing, parent);
                } else {
                }
            }
        };
    
        ((EditText) findViewById(R.id.et00)).setOnFocusChangeListener(focusListener);
        ((EditText) findViewById(R.id.et01)).setOnFocusChangeListener(focusListener);
        ((EditText) findViewById(R.id.et11)).setOnFocusChangeListener(focusListener);
        ((EditText) findViewById(R.id.et10)).setOnFocusChangeListener(focusListener);
    }
    
    public void onBackPressed() {
        setWeight(findViewById(R.id.et00), 1);
        setWeight(findViewById(R.id.et01), 1);
        setWeight(findViewById(R.id.et11), 1);
        setWeight(findViewById(R.id.et10), 1);
        setWeight(findViewById(R.id.ll1), 1);
        setWeight(findViewById(R.id.ll0), 1);
    }
    
    Thread animationThread;
    
    private void startAnimation(final EditText forIncreasing, final EditText forDecresing, final LinearLayout layoutForDecreasing,
            final LinearLayout layoutForIncreasing) {
        if (animationThread != null)
            animationThread.interrupt();
        animationThread = new Thread(new Runnable() {
            @Override
            public void run() {
                int iterations = 0;
                int maxIterations = 30;
                setWeight(forIncreasing, maxIterations - 1);
                setWeight(layoutForIncreasing, maxIterations - 1);
                setWeight(forDecresing, maxIterations - 1);
                setWeight(layoutForDecreasing, maxIterations - 1);
                while (iterations < maxIterations) {
                    iterations++;
                    setWeight(forIncreasing, maxIterations - 1 + iterations);
                    setWeight(layoutForIncreasing, maxIterations - 1 + iterations);
                    setWeight(forDecresing, maxIterations - 1 - iterations);
                    setWeight(layoutForDecreasing, maxIterations - 1 - iterations);
                    try {
                        Thread.sleep(10);
                    } catch (InterruptedException e) {
                        return;
                    }
                }
                animationThread = null;
            }
        });
        animationThread.start();
    }
    
    private void setWeight(final View view, final float weight) {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                LayoutParams params = (LayoutParams) view.getLayoutParams();
                params.weight = weight;
                view.setLayoutParams(params);
            }
        });
    }
    

    I do not know if this is possible for you, but in this example you can add some more movements quite easy.

    I do not recommend use it production, if only you have some other options.

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

Sidebar

Related Questions

I have four tables in my database and i want to join that's and
I have four DB tables in an Oracle database that need to be rewritten/refreshed
I have four html elements that when clicked I want to have a specific
I have four videos that I would like to tile in a 2x2 fashion
I have four divs in my html page something like this: the working fiddle
I have four different lists. headers , descriptions , short_descriptions and misc . I
I have four models that are related to one another, the way I have
i have four tables like below in sql server 2008 : TABLE 1 ->
i have a small form with four EditText fields in which second EditText is
I have four textfields that bind to the model key path. If a number

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.