@@ -20,14 +20,14 @@ A new Material Design text field that comes in a box, based on [Google Material
20
20
21
21
## *** UPDATE NOTICE***
22
22
23
+ #### 1.4.0 Release
24
+ - Support Dense Layout (Dense Spacing) with ` app:useDenseSpacing ` attribute.
25
+ - Label can be fixed at the top when hint is present, with ` app:alwaysShowHint ` attribute.
26
+
23
27
#### 1.3.9 Release
24
28
- Fix issue #49 .
25
29
- Fix the compiling issue in #50 .
26
30
27
- #### 1.3.8 Release
28
- - Fix issue #41 .
29
- - Add autocompletion support as addressed in #43 . (` ExtendedEditText ` now extends a built-in ` TextInputAutoCompleteTextView ` , which extends ` AppCompatAutoCompleteTextView ` ).
30
-
31
31
32
32
## Requirements
33
33
- Android 4.0.3 IceCreamSandwich (API lv 15) or greater
@@ -48,7 +48,7 @@ allprojects {
48
48
```
49
49
``` groovy
50
50
dependencies {
51
- compile 'com.github.HITGIF:TextFieldBoxes:1.3.9 '
51
+ compile 'com.github.HITGIF:TextFieldBoxes:1.4.0 '
52
52
}
53
53
```
54
54
@@ -65,7 +65,7 @@ dependencies {
65
65
<dependency >
66
66
<groupId >com.github.HITGIF</groupId >
67
67
<artifactId >TextFieldBoxes</artifactId >
68
- <version >1.3.9 </version >
68
+ <version >1.4.0 </version >
69
69
</dependency >
70
70
```
71
71
@@ -74,7 +74,7 @@ dependencies {
74
74
resolvers += " jitpack" at " https://jitpack.io"
75
75
```
76
76
``` scala
77
- libraryDependencies += " com.github.HITGIF" % " TextFieldBoxes" % " 1.3.9 "
77
+ libraryDependencies += " com.github.HITGIF" % " TextFieldBoxes" % " 1.4.0 "
78
78
```
79
79
80
80
@@ -83,7 +83,7 @@ libraryDependencies += "com.github.HITGIF" % "TextFieldBoxes" % "1.3.9"
83
83
: repositories [[" jitpack" " https://jitpack.io" ]]
84
84
```
85
85
``` scala
86
- : dependencies [[com.github.hitgif/ textfieldboxes " 1.3.9 " ]]
86
+ : dependencies [[com.github.hitgif/ textfieldboxes " 1.4.0 " ]]
87
87
```
88
88
89
89
@@ -99,12 +99,14 @@ Add `studio.carbonylgroup.textfieldboxes.TextFieldBoxes` that contains a `studio
99
99
android : id =" @+id/text_field_boxes"
100
100
android : layout_width =" match_parent"
101
101
android : layout_height =" wrap_content"
102
- app : labelText =" Label" >
102
+ app : labelText =" Label"
103
+ >
103
104
104
105
<studio .carbonylgroup.textfieldboxes.ExtendedEditText
105
106
android : id =" @+id/extended_edit_text"
106
107
android : layout_width =" wrap_content"
107
- android : layout_height =" wrap_content" />
108
+ android : layout_height =" wrap_content"
109
+ />
108
110
109
111
</studio .carbonylgroup.textfieldboxes.TextFieldBoxes>
110
112
...
@@ -121,7 +123,8 @@ Add `studio.carbonylgroup.textfieldboxes.TextFieldBoxes` that contains a `studio
121
123
``` xml
122
124
<studio .carbonylgroup.textfieldboxes.TextFieldBoxes
123
125
...
124
- app : enabled =" false" >
126
+ app : enabled =" false"
127
+ >
125
128
```
126
129
127
130
![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/basic_disabled.png )
@@ -136,7 +139,8 @@ helper text: `app:helperText` in xml or `setHelperText(String helperText)` in Ja
136
139
``` xml
137
140
<studio .carbonylgroup.textfieldboxes.TextFieldBoxes
138
141
...
139
- app : helperText =" Helper is here" >
142
+ app : helperText =" Helper is here"
143
+ >
140
144
```
141
145
142
146
![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/helper.png )
@@ -164,7 +168,8 @@ Use `app:suffix` in xml or `setSuffix(String suffix)` in Java to set the unselec
164
168
``` xml
165
169
<studio .carbonylgroup.textfieldboxes.ExtendedEditText
166
170
...
167
- app : prefix =" $ " >
171
+ app : prefix =" $ "
172
+ >
168
173
```
169
174
170
175
![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/prefix.png )
@@ -173,7 +178,8 @@ Use `app:suffix` in xml or `setSuffix(String suffix)` in Java to set the unselec
173
178
``` xml
174
179
<studio .carbonylgroup.textfieldboxes.ExtendedEditText
175
180
...
176
- app : suffix =" \@gmail.com" >
181
+ app : suffix =" \@gmail.com"
182
+ >
177
183
```
178
184
179
185
![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/suffix.png )
@@ -194,15 +200,17 @@ The color of the bottom line will turn to `errorColor` (red by default) when exc
194
200
<studio .carbonylgroup.textfieldboxes.TextFieldBoxes
195
201
...
196
202
app : maxCharacters =" 10"
197
- app : minCharacters =" 5" >
203
+ app : minCharacters =" 5"
204
+ >
198
205
```
199
206
200
207
![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/maxMinChar.gif )
201
208
202
209
``` xml
203
210
<studio .carbonylgroup.textfieldboxes.TextFieldBoxes
204
211
...
205
- app : maxCharacters =" 5" >
212
+ app : maxCharacters =" 5"
213
+ >
206
214
```
207
215
208
216
![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/maxChar.gif )
@@ -217,7 +225,8 @@ _**NOTE that if `true`, the icon's color will always be `HighlightColor` (the sa
217
225
``` xml
218
226
<studio .carbonylgroup.textfieldboxes.TextFieldBoxes
219
227
...
220
- app : iconSignifier =" @drawable/ic_vpn_key_black_24dp" >
228
+ app : iconSignifier =" @drawable/ic_vpn_key_black_24dp"
229
+ >
221
230
```
222
231
223
232
![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/icon1.png ) ![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/icon2.png )
@@ -229,7 +238,8 @@ Use `app:endIcon` in xml or `setEndIcon(Int resourceID)` to set the icon of the
229
238
``` xml
230
239
<studio .carbonylgroup.textfieldboxes.TextFieldBoxes
231
240
...
232
- app : endIcon =" @drawable/ic_mic_black_24dp" >
241
+ app : endIcon =" @drawable/ic_mic_black_24dp"
242
+ >
233
243
```
234
244
235
245
![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/mic.png )
@@ -255,7 +265,8 @@ If `true`, a clear button will be shown at the end when there are characters (**
255
265
``` xml
256
266
<studio .carbonylgroup.textfieldboxes.TextFieldBoxes
257
267
...
258
- app : hasClearButton =" true" >
268
+ app : hasClearButton =" true"
269
+ >
259
270
```
260
271
261
272
![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/clearButton.png )
@@ -278,38 +289,45 @@ If `true`, a clear button will be shown at the end when there are characters (**
278
289
app : primaryColor =" #1B5E20"
279
290
app : errorColor =" #ddaa00"
280
291
app : helperTextColor =" #795548"
281
- app : panelBackgroundColor =" #ffe8e8" >
292
+ app : panelBackgroundColor =" #ffe8e8"
293
+ >
282
294
```
283
295
284
296
![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/customColor1.png ) ![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/customColor2.png )
285
297
286
- #### 10. Customize EditText
298
+ #### 10. Dense Spacing
287
299
288
- ** From release 1.3.0 ** , just do what you want to the ` ExtendedEditText ` inside the TextFieldBoxes .
300
+ You can make the layout compact by using a dense verticle spacing to improve user experience in some cases .
289
301
290
- ``` java
291
- final TextFieldBoxes textFieldBoxes = findViewById(R . id. text_field_boxes);
292
- final ExtendedEditText extendedEditText = findViewById(R . id. extended_edit_text);
293
- extendedEditText. addTextChangedListener(new TextWatcher () {
294
- @Override
295
- public void beforeTextChanged (CharSequence charSequence , int i , int i1 , int i2 ) {
296
- }
302
+ ![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/denseSpacing.png )
297
303
298
- @Override
299
- public void onTextChanged (CharSequence charSequence , int i , int i1 , int i2 ) {
300
- }
304
+ Use ` app:useDenseSpacing ` in xml or ` setUseDenseSpacing(boolean useDenseSpacing) ` to set whether the field uses a dense spacing between its elements.
301
305
302
- @Override
303
- public void afterTextChanged (Editable editable ) {
304
- if (editable. toString(). equals(" wrong" ))
305
- textFieldBoxes. setError(" It's wrong" );
306
- }
307
- });
306
+ ``` xml
307
+ <studio .carbonylgroup.textfieldboxes.TextFieldBoxes
308
+ ...
309
+ app : useDenseSpacing =" true"
310
+ >
311
+ ```
312
+
313
+ ![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/dense.png )
314
+
315
+ #### 11. Always Show Hint
316
+
317
+ Sometimes you may want the label and the hint to show different messages, but need the hint to always be shown (instead being blocked by the label when losing focus).
318
+
319
+ Use ` app:alwaysShowHint ` in xml or ` setAlwaysShowHint(boolean alwaysShowHint) ` to set whether the label is fixed at top when there's a hint in the EditText.
320
+
321
+ ``` xml
322
+ <studio .carbonylgroup.textfieldboxes.TextFieldBoxes
323
+ ...
324
+ app : alwaysShowHint =" true"
325
+ >
308
326
```
309
327
310
- ![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/edittext.gif )
328
+ ![ ] ( https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/alwaysHint.png )
311
329
312
- #### 11 . Dark Theme
330
+ #### 12 . Dark Theme
313
331
314
332
TextFieldBoxes use the color attributes within the current theme and will automatically change its color to fit the dark theme without additional settings.
315
333
@@ -378,6 +396,8 @@ TextFieldBoxes use the color attributes within the current theme and will automa
378
396
| ` app:enabled ` | Whether the text field is enabled | ` True ` |
379
397
| ` app:hasClearButton ` | Whether to show the clear button at the end of the EditText | ` False ` |
380
398
| ` app:hasFocus ` | Whether the EditText is having the focus | ` False ` |
399
+ | ` app:alwaysShowHint ` | Whether the label is fixed at top when there's a hint in the EditText | ` False ` |
400
+ | ` app:useDenseSpacing ` | Whether the field uses a dense spacing between its elements | ` False ` |
381
401
382
402
383
403
## License
0 commit comments