Skip to content

Commit 9da9b4d

Browse files
committed
1.3.5
fix #28
1 parent 37108eb commit 9da9b4d

File tree

6 files changed

+99
-60
lines changed

6 files changed

+99
-60
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ A new Material Design text field that comes in a box, based on Google Material D
1919
2020
## ***UPDATE NOTICE***
2121

22-
#### 1.3.4 Release
23-
- fix issue #25.
22+
#### 1.3.5 Release
23+
- fix issue #31.
2424

2525
- add `giveFocus` param in `setError()` for setting whether the field will gain focus when set error on.
2626

27+
- add `secondaryColor` for setting the color of the underline, the floating label text and the icon signifier **when NOT HAVING** focus (opposite to `primaryColor`).
28+
29+
- add `counterColor` for setting the color of the counter text.
30+
2731
#### 1.3.0 Release
2832
- 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`.
2933

@@ -53,7 +57,7 @@ allprojects {
5357
```
5458
```groovy
5559
dependencies {
56-
   compile 'com.github.HITGIF:TextFieldBoxes:1.3.4'
60+
   compile 'com.github.HITGIF:TextFieldBoxes:1.3.5'
5761
}
5862
```
5963

@@ -70,7 +74,7 @@ dependencies {
7074
<dependency>
7175
<groupId>com.github.HITGIF</groupId>
7276
<artifactId>TextFieldBoxes</artifactId>
73-
   <version>1.3.4</version>
77+
   <version>1.3.5</version>
7478
</dependency>
7579
```
7680

@@ -79,7 +83,7 @@ dependencies {
7983
resolvers += "jitpack" at "https://jitpack.io"
8084
```
8185
```scala
82-
libraryDependencies += "com.github.HITGIF" % "TextFieldBoxes" % "1.3.4"
86+
libraryDependencies += "com.github.HITGIF" % "TextFieldBoxes" % "1.3.5"
8387
```
8488

8589

@@ -88,7 +92,7 @@ libraryDependencies += "com.github.HITGIF" % "TextFieldBoxes" % "1.3.4"
8892
:repositories [["jitpack" "https://jitpack.io"]]
8993
```
9094
```scala
91-
:dependencies [[com.github.hitgif/textfieldboxes "1.3.4"]]
95+
:dependencies [[com.github.hitgif/textfieldboxes "1.3.5"]]
9296
```
9397

9498
@@ -265,7 +269,9 @@ If `true`, a clear button will be shown at the end when there are characters (**
265269

266270
#### 9. Custom Colors
267271

268-
*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.
272+
*Primary Color* will be used for the color of the underline, the floating label text and the icon signifier **when HAVING focus**. You can use `app:primaryColor` in xml or `setPrimaryColor(int colorRes)` in Java. Current theme `Primary Color` by default.
273+
274+
*Secondary Color* will be used for the color of the underline, the floating label text and the icon signifier **when NOT HAVING focus**. You can use `app:secondaryColor` in xml or `setSecondaryColor(int colorRes)` in Java. Current theme `textColorTertiary` by default.
269275

270276
*Error Color* will be used for the color that indicates error (e.g. exceeding max characters, `setError()`). You can use `app:errorColor` in xml or `setErrorColor(int colorRes)` in Java. `A400 red` by default.
271277

@@ -351,8 +357,10 @@ TextFieldBoxes use the color attributes within the current theme and will automa
351357
| Attribute | Description | Default |
352358
| --- | --- | --- |
353359
| `app:helperTextColor` | Helper text color | Current theme `textColorTertiary` |
360+
| `app:counterTextColor` | Counter text color | Current theme `textColorTertiary` |
354361
| `app:errorColor` | The color that is used to indicate error (e.g. exceeding max characters, `setError()`) | `A400 red` |
355-
| `app:primaryColor` | The color for the underline and the floating label text | Current theme `colorPrimary` |
362+
| `app:primaryColor` | The color for the underline, the floating label text and the icon signifier **when HAVING FOCUS** | Current theme `colorPrimary` |
363+
| `app:secondaryColor` | The color for the underline, the floating label text and the icon signifier **when NOT HAVING FOCUS** | Current theme `textColorTertiary` |
356364
| `app:panelBackgroundColor` | The color for the panel at the back | 6% Current theme `colorForeground` |
357365

358366
##### Icons
@@ -378,16 +386,7 @@ TextFieldBoxes use the color attributes within the current theme and will automa
378386
| `app:hasClearButton` | Whether to show the clear button at the end of the EditText | `False` |
379387
| `app:hasFocus` | Whether the EditText is having the focus | `False` |
380388
381-
## TODO
382-
+ [X] Prefix & Suffix
383-
+ [X] Icon signifier
384-
+ [X] Dark theme
385-
+ [X] Delete Button
386-
+ [X] End Icon
387-
+ [X] Placeholder (real "hint")
388-
+ [X] Move the EditText out
389389

390-
391390
## License
392391

393392
Copyright 2017 Carbonylgroup Studio

README_CN.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
2020
## ***更新注意***
2121

22-
#### 1.3.4 Release
23-
- 修复 issue #25
22+
#### 1.3.5 Release
23+
- 修复 issue #31
2424

25-
-`setError()` 中新增参数 `giveFocus` 以设置是否在被设置错误时令文本域获得焦点。
25+
- 增加 `secondaryColor` 属性以设置底部的线、标签文字和首图标在**失去焦点**时的颜色(与 `primaryColor` 相对)。
26+
27+
- 增加 `counterColor` 属性以设置计数文本的颜色。
2628

2729
#### 1.3.0 Release
2830
- "EditText" 部分现已与 TextFieldBoxes **分开**。 TextFieldBoxes 将作为一个**容器**(就像 `TextInputLayout`),应且只应包含**一个** `ExtendedEditText`(继承于 `TextInputEditText`)。
@@ -53,7 +55,7 @@ allprojects {
5355
```
5456
```groovy
5557
dependencies {
56-
   compile 'com.github.HITGIF:TextFieldBoxes:1.3.4'
58+
   compile 'com.github.HITGIF:TextFieldBoxes:1.3.5'
5759
}
5860
```
5961

@@ -70,7 +72,7 @@ dependencies {
7072
<dependency>
7173
<groupId>com.github.HITGIF</groupId>
7274
<artifactId>TextFieldBoxes</artifactId>
73-
   <version>1.3.4</version>
75+
   <version>1.3.5</version>
7476
</dependency>
7577
```
7678

@@ -79,7 +81,7 @@ dependencies {
7981
resolvers += "jitpack" at "https://jitpack.io"
8082
```
8183
```scala
82-
libraryDependencies += "com.github.HITGIF" % "TextFieldBoxes" % "1.3.4"
84+
libraryDependencies += "com.github.HITGIF" % "TextFieldBoxes" % "1.3.5"
8385
```
8486

8587

@@ -88,7 +90,7 @@ libraryDependencies += "com.github.HITGIF" % "TextFieldBoxes" % "1.3.4"
8890
:repositories [["jitpack" "https://jitpack.io"]]
8991
```
9092
```scala
91-
:dependencies [[com.github.hitgif/textfieldboxes "1.3.4"]]
93+
:dependencies [[com.github.hitgif/textfieldboxes "1.3.5"]]
9294
```
9395

9496
@@ -266,7 +268,9 @@ textFieldBoxes.getEndIconImageButton().setOnClickListener(new View.OnClickListen
266268

267269
#### 9. 自定义颜色
268270

269-
*Primary Color* 是底部的线和标签文字的颜色。在 xml 中加入 `app:primaryColor` 或在 Java 代码中使用 `setPrimaryColor(int colorRes)` 以设置。默认值为目前主题的 `Primary Color`
271+
*Primary Color* 是底部的线、标签文字和首图标在**获得焦点**时的颜色。在 xml 中加入 `app:primaryColor` 或在 Java 代码中使用 `setPrimaryColor(int colorRes)` 以设置。默认值为目前主题的 `Primary Color`
272+
273+
*Secondary Color* 是底部的线、标签文字和首图标在**失去焦点**时的颜色。在 xml 中加入 `app:secondaryColor` 或在 Java 代码中使用 `setSecondaryColor(int colorRes)` 以设置。默认值为目前主题的 `textColorTertiary`
270274

271275
*Error Color* 是出现错误时显示的颜色 (e.g. 超出字符数限制, `setError()`)。在 xml 中加入 `app:errorColor` 或在 Java 代码中使用 `setErrorColor(int colorRes)` 以设置。默认值是 `A400 red`
272276

@@ -352,8 +356,10 @@ TextFieldBoxes 用目前主题中的颜色属性因此将自动改变颜色以
352356
| 属性 | 描述 | 默认值 |
353357
| --- | --- | --- |
354358
| `app:helperTextColor` | 帮助文本颜色 | 目前主题 `textColorTertiary` |
359+
| `app:counterTextColor` | 计数文本颜色 | 目前主题 `textColorTertiary` |
355360
| `app:errorColor` | 错误时的显示颜色 (e.g. 超出字符限制, `setError()`) | `A400 red` |
356-
| `app:primaryColor` | 底部的线和标签文字的颜色 | 目前主题 `colorPrimary` |
361+
| `app:primaryColor` | 底部的线、标签文字和首图标在**获得焦点时**的颜色 | 目前主题 `colorPrimary` |
362+
| `app:secondaryColor` | 底部的线、标签文字和首图标在**失去焦点时**的颜色 | 目前主题 `textColorTertiary` |
357363
| `app:panelBackgroundColor` | 文本框背板的颜色 | 6% 目前主题 `colorForeground` |
358364

359365
##### 图标
@@ -379,16 +385,6 @@ TextFieldBoxes 用目前主题中的颜色属性因此将自动改变颜色以
379385
| `app:hasClearButton` | 是否在文本域末端显示清除按钮 | `False` |
380386
| `app:hasFocus` | 文本框是否获得焦点 | `False` |
381387

382-
383-
## TODO
384-
+ [X] 前缀 & 后缀
385-
+ [X] 图标
386-
+ [X] 暗主题
387-
+ [X] 清除按钮
388-
+ [X] 末图标
389-
+ [X] 占位符 (真 · "hint")
390-
+ [X] 移出 EditText
391-
392388
393389
## 开源许可
394390

sample/src/main/java/studio/carbonylgroup/textfieldboxestest/MainActivity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import android.widget.Button;
1010

1111
import studio.carbonylgroup.textfieldboxes.ExtendedEditText;
12+
import studio.carbonylgroup.textfieldboxes.TextFieldBoxes;
1213

1314

1415
public class MainActivity extends AppCompatActivity {
@@ -23,8 +24,10 @@ protected void onCreate(Bundle savedInstanceState) {
2324
super.onCreate(savedInstanceState);
2425
setContentView(R.layout.activity_main);
2526

26-
final Button darkButton = findViewById(R.id.dark_button);
2727
// final ExtendedEditText t = findViewById(R.id.extendedEditText);
28+
// final TextFieldBoxes tfb = findViewById(R.id.text_field_boxes3);
29+
30+
final Button darkButton = findViewById(R.id.dark_button);
2831

2932
darkButton.setText(dark ? "LIGHT SIDE" : "DARK SIDE");
3033
darkButton.setOnClickListener(new View.OnClickListener() {

0 commit comments

Comments
 (0)