File tree Expand file tree Collapse file tree
multistatelayout/src/main/java/cn/refactor/multistatelayout Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#MultiStateLayout
22[ ![ ] ( https://jitpack.io/v/andyxialm/MultiStateLayout.svg )] ( https://jitpack.io/#andyxialm/MultiStateLayout )
3- <a href =" http://www.methodscount.com/?lib=com.github.andyxialm%3AMultiStateLayout%3A0.0.1 " ><img src =" https://img.shields.io/badge/Methods count-core: 60 | deps: 32-e91e63.svg " /></a >
3+ <a href =" http://www.methodscount.com/?lib=com.github.andyxialm%3AMultiStateLayout%3A0.0.2 " ><img src =" https://img.shields.io/badge/Methods count-core: 60 | deps: 32-e91e63.svg " /></a >
44
55A customize multiple state layout for Android.
66
@@ -21,7 +21,7 @@ allprojects {
2121##### Step 2. Add the dependency
2222~~~ xml
2323dependencies {
24- compile 'com.github.andyxialm:MultiStateLayout:0.0.1 '
24+ compile 'com.github.andyxialm:MultiStateLayout:0.0.2 '
2525}
2626~~~
2727
@@ -41,7 +41,7 @@ dependencies {
4141<dependency >
4242 <groupId >com.github.andyxialm</groupId >
4343 <artifactId >MultiStateLayout</artifactId >
44- <version >0.0.1 </version >
44+ <version >0.0.2 </version >
4545</dependency >
4646~~~
4747
Original file line number Diff line number Diff line change @@ -98,8 +98,11 @@ protected void onFinishInflate() {
9898
9999 if (getChildCount () > 1 ) {
100100 throw new IllegalStateException ("Expect to have one child." );
101+ } else if (getChildCount () == 1 ) {
102+ mContentView = getChildAt (CONTENT );
103+ } else {
104+ mContentView = null ;
101105 }
102- mContentView = getChildAt (CONTENT );
103106 }
104107
105108 /**
@@ -351,7 +354,9 @@ private void showViewByState(@State int state) {
351354 * show content view
352355 */
353356 private void showContentView () {
354- mContentView .setVisibility (VISIBLE );
357+ if (null != mContentView ) {
358+ mContentView .setVisibility (VISIBLE );
359+ }
355360 }
356361
357362 /**
You can’t perform that action at this time.
0 commit comments