Skip to content

Commit

Permalink
Allow replacing state directly from a string
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmigloz committed Dec 9, 2018
1 parent d1c9144 commit 3b09a56
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## `1.2.0` (10/11/10)

- Allow replacing state directly from a string.

## `1.1.0` (10/11/10)

- Allow replacing state without styles.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Add the dependency:

```gradle
dependencies {
compile 'com.github.davidmigloz:multi-state-switch:1.1.0'
compile 'com.github.davidmigloz:multi-state-switch:1.2.0'
}
```

Expand Down
2 changes: 1 addition & 1 deletion lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'

ext.versionMajor = 1 // API Changes, adding big new feature, redesign the App
ext.versionMinor = 1 // New features in a backwards-compatible manner
ext.versionMinor = 2 // New features in a backwards-compatible manner
ext.versionPatch = 0 // Backwards-compatible bug fixes
ext.versionClassifier = null // Pre-releases (alpha, beta, rc, SNAPSHOT...)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ public void addStates(@NonNull List<State> states, @Nullable List<StateStyle> st
}
}

/**
* Replaces state.
* The text will be used for normal, selected and disabled states.
*/
public void replaceState(int stateIndex, @NonNull String stateText) {
replaceState(stateIndex, new State(stateText), null);
}

/**
* Replaces state.
*/
Expand Down

0 comments on commit 3b09a56

Please sign in to comment.