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

Emmanuel Ayela
  • 192
  • 2
  • 11

2 Answers2

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

Aniket-Shinde
  • 213
  • 3
  • 9
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.

Dr. Dreave
  • 539
  • 5
  • 13
  • 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 – Emmanuel Ayela Mar 17 '16 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 '16 at 18:05