Skip to content

Commit

Permalink
fix counterTextColor -> mCounterTextColor
Browse files Browse the repository at this point in the history
  • Loading branch information
HITGIF committed Jun 10, 2019
1 parent ba76e35 commit c1cd100
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jdk: oraclejdk8
android:
components:
- tools
- build-tools-27.0.3
- build-tools-28.0.3
- android-27
- extra-google-m2repository
- extra-android-m2repository
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ textFieldBoxes.validate()
| Attribute | Description | Default |
| --- | --- | --- |
| `app:helperTextColor` | Helper text color | Current theme `textColorTertiary` |
| `app:counterTextColor` | Counter text color | Current theme `textColorTertiary` |
| `app:mCounterTextColor` | Counter text color | Current theme `textColorTertiary` |
| `app:errorColor` | The color that is used to indicate error (e.g. exceeding max characters, `setError()`) | `A400 red` |
| `app:primaryColor` | The color for the underline, the floating label text and the icon signifier **when HAVING FOCUS** | Current theme `colorPrimary` |
| `app:secondaryColor` | The color for the underline, the floating label text and the icon signifier **when NOT HAVING FOCUS** | Current theme `textColorTertiary` |
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ textFieldBoxes.validate()
| 属性 | 描述 | 默认值 |
| --- | --- | --- |
| `app:helperTextColor` | 帮助文本颜色 | 目前主题 `textColorTertiary` |
| `app:counterTextColor` | 计数文本颜色 | 目前主题 `textColorTertiary` |
| `app:mCounterTextColor` | 计数文本颜色 | 目前主题 `textColorTertiary` |
| `app:errorColor` | 错误时的显示颜色 (e.g. 超出字符限制, `setError()`) | `A400 red` |
| `app:primaryColor` | 底部的线、标签文字和首图标在**获得焦点时**的颜色 | 目前主题 `colorPrimary` |
| `app:secondaryColor` | 底部的线、标签文字和首图标在**失去焦点时**的颜色 | 目前主题 `textColorTertiary` |
Expand Down
6 changes: 3 additions & 3 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
// compile 'com.github.HITGIF:TextFieldBoxes:1.4.1'
implementation project(':textfieldboxes')
testImplementation 'junit:junit:4.12'
Expand Down
10 changes: 5 additions & 5 deletions textfieldboxes/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
minSdkVersion 15
targetSdkVersion 27
targetSdkVersion 28

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand All @@ -23,7 +23,7 @@ dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class TextFieldBoxes extends FrameLayout {
/**
* the text color for the counterLabel text. DEFAULT_TEXT_COLOR by default.
*/
protected int counterTextColor;
protected int mCounterTextColor;

/**
* the text color for when something is wrong (e.g. exceeding max characters, setError()).
Expand Down Expand Up @@ -501,8 +501,8 @@ protected void handleAttributes(Context context, AttributeSet attrs) {
/* Colors */
this.helperTextColor = styledAttrs
.getInt(R.styleable.TextFieldBoxes_helperTextColor, DEFAULT_TEXT_COLOR);
this.counterTextColor = styledAttrs
.getInt(R.styleable.TextFieldBoxes_counterTextColor, DEFAULT_TEXT_COLOR);
this.mCounterTextColor = styledAttrs
.getInt(R.styleable.TextFieldBoxes_mCounterTextColor, DEFAULT_TEXT_COLOR);
this.errorColor = styledAttrs
.getInt(R.styleable.TextFieldBoxes_errorColor, DEFAULT_ERROR_COLOR);
this.primaryColor = styledAttrs
Expand Down Expand Up @@ -863,7 +863,7 @@ protected void removeCounterError() {
this.onError = false;
if (this.hasFocus) setHighlightColor(this.primaryColor);
else setHighlightColor(this.secondaryColor);
this.counterLabel.setTextColor(this.counterTextColor);
this.counterLabel.setTextColor(this.mCounterTextColor);
}

/**
Expand Down Expand Up @@ -919,7 +919,7 @@ private void triggerSetters() {

/* Colors */
setHelperTextColor(this.helperTextColor);
setCounterTextColor(this.counterTextColor);
setmCounterTextColor(this.mCounterTextColor);
setErrorColor(this.errorColor);
setPrimaryColor(this.primaryColor);
setSecondaryColor(this.secondaryColor);
Expand Down Expand Up @@ -971,10 +971,10 @@ public void setHelperTextColor(int colorRes) {
this.helperLabel.setTextColor(this.helperTextColor);
}

public void setCounterTextColor(int colorRes) {
public void setmCounterTextColor(int colorRes) {

this.counterTextColor = colorRes;
this.counterLabel.setTextColor(this.counterTextColor);
this.mCounterTextColor = colorRes;
this.counterLabel.setTextColor(this.mCounterTextColor);
}

public void setErrorColor(int colorRes) {
Expand Down Expand Up @@ -1199,8 +1199,8 @@ public int getHelperTextColor() {
return this.helperTextColor;
}

public int getCounterTextColor() {
return this.counterTextColor;
public int getmCounterTextColor() {
return this.mCounterTextColor;
}

public int getErrorColor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
android:textSize="@dimen/label_text_size"
tools:text="Label" />

<android.support.v4.widget.Space
<android.widget.Space
android:id="@+id/text_field_boxes_label_space"
android:layout_width="wrap_content"
android:layout_height="@dimen/label_space_height"
Expand Down Expand Up @@ -123,7 +123,7 @@

</LinearLayout>

<android.support.v4.widget.Space
<android.widget.Space
android:id="@+id/text_field_boxes_label_space_below"
android:layout_width="wrap_content"
android:layout_height="@dimen/label_space_height"
Expand Down
2 changes: 1 addition & 1 deletion textfieldboxes/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<!--Colors-->
<attr name="helperTextColor" format="color" />
<attr name="counterTextColor" format="color" />
<attr name="mCounterTextColor" format="color" />
<attr name="errorColor" format="color" />
<attr name="primaryColor" format="color" />
<attr name="secondaryColor" format="color" />
Expand Down

0 comments on commit c1cd100

Please sign in to comment.