You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+96-85
Original file line number
Diff line number
Diff line change
@@ -18,19 +18,15 @@ A new Material Design text field that comes in a box, based on Google Material D
18
18
19
19
20
20
## ***UPDATE NOTICE***
21
-
#### 1.2.1 Release
22
-
- fix issues #11#12#13#14
23
21
24
-
#### 1.2.0 Release
25
-
-fix the bug of when height (or width) is set to `wrap_content` yet fills up the whole space.
22
+
#### 1.3.0 Release
23
+
-the "EditText" part is now **seperated** from the TextFieldBoxes. TextFieldBoxes is now a **container** (just like a `TextInputLayout`) that should and should only contain **one**`ExtendedEditText` that inherents the `TextInputEditText`.
26
24
27
-
-old `hint` attribute is **renamed**to `labelText`.
25
+
-`Prefix` and `Suffix` attributes are now belonging to the `ExtendedEditText`.
28
26
29
-
-current`hint` attribute is for the **placeholder** text that is shown in the field when there is no text and is on focus.
27
+
-`Text`,`hint`, `SingleLine` and `MaxLines` attributes are now removed. Instead, one should set them in the `ExtendedEditText` with original `android:` attributes.
30
28
31
-
- add **Clear Button**, can be activated with `app:hasClearButton` in xml or `setHasClearButton(boolean hasClearButton)` in Java code.
32
-
33
-
- add **End Icon**, can be activated with `app:endIcon` in xml or `setEndIcon(Int resourceID)` in Java code. Use `getEndIconImageButton()` to do something useful with it.
29
+
- the bottom view which contains helper and counter labels will now be hidden when it's empty.
_**NOTE:** setting helper or error text to anything **not empty** will make the bottom view (which contains the helper label) visible and increase the height of the TextFieldBoxes. So if you want to always keep the bottom view visible (height increased), set the helper text to `" "` when there should be nothing._
133
130
134
131
helper text: `app:helperText` in xml or `setHelperText(String helperText)` in Java.
Use `app:maxLines` in xml or `setMaxLines(Int maxlines)` to set the number of maximum lines allowed in the text field. `Integer.MAX_VALUE` by default.
179
+
_**NOTE:** setting max or min character will make the bottom view (which contains the counter label) visible and increase the height of the TextFieldBoxes._
184
180
185
-
```xml
186
-
app:maxLines="3"
187
-
```
181
+
Use `app:maxCharacters` in xml or `setMaxCharacters(int maxCharacters)` in java code to set the max characters count. Use `removeMaxCharacters()` in java code to remove the limit.
Use `app:minCharacters` in xml or `setMinCharacters(int minCharacters)` in java code to set the min characters count. Use `removeMinCharacters()` in java code to remove the limit.
190
184
191
-
#### 8. Max & Min Characters
192
-
193
-
Use `app:maxCharacters` in xml or `setMaxCharacters(int maxCharacters)` in java code to set the max characters count.
194
-
195
-
Use `app:minCharacters` in xml or `setMinCharacters(int minCharacters)` in java code to set the min characters count.
196
-
197
-
The color of the bottom line will turn to `errorColor` (red by default) when exceeding max or min characters limit. `0`, as default, means no max or min characters.
185
+
The color of the bottom line will turn to `errorColor` (red by default) when exceeding max or min characters limit. `0`, as default, means no max or min characters limit.
Use `app:iconSignifier` in xml or `setIconSignifier(Int resourceID)` to set the icon that is shown in front of the TextFieldBoxes if you want there to be one.
217
209
218
210
You can use `setIsResponsiveIconColor(boolean isrResponsiveIconColor)` in Java code to set whether the icon will change its color when gaining or losing focus as the label text and the bottomLine do.
219
211
_**NOTE that if `true`, the icon's color will always be `HighlightColor` (the same as the bottomLine) that will turn gray when losing focus. If `false`, the icon will always be in `primaryColor`.**_
Use `app:endIcon` in xml or `setEndIcon(Int resourceID)` to set the icon of the ImageButton that is shown at the end of the field if you want there to be one.
*Primary Color* will be used for the color of the underline and the floating label text. You can use `app:primaryColor` in xml or `setPrimaryColor(int colorRes)` in Java. Current theme `Primary Color` by default.
264
262
@@ -269,21 +267,24 @@ app:hasClearButton="true"
269
267
*Panel Background Color* will be used for the color of panel at the back. You can use `app:panelBackgroundColor` in xml or `setPanelBackgroundColor(int colorRes)` in Java. `6% black` by default. *NOTE that the default color, as in the guideline, is the black (`#000000`) color with the transparency of 6%, so when you're customizing and want it to still be transparent you have to set a color with transparency.*
If you want to customize the `EditText` in the `TextFieldBoxes` (which is a inherited `FrameLayout` that contains a `EditText` for input), use the `getEditText()` methond in Java and do whatever you like (e.g. `setOnKeyListener()`, `addTextChangedListener()`)
282
+
**From release 1.3.0**, just do what you want to the `ExtendedEditText` inside the TextFieldBoxes.
TextFieldBoxes use the color attributes within the current theme and will automatically change its color to fit the dark theme without additional settings.
308
309
@@ -313,47 +314,56 @@ TextFieldBoxes use the color attributes within the current theme and will automa
313
314
314
315
## All Attributes
315
316
316
-
#### Texts
317
+
### ExtendedEditText
318
+
319
+
##### Texts
317
320
318
321
| Attribute | Description |
319
322
| --- | --- |
320
-
|`app:text`| EditText text |
321
-
|`app:labelText`| Floating label text at the top |
322
-
|`app:helperText`| Helper text at the bottom |
323
-
|`app:hint`| Placeholder text that is shown in the EditText when there is no text and is on focus |
324
323
|`app:prefix`| Prefix Text |
325
324
|`app:suffix`| Suffix Text |
326
325
327
-
#### Colors
326
+
##### Colors
327
+
328
+
| Attribute | Description | Default |
329
+
| --- | --- | --- |
330
+
|`app:prefixTextColor`| Prefix text color | Current theme `textColorTertiary`|
331
+
|`app:suffixTextColor`| Suffix text color | Current theme `textColorTertiary`|
332
+
333
+
### TextFieldBoxes
334
+
335
+
##### Texts
336
+
337
+
| Attribute | Description |
338
+
| --- | --- |
339
+
|`app:labelText`| Floating label text at the top |
340
+
|`app:helperText`| Helper text at the bottom |
341
+
342
+
##### Colors
328
343
329
344
| Attribute | Description | Default |
330
345
| --- | --- | --- |
331
346
|`app:helperTextColor`| Helper text color | Current theme `textColorTertiary`|
332
347
|`app:errorColor`| The color that is used to indicate error (e.g. exceeding max characters, `setError()`) |`A400 red`|
333
348
|`app:primaryColor`| The color for the underline and the floating label text | Current theme `colorPrimary`|
334
-
|`app:prefixTextColor`| Prefix text color | Current theme `textColorTertiary`|
335
-
|`app:suffixTextColor`| Suffix text color | Current theme `textColorTertiary`|
336
349
|`app:panelBackgroundColor`| The color for the panel at the back | 6% Current theme `colorForeground`|
337
350
338
-
#### Characters counter
351
+
#####Characters counter
339
352
340
353
| Attribute | Description | Default |
341
354
| --- | --- | --- |
342
355
|`app:maxCharacters`| Max characters count limit. `0` means no limit |`0`|
343
356
|`app:minCharacters`| Min characters count limit. `0` means no limit |`0`|
344
357
345
-
#### Others
358
+
#####Others
346
359
347
360
| Attribute | Description | Default |
348
361
| --- | --- | --- |
349
362
|`app:enabled`| Whether the text field is enabled |`True`|
350
-
|`app:singleLine`| Whether the EditText is single-lined |`False`|
351
-
|`app:maxLines`| The number of maximum lines allowed in the text field |`Integer.MAX_VALUE`|
352
363
|`app:iconSignifier`| The resource ID of the icon before the TextFieldBoxes |`0`|
353
364
|`app:endIcon`| The resource ID of the icon at the end of the field |`0`|
354
365
|`app:hasClearButton`| Whether to show the clear button at the end of the EditText |`False`|
355
366
|`app:hasFocus`| Whether the EditText is having the focus |`False`|
356
-
357
367
358
368
## TODO
359
369
+[X] Prefix & Suffix
@@ -362,6 +372,7 @@ TextFieldBoxes use the color attributes within the current theme and will automa
0 commit comments