Custom TextField to show/hide password with customizable icon.
This library has been inspired by anshulagarwal06\PasswordEditText.
- For using PasswordEditText module in sample app, include the source code and add the below dependencies in entry/build.gradle to generate hap/support.har.
implementation project(path: ':library')
- For using PasswordEditText module in separate application using har file, add the har file in the entry/libs folder and add the dependencies in entry/build.gradle file.
implementation fileTree(dir: 'libs', include: ['*.har'])
- For using PasswordEditText module from a remote repository in separate application, add the below dependencies in entry/build.gradle file.
implementation 'dev.applibgroup:passwordedittext:1.0.0'
<in.anshul.library.PasswordEditText
ohos:id="$+id:password_edit_text"
ohos:height="match_content"
ohos:width="match_parent"
ohos:hide_drawable="$media:in_anshul_hide_password"
ohos:hint="Password"
ohos:horizontal_center="true"
ohos:padding="10vp"
ohos:password_visible="false"
ohos:show_drawable="$media:in_anshul_show_password"
ohos:text_size="18fp"/>
Instead of drawable you can also use Text
<in.anshul.libray.PasswordEditText
...
ohos:show_as_text="true"
ohos:show_text="$string:show_text"
ohos:hide_text="$string:hide_text"/>
ohos:show_drawable="$media:show_password"
ohos:hide_drawable="$media:hide_password"
Defualt Password Visiblity can be set using attr
ohos:password_visible="true"
That's it build your project.