Skip to content

Modify the TextInputLayout to support more operations to improve the usage of TextInputLayout.

Notifications You must be signed in to change notification settings

wilin52/MultiOperationEditText

Repository files navigation

MultiOperationEditTextSample

Modify the TextInputLayout to support more operations to improve the usage of TextInputLayout. Add the TextView and the Toggle to the right side.

修改TextInputLayout,添加文字和按钮在右侧,以优化TextInputLayout的使用。 增加错误提示,删除原有错误文字,修改成以输入框背景作为错误提示。

2018.12.11

删除原有的代码,以修改包名为“android.support.design.widget”方式解决引用“android.support.design.widget”包内文件。减少不必要的新类。使用方法保持不变。 本项目中的MultiOperationEditText 拷贝自TextInputLayout,基于25, 不会及时更新追踪 TextInputLayout 的更新。如有需要,请自信更新,作出相对应的修改。修改部分代码可以根据style 文件中的属性找到代码中相对应的函数。

Screenshots

Screenshot

Screenshot

How to use:

<com.wilin.multioperationedittext.MultiOperationInputLayout
    android:id="@+id/email_input_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:operationErrorColor="@color/errorColor"
    app:operationTextSize="15"
    app:operationTextColor="@color/multi_operation_text_color"
    app:operationTextString="@string/forget_password"
    app:operationType="editTextWithTextView">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/email_hint"
        android:singleLine="true"
        android:textSize="15sp" />
</com.wilin.multioperationedittext.MultiOperationInputLayout>

<com.wilin.multioperationedittext.MultiOperationInputLayout
    android:id="@+id/password_input_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="20dp"
    app:operationToggleDrawable="@drawable/design_password_eye_icon"
    app:operationToggleType="password"
    app:operationType="editTextWithToggle">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/password_hint" />
</com.wilin.multioperationedittext.MultiOperationInputLayout>

About

Modify the TextInputLayout to support more operations to improve the usage of TextInputLayout.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages