Created
November 11, 2017 19:04
-
-
Save valterh4ck3r/75209b530433a3da2a04ad025837e248 to your computer and use it in GitHub Desktop.
Text Fields Using TextInputLayout and AppCompatEditText.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
tools:context="br.com.androidpro.textfields.MainActivity"> | |
<android.support.design.widget.TextInputLayout | |
android:id="@+id/txtlayout_email" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="32dp" | |
android:layout_marginRight="32dp" | |
android:layout_marginLeft="32dp"> | |
<android.support.v7.widget.AppCompatEditText | |
android:id="@+id/et_email" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:hint="@string/hint_email" | |
android:inputType="textWebEmailAddress" /> | |
</android.support.design.widget.TextInputLayout> | |
<android.support.design.widget.TextInputLayout | |
android:id="@+id/txtlayout_password" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="32dp" | |
android:layout_marginRight="32dp" | |
android:layout_marginLeft="32dp" | |
app:counterEnabled="true" | |
app:counterMaxLength="8" | |
app:passwordToggleEnabled="true"> | |
<android.support.v7.widget.AppCompatEditText | |
android:id="@+id/et_password" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:hint="@string/hint_password" | |
android:inputType="textPassword" | |
android:maxLength="8" /> | |
</android.support.design.widget.TextInputLayout> | |
<Button | |
android:id="@+id/btn_login" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="32dp" | |
android:layout_marginRight="32dp" | |
android:layout_marginLeft="32dp" | |
android:text="@string/btn_login" /> | |
</LinearLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment