android.widget.ListView.getFooterViewsCount()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(179)

本文整理了Java中android.widget.ListView.getFooterViewsCount()方法的一些代码示例,展示了ListView.getFooterViewsCount()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListView.getFooterViewsCount()方法的具体详情如下:
包路径:android.widget.ListView
类名称:ListView
方法名:getFooterViewsCount

ListView.getFooterViewsCount介绍

暂无

代码示例

代码示例来源:origin: square/assertj-android

public S hasFooterViewsCount(int count) {
 isNotNull();
 int actualCount = actual.getFooterViewsCount();
 assertThat(actualCount) //
   .overridingErrorMessage("Expected footer views count <%s> but was <%s>.", count, actualCount) //
   .isEqualTo(count);
 return myself;
}

代码示例来源:origin: robolectric/robolectric

@Test
public void testGetFooterViewsCount() throws Exception {
 listView.addHeaderView(new View(context));
 listView.addFooterView(new View(context));
 listView.addFooterView(new View(context));
 prepareListWithThreeItems();
 assertThat(listView.getFooterViewsCount()).isEqualTo(2);
}

代码示例来源:origin: madreain/AndroidDream

@Override
public void addFooter() {
  if (mListView.getFooterViewsCount() <= 0 && null != mFooter) {
    mListView.addFooterView(mFooter);
  }
}

代码示例来源:origin: ugurcany/InfiniteListView

public void stopLoading(){
  if(listView.getFooterViewsCount() > 0) {
    listView.removeFooterView(loadingView);
  }
  swipeRefreshLayout.setRefreshing(false);
  loading = false;
}

代码示例来源:origin: madreain/AndroidDream

@Override
public void removeFooter() {
  if (mListView.getFooterViewsCount() > 0 && null != mFooter) {
    mListView.removeFooterView(mFooter);
  }
}

代码示例来源:origin: com.squareup.assertj/assertj-android

public S hasFooterViewsCount(int count) {
 isNotNull();
 int actualCount = actual.getFooterViewsCount();
 assertThat(actualCount) //
   .overridingErrorMessage("Expected footer views count <%s> but was <%s>.", count, actualCount) //
   .isEqualTo(count);
 return myself;
}

代码示例来源:origin: envyfan/AndroidReview

public void showFootView() {
  if (mFooterView == null) {
    mFooterView = (LinearLayout) LayoutInflater.from(getContext()).inflate(R.layout.list_footer, null);
    mFootViewProgressBar = (ProgressBar) mFooterView.findViewById(R.id.progressbar);
    mFootViewText = (TextView) mFooterView.findViewById(R.id.text);
  }
  updateFooterViewStateText();
  if (mListView.getFooterViewsCount() == 0) {
    mListView.addFooterView(mFooterView);
  }
}

代码示例来源:origin: stackoverflow.com

ListView lst = (ListView) findViewById(R.id.basket_listItems);
      if (lst.getFooterViewsCount() > 0)
      {
        lst.removeFooterView(footerView);
      }
      LayoutInflater inflater =  this.getLayoutInflater();
      footerView = inflater.inflate(R.layout.basket_footer, null);
      lst.addFooterView(footerView);
      this.onContentChanged();
     if (adapter != null)
     {
       ...

代码示例来源:origin: JrDong/Android-Material-Sloth

public void setLoading(boolean loading) {
  isLoading = loading;
  if (isLoading) {
    //防止重绘
    if (mListView.getFooterViewsCount() == 0) {
      mListView.addFooterView(mFootView);
    }
  } else {
    mListView.removeFooterView(mFootView);
  }
}

代码示例来源:origin: Rachel-Ding/Android-Tiny-Projects

public void handleMessage(Message msg) {
      switch (msg.what) {
        case SHOW_FOOTER:
          refreshListView((Integer) msg.obj);

          adapter.notifyDataSetChanged();

          if (listView.getFooterViewsCount() > 0) { // 如果有底部视图
            listView.removeFooterView(pullUpFooter);
          }
          loadfinish = true; // 加载完成
          break;
//                case NONE_FOOTER:
//                    Toast.makeText(MainActivity.this,"已经全部加载完成", Toast.LENGTH_SHORT).show();
//                    break;
        default:
          break;
      }
    }
  };

代码示例来源:origin: ugurcany/InfiniteListView

public void startLoading(){
  //IF FOOTER ALREADY EXISTS, REMOVE IT
  if(listView.getFooterViewsCount() > 0) {
    listView.removeFooterView(loadingView);
  }
  loading = true;
  if(!swipeRefreshLayout.isRefreshing() && listView.getFooterViewsCount() == 0) {
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
      listView.addFooterView(loadingView, null, false);
    }
    else{
      listView.setAdapter(null);
      listView.addFooterView(loadingView, null, false);
      listView.setAdapter(infiniteListAdapter);
      listView.setSelection(infiniteListAdapter.getCount() - 1);
    }
  }
}

代码示例来源:origin: sealtalk/sealtalk-android

@Override
  public void run() {
    listView.requestFocusFromTouch();
    listView.setSelection(listView.getCount() - listView.getFooterViewsCount() - listView.getHeaderViewsCount());
  }
}, 100);

代码示例来源:origin: sealtalk/sealtalk-android

@Override
  public void run() {
    listView.requestFocusFromTouch();
    listView.setSelection(listView.getCount() - listView.getFooterViewsCount() - listView.getHeaderViewsCount());
  }
}, 100);

代码示例来源:origin: stackoverflow.com

if(listView.getFooterViewsCount()==0)

代码示例来源:origin: stackoverflow.com

int count = mListView.getCount() - mListView.getHeaderViewsCount() - mListView.getFooterViewsCount();
String result = "";
for (int i = 0; i < count; i++)

代码示例来源:origin: andstatus/andstatus

private void addSyncButtons() {
  final ListView listView = getListView();
  if (listView != null) {
    if (listView.getHeaderViewsCount() == 0) {
      listView.addHeaderView(syncYoungerView);
      disableHeaderSyncButton(R.string.loading);
    }
    if (listView.getFooterViewsCount() == 0) {
      listView.addFooterView(syncOlderView);
      disableFooterButton(R.string.loading);
    }
  }
}

相关文章

ListView类方法