0

Am developing an android chat application. Everything works well but except for one thing; I want to set the visibility of a layout to gone and then set a different layout to visible when user starts typing in the edittext like the one implemented on whatsapp. But I cant seem to figure it out. Any help will be appreciated

Basically, what I want to do is set the visibility of a layout which contains an image button to upload image to gone and then show a layout which contains an image button to send the message or text in the edittext to visible when the user starts typing

2

2 Answers 2

2

Can you explain in detail? Do you wan edit text to come up when keyboard is hoped up. then use below in your manifest.

<activity
        android:name=".Activityname"

        android:windowSoftInputMode="adjustPan">

If not, then please explain your question in more detail

1

Take a look at the TextChangedListener. With help of the TextWatcher you should be able to run commands when the input changes.

Please describe in more detail, if you need further assistance.

2
  • what I want to do is set the visibility of a layout which contains an image button to upload image to gone and then show a layout which contains an image button to send the message or text in the edittext to visible when the user starts typing Mar 17, 2016 at 18:03
  • Then the TextChangedListener (linked above) is exactly what you need. Check in the listener if the text's length is greather than 0 and apply the desired changes to the layout.
    – Dr. Dreave
    Mar 17, 2016 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.