Skip to content

Commit e8b9dfa

Browse files
committed
1.4.0
1 parent 95c766c commit e8b9dfa

File tree

7 files changed

+123
-84
lines changed

7 files changed

+123
-84
lines changed

README.md

+60-40
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ A new Material Design text field that comes in a box, based on [Google Material
2020
2121
## ***UPDATE NOTICE***
2222

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+
2327
#### 1.3.9 Release
2428
- Fix issue #49.
2529
- Fix the compiling issue in #50.
2630

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-
3131
3232
## Requirements
3333
- Android 4.0.3 IceCreamSandwich (API lv 15) or greater
@@ -48,7 +48,7 @@ allprojects {
4848
```
4949
```groovy
5050
dependencies {
51-
   compile 'com.github.HITGIF:TextFieldBoxes:1.3.9'
51+
   compile 'com.github.HITGIF:TextFieldBoxes:1.4.0'
5252
}
5353
```
5454

@@ -65,7 +65,7 @@ dependencies {
6565
<dependency>
6666
<groupId>com.github.HITGIF</groupId>
6767
<artifactId>TextFieldBoxes</artifactId>
68-
   <version>1.3.9</version>
68+
   <version>1.4.0</version>
6969
</dependency>
7070
```
7171

@@ -74,7 +74,7 @@ dependencies {
7474
resolvers += "jitpack" at "https://jitpack.io"
7575
```
7676
```scala
77-
libraryDependencies += "com.github.HITGIF" % "TextFieldBoxes" % "1.3.9"
77+
libraryDependencies += "com.github.HITGIF" % "TextFieldBoxes" % "1.4.0"
7878
```
7979

8080

@@ -83,7 +83,7 @@ libraryDependencies += "com.github.HITGIF" % "TextFieldBoxes" % "1.3.9"
8383
:repositories [["jitpack" "https://jitpack.io"]]
8484
```
8585
```scala
86-
:dependencies [[com.github.hitgif/textfieldboxes "1.3.9"]]
86+
:dependencies [[com.github.hitgif/textfieldboxes "1.4.0"]]
8787
```
8888

8989
@@ -99,12 +99,14 @@ Add `studio.carbonylgroup.textfieldboxes.TextFieldBoxes` that contains a `studio
9999
android:id="@+id/text_field_boxes"
100100
android:layout_width="match_parent"
101101
android:layout_height="wrap_content"
102-
app:labelText="Label">
102+
app:labelText="Label"
103+
>
103104

104105
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
105106
android:id="@+id/extended_edit_text"
106107
android:layout_width="wrap_content"
107-
android:layout_height="wrap_content"/>
108+
android:layout_height="wrap_content"
109+
/>
108110

109111
</studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
110112
...
@@ -121,7 +123,8 @@ Add `studio.carbonylgroup.textfieldboxes.TextFieldBoxes` that contains a `studio
121123
```xml
122124
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
123125
...
124-
app:enabled="false">
126+
app:enabled="false"
127+
>
125128
```
126129

127130
![](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
136139
```xml
137140
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
138141
...
139-
app:helperText="Helper is here">
142+
app:helperText="Helper is here"
143+
>
140144
```
141145

142146
![](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
164168
```xml
165169
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
166170
...
167-
app:prefix="$ ">
171+
app:prefix="$ "
172+
>
168173
```
169174

170175
![](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
173178
```xml
174179
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
175180
...
176-
app:suffix="\@gmail.com">
181+
app:suffix="\@gmail.com"
182+
>
177183
```
178184

179185
![](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
194200
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
195201
...
196202
app:maxCharacters="10"
197-
app:minCharacters="5">
203+
app:minCharacters="5"
204+
>
198205
```
199206

200207
![](https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/maxMinChar.gif)
201208

202209
```xml
203210
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
204211
...
205-
app:maxCharacters="5">
212+
app:maxCharacters="5"
213+
>
206214
```
207215

208216
![](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
217225
```xml
218226
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
219227
...
220-
app:iconSignifier="@drawable/ic_vpn_key_black_24dp">
228+
app:iconSignifier="@drawable/ic_vpn_key_black_24dp"
229+
>
221230
```
222231

223232
![](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
229238
```xml
230239
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
231240
...
232-
app:endIcon="@drawable/ic_mic_black_24dp">
241+
app:endIcon="@drawable/ic_mic_black_24dp"
242+
>
233243
```
234244

235245
![](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 (**
255265
```xml
256266
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
257267
...
258-
app:hasClearButton="true">
268+
app:hasClearButton="true"
269+
>
259270
```
260271

261272
![](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 (**
278289
app:primaryColor="#1B5E20"
279290
app:errorColor="#ddaa00"
280291
app:helperTextColor="#795548"
281-
app:panelBackgroundColor="#ffe8e8">
292+
app:panelBackgroundColor="#ffe8e8"
293+
>
282294
```
283295

284296
![](https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/customColor1.png) ![](https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/customColor2.png)
285297

286-
#### 10. Customize EditText
298+
#### 10. Dense Spacing
287299

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.
289301

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)
297303

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.
301305

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+
>
308326
```
309327

310-
![](https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/edittext.gif)
328+
![](https://raw.githubusercontent.com/HITGIF/TextFieldBoxes/master/images/alwaysHint.png)
311329

312-
#### 11. Dark Theme
330+
#### 12. Dark Theme
313331

314332
TextFieldBoxes use the color attributes within the current theme and will automatically change its color to fit the dark theme without additional settings.
315333

@@ -378,6 +396,8 @@ TextFieldBoxes use the color attributes within the current theme and will automa
378396
| `app:enabled` | Whether the text field is enabled | `True` |
379397
| `app:hasClearButton` | Whether to show the clear button at the end of the EditText | `False` |
380398
| `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` |
381401
382402

383403
## License

0 commit comments

Comments
 (0)