예제 #1
0
 /**
  * 启用或禁用加载更多的功能.
  *
  * @param enable
  */
 public void setPullLoadEnable(boolean enable) {
   mEnablePullLoad = enable;
   if (!mEnablePullLoad) {
     mFooterView.hide(); // 隐藏
     mPullLoading = false;
     mFooterView.setState(XListViewFooter.STATE_NORMAL);
     // both "上拉" 和 "点击" 将调用加载更多.
     mFooterView.setOnClickListener(
         new OnClickListener() {
           @Override
           public void onClick(View v) {
             startLoadMore();
           }
         });
   } else {
     mPullLoading = false;
     mFooterView.show(); // 显示
     mFooterView.setState(XListViewFooter.STATE_NORMAL);
     // both "上拉" 和 "点击" 将调用加载更多.
     mFooterView.setOnClickListener(
         new OnClickListener() {
           @Override
           public void onClick(View v) {
             startLoadMore();
           }
         });
   }
 }
예제 #2
0
	/**
	 * enable or disable pull up load more feature.
	 * 
	 * @param enable
	 */
	public void setPullLoadEnable(boolean enable) {
		mEnablePullLoad = enable;
		if (!mEnablePullLoad) {
			mFooterView.hide();
			mFooterView.setOnClickListener(null);
		} else {
			mPullLoading = false;
			mFooterView.show();
			mFooterView.setState(XListViewFooter.STATE_NORMAL);
			// both "pull up" and "click" will invoke load more.
			mFooterView.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					startLoadMore();
				}
			});
		}
	}