Skip to content

Commit

Permalink
Remove unused attr
Browse files Browse the repository at this point in the history
close #7
  • Loading branch information
yuzumone committed Feb 8, 2017
1 parent 84820fc commit a22faf0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Add this to your app `build.gradle` file.
```gradle
dependencies {
...
compile 'com.github.yuzumone:StateButton:0.1.1'
compile 'com.github.yuzumone:StateButton:0.1.2'
}
```

Expand Down Expand Up @@ -70,7 +70,7 @@ To set text of the button you use the setTrueText or setFalseText functionality
```xml
app:trueText="True"
or
app:trueTextRes="@string/true_string"
app:trueText="@string/true_string"
```

### Java
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:trueTextRes="@string/true_string"
app:falseTextRes="@string/false_string"
app:trueText="@string/true_string"
app:falseText="@string/false_string"
/>
</RelativeLayout>
4 changes: 2 additions & 2 deletions statebutton/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "0.1.1"
versionCode 3
versionName "0.1.2"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,7 @@ private void init(Context context, AttributeSet attrs, int defStyle) {
Boolean state = array.getBoolean(R.styleable.StateButton_state, false);

trueText = array.getString(R.styleable.StateButton_trueText);
int trueStringRes = array.getResourceId(R.styleable.StateButton_trueTextRes, 0);
if (trueStringRes != 0) {
trueText = context.getString(trueStringRes);
}
falseText = array.getString(R.styleable.StateButton_falseText);
int falseStringRes = array.getResourceId(R.styleable.StateButton_falseTextRes, 0);
if (falseStringRes != 0) {
falseText = context.getString(falseStringRes);
}

setState(state);
array.recycle();
Expand Down
2 changes: 0 additions & 2 deletions statebutton/src/main/res/values/attr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<declare-styleable name="StateButton">
<attr name="state" format="boolean"/>
<attr name="trueText" format="string"/>
<attr name="trueTextRes" format="integer"/>
<attr name="falseText" format="string"/>
<attr name="falseTextRes" format="integer"/>
</declare-styleable>
</resources>

0 comments on commit a22faf0

Please sign in to comment.