Android toggle visible password field easy way

Android toggle visible password field easy way

Just paste these code for password edittext field

       <android.support.design.widget.TextInputLayout
            android:id="@+id/txt_pass_layout"
            android:layout_width="0dp"
            android:layout_height="@dimen/count_50dp"
            android:layout_marginBottom="8dp"
            android:layout_marginEnd="32dp"
            android:layout_marginStart="32dp"
            android:layout_marginTop="16dp"
            app:passwordToggleEnabled="true"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/txt_Email" >

            <android.support.design.widget.TextInputEditText
                android:id="@+id/txt_pass"
                style="@style/AppTheme.EditText"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/password"
                android:inputType="textPassword"/>
        </android.support.design.widget.TextInputLayout>

Leave a Reply

Your email address will not be published. Required fields are marked *