当前位置: 首页>>代码示例>>Java>>正文


Java Adapter.isEmpty方法代码示例

本文整理汇总了Java中android.widget.Adapter.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java Adapter.isEmpty方法的具体用法?Java Adapter.isEmpty怎么用?Java Adapter.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.Adapter的用法示例。


在下文中一共展示了Adapter.isEmpty方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isFirstItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
private boolean isFirstItemVisible() {
	final Adapter adapter = mRefreshableView.getAdapter();

	if (null == adapter || adapter.isEmpty()) {
		if (DEBUG) {
			Log.d(LOG_TAG, "isFirstItemVisible. Empty View.");
		}
		return true;

	} else {

		/**
		 * This check should really just be:
		 * mRefreshableView.getFirstVisiblePosition() == 0, but PtRListView
		 * internally use a HeaderView which messes the positions up. For
		 * now we'll just add one to account for it and rely on the inner
		 * condition which checks getTop().
		 */
		if (mRefreshableView.getFirstVisiblePosition() <= 1) {
			final View firstVisibleChild = mRefreshableView.getChildAt(0);
			if (firstVisibleChild != null) {
				return firstVisibleChild.getTop() >= mRefreshableView.getTop();
			}
		}
	}

	return false;
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:29,代码来源:PullToRefreshAdapterViewBase.java

示例2: isLastItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
private boolean isLastItemVisible() {
    Adapter adapter = ((AbsListView) this.mRefreshableView).getAdapter();
    if (adapter == null || adapter.isEmpty()) {
        return true;
    }
    int lastItemPosition = ((AbsListView) this.mRefreshableView).getCount() - 1;
    int lastVisiblePosition = ((AbsListView) this.mRefreshableView).getLastVisiblePosition();
    if (lastVisiblePosition >= lastItemPosition - 1) {
        View lastVisibleChild = ((AbsListView) this.mRefreshableView).getChildAt
                (lastVisiblePosition - ((AbsListView) this.mRefreshableView)
                        .getFirstVisiblePosition());
        if (lastVisibleChild != null) {
            return lastVisibleChild.getBottom() <= ((AbsListView) this.mRefreshableView)
                    .getBottom();
        }
    }
    return false;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:PullToRefreshAdapterViewBase.java

示例3: isFirstItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
/**
 * 判断第一个child是否完全显示出来
 * 
 * @return true完全显示出来,否则false
 */
private boolean isFirstItemVisible() {
	final Adapter adapter = mListView.getAdapter();

	if (null == adapter || adapter.isEmpty()) {
		return true;
	}

	if (mListView.getChildCount() > 0
			&& mListView.getFirstVisiblePosition() == 0
			&& mListView.getChildAt(0).getTop() >= mListView
					.getPaddingTop()) {
		return true;
	}

	return false;
}
 
开发者ID:tangjiabing,项目名称:XListView,代码行数:22,代码来源:PullToRefreshListView.java

示例4: isLastItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
private boolean isLastItemVisible() {
	final Adapter adapter = mRefreshableView.getAdapter();

	if (null == adapter || adapter.isEmpty()) {
		if (DEBUG) {
			Log.d(LOG_TAG, "isLastItemVisible. Empty View.");
		}
		return true;
	} else {
		final int lastItemPosition = mRefreshableView.getCount() - 1;
		final int lastVisiblePosition = mRefreshableView.getLastVisiblePosition();

		if (DEBUG) {
			Log.d(LOG_TAG, "isLastItemVisible. Last Item Position: " + lastItemPosition + " Last Visible Pos: "
					+ lastVisiblePosition);
		}

		/**
		 * This check should really just be: lastVisiblePosition ==
		 * lastItemPosition, but PtRListView internally uses a FooterView
		 * which messes the positions up. For me we'll just subtract one to
		 * account for it and rely on the inner condition which checks
		 * getBottom().
		 */
		if (lastVisiblePosition >= lastItemPosition - 1) {
			final int childIndex = lastVisiblePosition - mRefreshableView.getFirstVisiblePosition();
			final View lastVisibleChild = mRefreshableView.getChildAt(childIndex);
			if (lastVisibleChild != null) {
				return lastVisibleChild.getBottom() <= mRefreshableView.getBottom();
			}
		}
	}

	return false;
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:36,代码来源:PullToRefreshAdapterViewBase.java

示例5: isFirstItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
private boolean isFirstItemVisible() {
    Adapter adapter = ((ExpandableListView) this.mRootView).getAdapter();
    if (adapter == null || adapter.isEmpty()) {
        return true;
    }
    if (((ExpandableListView) this.mRootView).getFirstVisiblePosition() <= 1) {
        View firstVisibleChild = ((ExpandableListView) this.mRootView).getChildAt(0);
        if (firstVisibleChild != null) {
            return firstVisibleChild.getTop() >= ((ExpandableListView) this.mRootView).getTop();
        }
    }
    return false;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:14,代码来源:PullToZoomExpandableListViewEx.java

示例6: isFirstItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
private boolean isFirstItemVisible() {
    Adapter adapter = ((AbsListView) this.mRefreshableView).getAdapter();
    if (adapter == null || adapter.isEmpty()) {
        return true;
    }
    if (((AbsListView) this.mRefreshableView).getFirstVisiblePosition() <= 1) {
        View firstVisibleChild = ((AbsListView) this.mRefreshableView).getChildAt(0);
        if (firstVisibleChild != null) {
            return firstVisibleChild.getTop() >= ((AbsListView) this.mRefreshableView).getTop();
        }
    }
    return false;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:14,代码来源:PullToRefreshAdapterViewBase.java

示例7: isFirstItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
private boolean isFirstItemVisible() {
    final Adapter adapter = mRefreshableView.getAdapter();

    if (null == adapter || adapter.isEmpty()) {
        if (DEBUG) {
            Log.d(LOG_TAG, "isFirstItemVisible. Empty View.");
        }
        return true;

    } else {

        /**
         * This check should really just be:
         * mRefreshableView.getFirstVisiblePosition() == 0, but PtRListView
         * internally use a HeaderView which messes the positions up. For
         * now we'll just add one to account for it and rely on the inner
         * condition which checks getTop().
         */
        if (mRefreshableView.getFirstVisiblePosition() <= 1) {
            final View firstVisibleChild = mRefreshableView.getChildAt(0);
            if (firstVisibleChild != null) {
                return firstVisibleChild.getTop() >= mRefreshableView.getTop();
            }
        }
    }

    return false;
}
 
开发者ID:nggirl,项目名称:RefreshTabView,代码行数:29,代码来源:PullToRefreshAdapterViewBase.java

示例8: isLastItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
private boolean isLastItemVisible() {
	final Adapter adapter = mRefreshableView.getAdapter();

	if (null == adapter || adapter.isEmpty()) {
		if (DEBUG) {
			Log.d(LOG_TAG, "isLastItemVisible. Empty View.");
		}
		return true;
	} else {
		final int lastItemPosition = mRefreshableView.getCount() - 1;
		final int lastVisiblePosition = mRefreshableView.getLastVisiblePosition();

		// if (DEBUG) {
		// Log.d(LOG_TAG, "isLastItemVisible. Last Item Position: " +
		// lastItemPosition + " Last Visible Pos: "
		// + lastVisiblePosition);
		// }

		/**
		 * This check should really just be: lastVisiblePosition ==
		 * lastItemPosition, but PtRListView internally uses a FooterView
		 * which messes the positions up. For me we'll just subtract one to
		 * account for it and rely on the inner condition which checks
		 * getBottom().
		 */
		if (lastVisiblePosition >= lastItemPosition - 1) {
			final int childIndex = lastVisiblePosition - mRefreshableView.getFirstVisiblePosition();
			final View lastVisibleChild = mRefreshableView.getChildAt(childIndex);
			if (lastVisibleChild != null) {
				return lastVisibleChild.getBottom() <= mRefreshableView.getBottom();
			}
		}
	}

	return false;
}
 
开发者ID:LegendKe,项目名称:MyTravelingDiary,代码行数:37,代码来源:PullToRefreshAdapterViewBase.java

示例9: isLastItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
private boolean isLastItemVisible() {
	final Adapter adapter = mRefreshableView.getAdapter();

	if (null == adapter || adapter.isEmpty()) {
		if (DEBUG) {
			Log.d(LOG_TAG, "isLastItemVisible. Empty View.");
		}
		return true;
	} else {
		final int lastItemPosition = mRefreshableView.getCount() - 1;
		final int lastVisiblePosition = mRefreshableView.getLastVisiblePosition();

		if (DEBUG) {
			Log.d(LOG_TAG, "isLastItemVisible. Last Item Position: " + lastItemPosition + " Last Visible Pos: "
					+ lastVisiblePosition);
		}

		/**
		 * This check should really just be: lastVisiblePosition ==
		 * lastItemPosition, but PtRListView internally uses a FooterView
		 * which messes the positions up. For me we'll just subtract one to
		 * account for it and rely on the inner condition which checks
		 * getBottom().
		 */
		//if (lastVisiblePosition >= lastItemPosition - 1) {
		if ((null == mIndicatorIvBottom && lastVisiblePosition == lastItemPosition) ||
									(null != mIndicatorIvBottom && lastVisiblePosition >= lastItemPosition - 1)) {
			final int childIndex = lastVisiblePosition - mRefreshableView.getFirstVisiblePosition();
			final View lastVisibleChild = mRefreshableView.getChildAt(childIndex);
			//if (lastVisibleChild != null) {
			if (lastVisibleChild != null && lastVisibleChild != mIndicatorIvBottom) {
				return lastVisibleChild.getBottom() <= mRefreshableView.getBottom();
			}
		}
	}

	return false;
}
 
开发者ID:lujianzhao,项目名称:AndroidBase,代码行数:39,代码来源:PullToRefreshAdapterViewBase.java

示例10: isLastItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
private boolean isLastItemVisible() {
    final Adapter adapter = mRefreshableView.getAdapter();

    if (null == adapter || adapter.isEmpty()) {
        if (DEBUG) {
            Log.d(LOG_TAG, "isLastItemVisible. Empty View.");
        }
        return true;
    } else {
        final int lastItemPosition = mRefreshableView.getCount() - 1;
        final int lastVisiblePosition = mRefreshableView.getLastVisiblePosition();

        if (DEBUG) {
            Log.d(LOG_TAG, "isLastItemVisible. Last Item Position: " + lastItemPosition + " Last Visible Pos: "
                    + lastVisiblePosition);
        }

        /**
         * This check should really just be: lastVisiblePosition ==
         * lastItemPosition, but PtRListView internally uses a FooterView
         * which messes the positions up. For me we'll just subtract one to
         * account for it and rely on the inner condition which checks
         * getBottom().
         */
        if (lastVisiblePosition >= lastItemPosition - 1) {
            final int childIndex = lastVisiblePosition - mRefreshableView.getFirstVisiblePosition();
            final View lastVisibleChild = mRefreshableView.getChildAt(childIndex);
            if (lastVisibleChild != null) {
                return lastVisibleChild.getBottom() <= mRefreshableView.getBottom();
            }
        }
    }

    return false;
}
 
开发者ID:nggirl,项目名称:RefreshTabView,代码行数:36,代码来源:PullToRefreshAdapterViewBase.java

示例11: isFirstItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
private boolean isFirstItemVisible() {
	final Adapter adapter = mRefreshableView.getAdapter();

	if (null == adapter || adapter.isEmpty()) {
		if (DEBUG) {
			Log.d(LOG_TAG, "isFirstItemVisible. Empty View.");
		}
		return true;

	} else {

		/**
		 * This check should really just be:
		 * mRefreshableView.getFirstVisiblePosition() == 0, but PtRListView
		 * internally use a HeaderView which messes the positions up. For
		 * now we'll just add one to account for it and rely on the inner
		 * condition which checks getTop().
		 */
		//if (mRefreshableView.getFirstVisiblePosition() <= 1) {
		if ((null == mIndicatorIvTop && mRefreshableView.getFirstVisiblePosition() == 0) ||
									(null != mIndicatorIvTop && mRefreshableView.getFirstVisiblePosition() <= 1)) {
			final View firstVisibleChild = mRefreshableView.getChildAt(0);
			//if (firstVisibleChild != null) {
			if (firstVisibleChild != null && firstVisibleChild != mIndicatorIvTop) {
				return firstVisibleChild.getTop() >= mRefreshableView.getTop();
			}
		}
	}

	return false;
}
 
开发者ID:lujianzhao,项目名称:AndroidBase,代码行数:32,代码来源:PullToRefreshAdapterViewBase.java

示例12: setEmptyView

import android.widget.Adapter; //导入方法依赖的package包/类
public void setEmptyView(View paramView) {
	this.mEmptyView = paramView;
	Adapter localAdapter = getAdapter();
	boolean bool = (localAdapter == null) || (localAdapter.isEmpty());
	updateEmptyStatus(bool);
}
 
开发者ID:Evan-Galvin,项目名称:FreeStreams-TVLauncher,代码行数:7,代码来源:AdapterView.java

示例13: isLastItemVisible

import android.widget.Adapter; //导入方法依赖的package包/类
private boolean isLastItemVisible()
{
    final Adapter adapter = mRefreshableView.getAdapter();

    if (null == adapter || adapter.isEmpty())
    {
        if (DEBUG)
        {
            Log.d(LOG_TAG, "isLastItemVisible. Empty View.");
        }
        return true;
    } else
    {
        final int lastItemPosition = mRefreshableView.getCount() - 1;
        final int lastVisiblePosition = mRefreshableView.getLastVisiblePosition();

        if (DEBUG)
        {
            Log.d(LOG_TAG, "isLastItemVisible. Last Item Position: " + lastItemPosition + " Last Visible Pos: "
                    + lastVisiblePosition);
        }

        /**
         * This check should really just be: lastVisiblePosition ==
         * lastItemPosition, but PtRListView internally uses a FooterView
         * which messes the positions up. For me we'll just subtract one to
         * account for it and rely on the inner condition which checks
         * getBottom().
         */
        if (lastVisiblePosition >= lastItemPosition - 1)
        {
            final int childIndex = lastVisiblePosition - mRefreshableView.getFirstVisiblePosition();
            final View lastVisibleChild = mRefreshableView.getChildAt(childIndex);
            if (lastVisibleChild != null)
            {
                return lastVisibleChild.getBottom() <= mRefreshableView.getBottom();
            }
        }
    }

    return false;
}
 
开发者ID:BigAppOS,项目名称:BigApp_WordPress_Android,代码行数:43,代码来源:PullToRefreshAdapterViewBase.java


注:本文中的android.widget.Adapter.isEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。