After updating my ADT to ADT 11.0, i got just a little surprise that Android has tried a lot to make developer’s life easy to design UI. I have found one great things i.e. Android has provided different EditText to enter suitable information like EditText for Phone Number, EditText for Email, EditText for Time, EditText for Date, EditText for Number, etc.
But if you notice the XML layout file, Android has just set android:inputType attribute inside the EditText.
For Example:
EditText – PersonName:
<EditText android:id="@+id/editText2" android:layout_height="wrap_content" android:layout_width="match_parent" android:inputType="textPersonName"></EditText>
Android – EditText – Password:
<EditText android:id="@+id/editText3" android:layout_height="wrap_content" android:layout_width="match_parent" android:inputType="textPassword"></EditText>
Android – EditText – Email Address:
<EditText android:id="@+id/editText5" android:layout_height="wrap_content" android:layout_width="match_parent" android:inputType="textEmailAddress"></EditText>
Android – EditText – Phone number:
<EditText android:id="@+id/editText6" android:layout_height="wrap_content" android:layout_width="match_parent" android:inputType="phone"></EditText>
Android – EditText – Postal Address:
<EditText android:id="@+id/editText8" android:layout_height="wrap_content" android:layout_width="match_parent" android:inputType="textPostalAddress"></EditText>
Android – EditText – Multiline text box:
<EditText android:id="@+id/editText9" android:layout_height="wrap_content" android:layout_width="match_parent" android:inputType="textMultiLine"></EditText>
Android – EditText – Number Decimal:
<EditText android:id="@+id/editText14" android:layout_height="wrap_content" android:layout_width="match_parent" android:inputType="numberDecimal"></EditText>
Android – EditText – Signed number:
<EditText android:id="@+id/editText13" android:layout_height="wrap_content" android:layout_width="match_parent" android:inputType="numberSigned"></EditText>
Android – EditText – Number:
<EditText android:id="@+id/editText12" android:layout_height="wrap_content" android:layout_width="match_parent" android:inputType="number"></EditText>
Android – EditText- Time:
<EditText android:id="@+id/editText10" android:layout_height="wrap_content" android:layout_width="match_parent" android:inputType="time"></EditText>
Android – EditText – Date:
<EditText android:id="@+id/editText11" android:layout_height="wrap_content" android:layout_width="match_parent" android:inputType="date"></EditText>