0

enter image description here

I want to do something like the image.

This is an email fill button. when the user enter his email, the title "אימייל"("Email) should be disable ,so that use cannot touch it.

what is the way to do it? thanks :)

Krupa Patel
  • 3,309
  • 3
  • 23
  • 28
GO VEGAN
  • 1,113
  • 3
  • 15
  • 44

2 Answers2

1

You can do like this :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F2F2F2"
android:orientation="horizontal" >

<TextView
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:padding="3dp"
    android:text="Your mail" />

<View
    android:layout_width="1dp"
    android:layout_height="30dp"
    android:layout_marginBottom="3dp"
    android:layout_marginTop="3dp"
    android:background="#000000"
    android:text="New Button" />

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:background="@android:color/transparent"
    android:padding="5dp"
    android:text="אימייל" />

The result is :

enter image description here

Farouk Touzi
  • 3,451
  • 2
  • 19
  • 25
0

Make one textwatcher for that edittext and if total Charactes are >0 then enable your button other wise

Yourbutton.setEnable(false)

Try that. Here is the textwatcher example

https://stackoverflow.com/a/8543479/2931489

Community
  • 1
  • 1
Harsh Patel
  • 1,056
  • 2
  • 10
  • 20