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


Java AbsListView.getMeasuredHeight方法代码示例

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


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

示例1: isAbsListViewToBottom

import android.widget.AbsListView; //导入方法依赖的package包/类
public static boolean isAbsListViewToBottom(AbsListView absListView) {
    if (absListView != null && absListView.getAdapter() != null && absListView.getChildCount() > 0 && absListView.getLastVisiblePosition() == absListView.getAdapter().getCount() - 1) {
        View lastChild = absListView.getChildAt(absListView.getChildCount() - 1);

        BGAStickyNavLayout stickyNavLayout = getStickyNavLayout(absListView);
        if (stickyNavLayout != null) {
            // 处理BGAStickyNavLayout中lastChild.getBottom() <= absListView.getMeasuredHeight()失效问题

            // 0表示x,1表示y
            int[] location = new int[2];
            lastChild.getLocationOnScreen(location);
            int lastChildBottomOnScreen = location[1] + lastChild.getMeasuredHeight();
            stickyNavLayout.getLocationOnScreen(location);
            int stickyNavLayoutBottomOnScreen = location[1] + stickyNavLayout.getMeasuredHeight();
            return lastChildBottomOnScreen + absListView.getPaddingBottom() <= stickyNavLayoutBottomOnScreen;
        } else {
            return lastChild.getBottom() <= absListView.getMeasuredHeight();
        }
    }
    return false;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:BGARefreshScrollingUtil.java

示例2: canChildScrollDown

import android.widget.AbsListView; //导入方法依赖的package包/类
/**
 * Whether child view can scroll down
 * @return
 */
public boolean canChildScrollDown() {
  if (mTargetView == null) {
    return false;
  }
  if (Build.VERSION.SDK_INT < 14) {
    if (mTargetView instanceof AbsListView) {
      final AbsListView absListView = (AbsListView) mTargetView;
      if (absListView.getChildCount() > 0) {
        int lastChildBottom = absListView.getChildAt(absListView.getChildCount() - 1)
            .getBottom();
        return absListView.getLastVisiblePosition() == absListView.getAdapter().getCount() - 1
               && lastChildBottom <= absListView.getMeasuredHeight();
      } else {
        return false;
      }

    } else {
      return ViewCompat.canScrollVertically(mTargetView, 1) || mTargetView.getScrollY() > 0;
    }
  } else {
    return ViewCompat.canScrollVertically(mTargetView, 1);
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:28,代码来源:WXSwipeLayout.java

示例3: isAbsListViewToBottom

import android.widget.AbsListView; //导入方法依赖的package包/类
public static boolean isAbsListViewToBottom(AbsListView absListView) {
    if (absListView != null && absListView.getAdapter() != null && absListView.getChildCount() > 0 && absListView.getLastVisiblePosition() == absListView.getAdapter().getCount() - 1) {
        View lastChild = absListView.getChildAt(absListView.getChildCount() - 1);

        return lastChild.getBottom() <= absListView.getMeasuredHeight();
    }
    return false;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:ScrollingUtil.java

示例4: isAbsListViewToBottom

import android.widget.AbsListView; //导入方法依赖的package包/类
public static boolean isAbsListViewToBottom(AbsListView absListView) {
    if (absListView != null && absListView.getAdapter() != null && absListView.getChildCount() > 0 && absListView.getLastVisiblePosition() == absListView.getAdapter().getCount() - 1) {
        View lastChild = absListView.getChildAt(absListView.getChildCount() - 1);

        return lastChild.getBottom() >= absListView.getMeasuredHeight();
        //return  true;
    }
    return false;
}
 
开发者ID:yanyiqun001,项目名称:goRefresh,代码行数:10,代码来源:ScrollingUtil.java


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