Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 05 22:51:00 CST 2016
#Tue Oct 17 08:42:17 BST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ public int getState() {
return mIsSystemState ? mCurState : mCurCustomStateKey;
}

/**
* check if the current state equals state passed in
* @param state
* @return
*/
public boolean isState(int state) {
return getState() == state;
}

/**
* @return current state is customise state
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ public boolean onMenuItemClick(MenuItem item) {
break;
}
Log.d(TAG, String.valueOf(mStateLayout.getState()));
//check state matches specified value
if (mStateLayout.isState(MultiStateLayout.State.ERROR)) {
Toast.makeText(MainActivity.this, "State is now ERROR", Toast.LENGTH_SHORT).show();
}
return true;
}
});
Expand Down