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

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

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

ListView.removeFooterView介绍

暂无

代码示例

代码示例来源:origin: jiangqqlmj/FastDev4Android

/**
 * @param loading
 */
public void setLoading(boolean loading) {
  isLoading = loading;
  if (isLoading) {
    mInternalListView.addFooterView(load_view);
  } else {
    mInternalListView.removeFooterView(load_view);
    mYDown = 0;
    mLastY = 0;
  }
}

代码示例来源:origin: huxq17/XRefreshView

@Override
public boolean removeFooterView(View v) {
  if (super.removeFooterView(v)) {
    mFooterViews.remove(v);
    return true;
  }
  return false;
}

代码示例来源:origin: tianshaojie/AndroidFine

public void withLoadMoreView() {
  if (footerView == null) {
    footerView = View.inflate(getContext(), R.layout.layout_load_more, null);
    textView = (TextView) footerView.findViewById(R.id.text);
    progressBar = (ProgressBar) footerView.findViewById(R.id.progress);
  }
  getRefreshableView().removeFooterView(footerView);
  getRefreshableView().setFooterDividersEnabled(false);
  setLoadMoreViewTextLoading();
  getRefreshableView().addFooterView(footerView);
}

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

public void removeFootView() {
  if (mFooterView != null) {
    mListView.removeFooterView(mFooterView);
  }
  sPutUpState = PULL_UP_STATE_NONE;
}

代码示例来源:origin: navyifanr/AndroidTrainingDemo

@Override
protected void removeFooterView(View view) {
  mListView.removeFooterView(view);
}

代码示例来源:origin: tony-Shx/Swface

@Override
public boolean removeFooterView(View v) {
  if (super.removeFooterView(v)) {
    mFooterViews.remove(v);
    return true;
  }
  return false;
}

代码示例来源: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: 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: Rachel-Ding/Android-Tiny-Projects

listView.removeFooterView(pullUpFooter);
Toast.makeText(MainActivity.this, "数据全部加载完!", Toast.LENGTH_LONG).show();

代码示例来源: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: powerpoint45/Lucid-Browser

activity.browserListView.removeFooterView(activity.browserListView.getChildAt(i));

代码示例来源: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: Rachel-Ding/Android-Tiny-Projects

private void init() {
  pullRefreshView = (PullRefreshView) findViewById(R.id.pull_refresh_view);
  listView = (ListView) findViewById(R.id.listView);
  listMap = new ArrayList<Map<String, Object>>();
  pullUpFooter = MainActivity.this.getLayoutInflater().inflate(R.layout.pull_up_footer, null);
  listView.setOnScrollListener(new scrollListener());
  //初始化数据库
  db = new Db(this);
  dbWrite = db.getWritableDatabase();
  dbRead = db.getReadableDatabase();
  //获取数据库条数
  dataCount = getCount();
  //获取最大页数
  maxpage = (int) (dataCount % number == 0 ? dataCount / number : dataCount / number + 1);
  //加载缓存数据
  refreshListView(1);
  //初始化listView适配器
  adapter = new SimpleAdapter(this, listMap, R.layout.list_item, new String[]{"title", "date"}, new int[]{R.id.tvTitle, R.id.tvTime});
  /* 在适配器之前加页脚,这样适配器会重新被封装成 '有页脚的适配器' */
  listView.addFooterView(pullUpFooter);
  listView.setAdapter(adapter);
  if (dataCount == 0) {
    listView.removeFooterView(pullUpFooter);
  }
}

相关文章

ListView类方法