diff --git a/CHANGELOG.md b/CHANGELOG.md index df555ab..28c1372 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/README.md b/README.md index 0afaf84..e1b8104 100644 --- a/README.md +++ b/README.md @@ -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' } ``` diff --git a/lib/build.gradle b/lib/build.gradle index 7763a23..6789692 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -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...) diff --git a/lib/src/main/java/com/davidmiguel/multistateswitch/MultiStateSwitch.java b/lib/src/main/java/com/davidmiguel/multistateswitch/MultiStateSwitch.java index 098f91a..93bda8e 100644 --- a/lib/src/main/java/com/davidmiguel/multistateswitch/MultiStateSwitch.java +++ b/lib/src/main/java/com/davidmiguel/multistateswitch/MultiStateSwitch.java @@ -218,6 +218,14 @@ public void addStates(@NonNull List states, @Nullable List 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. */