File tree Expand file tree Collapse file tree
commonadapter/src/main/java/com/github/zeng1990java/commonadapter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -385,18 +385,30 @@ private boolean isLoadMore(int position){
385385 return hasLoadMoreView () && (position == getHeaderViewItemCount () + getDataItemCount () + getFooterViewItemCount ());
386386 }
387387
388- public int getHeaderViewItemCount (){
388+ /**
389+ * 有Header返回1,没有返回0
390+ * @return
391+ */
392+ protected int getHeaderViewItemCount (){
389393 return hasHeaderView () ? 1 : 0 ;
390394 }
391395
392- public int getFooterViewItemCount (){
396+ /**
397+ * 有Footer返回1,没有返回0
398+ * @return
399+ */
400+ protected int getFooterViewItemCount (){
393401 return hasFooterView () ? 1 : 0 ;
394402 }
395403
396- public int getLoadMoreViewItemCount (){
404+ protected int getLoadMoreViewItemCount (){
397405 return hasLoadMoreView () ? 1 : 0 ;
398406 }
399407
408+ /**
409+ * 是否添加了Header
410+ * @return
411+ */
400412 public boolean hasHeaderView (){
401413 if (mHeaderLayout == null ){
402414 return false ;
@@ -405,6 +417,10 @@ public boolean hasHeaderView(){
405417 return mHeaderLayout .getChildCount () > 0 ;
406418 }
407419
420+ /**
421+ * 是否添加了Footer
422+ * @return
423+ */
408424 public boolean hasFooterView (){
409425 if (mFooterLayout == null ){
410426 return false ;
You can’t perform that action at this time.
0 commit comments