Created
June 7, 2018 04:47
-
-
Save hilfritz/a4d9cd0d429a09501fc44e52fe00b4ca to your computer and use it in GitHub Desktop.
Lowercase edittext
This file contains hidden or 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
| //kotlin code | |
| editText. | |
| filters = arrayOf<InputFilter>(object : InputFilter.AllCaps() { | |
| override fun filter(source: CharSequence, start: Int, end: Int, dest: Spanned, dstart: Int, dend: Int): CharSequence { | |
| return source.toString().toLowerCase() | |
| } | |
| }) | |
| //xml layout | |
| <?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" | |
| tools:context=".MainActivity" | |
| android:orientation="vertical" | |
| > | |
| <EditText | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:id="@+id/editText" | |
| android:inputType="text" | |
| /> | |
| </LinearLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment