本文整理汇总了Java中android.widget.AbsListView.getPaddingBottom方法的典型用法代码示例。如果您正苦于以下问题:Java AbsListView.getPaddingBottom方法的具体用法?Java AbsListView.getPaddingBottom怎么用?Java AbsListView.getPaddingBottom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.AbsListView
的用法示例。
在下文中一共展示了AbsListView.getPaddingBottom方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canChildScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
public static boolean canChildScrollDown(View view) {
if (android.os.Build.VERSION.SDK_INT < 14) {
if (view instanceof AbsListView) {
final AbsListView absListView = (AbsListView) view;
return absListView.getChildCount() > 0
&& (absListView.getLastVisiblePosition() < absListView.getChildCount() - 1
|| absListView.getChildAt(absListView.getChildCount() - 1).getBottom() > absListView.getPaddingBottom());
} else if (view instanceof ScrollView) {
ScrollView scrollView = (ScrollView) view;
if (scrollView.getChildCount() == 0) {
return false;
} else {
return scrollView.getScrollY() < scrollView.getChildAt(0).getHeight() - scrollView.getHeight();
}
} else {
return false;
}
} else {
return view.canScrollVertically(1);
}
}
示例2: 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;
}
示例3: canScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
public static boolean canScrollDown(View targetView) {
if (android.os.Build.VERSION.SDK_INT < 14) {
if (targetView instanceof AbsListView) {
final AbsListView absListView = (AbsListView) targetView;
return absListView.getChildCount() > 0
&& (absListView.getLastVisiblePosition() < absListView.getChildCount() - 1
|| absListView.getChildAt(absListView.getChildCount() - 1).getBottom() > absListView.getPaddingBottom());
} else {
return targetView.getScrollY() < 0;
}
} else {
return targetView.canScrollVertically(1);
}
}
示例4: canChildScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
public boolean canChildScrollDown() {
if (android.os.Build.VERSION.SDK_INT < 14) {
if (mTarget instanceof AbsListView) {
final AbsListView absListView = (AbsListView) mTarget;
try {
if (absListView.getCount() > 0) {
if (absListView.getLastVisiblePosition() + 1 == absListView.getCount()) {
int lastIndex = absListView.getLastVisiblePosition() - absListView.getFirstVisiblePosition();
return absListView.getChildAt(lastIndex).getBottom() == absListView.getPaddingBottom();
}
}
} catch (Exception e) {
e.printStackTrace();
}
return true;
} else {
return true;
}
} else {
return ViewCompat.canScrollVertically(mTarget, 1);
}
}
示例5: canChildScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
@Override
protected boolean canChildScrollDown() {
if (android.os.Build.VERSION.SDK_INT < 14) {
if (mTarget instanceof AbsListView) {
final AbsListView absListView = (AbsListView) mTarget;
return absListView.getChildCount() > 0
&& (absListView.getLastVisiblePosition() < absListView.getCount() - 1 ||
absListView.getChildAt(absListView.getChildCount() - 1).getBottom() >
absListView.getHeight() - absListView.getPaddingBottom());
} else {
return ViewCompat.canScrollVertically(mTarget, 1);
}
} else {
return ViewCompat.canScrollVertically(mTarget, 1);
}
}
示例6: canChildScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
public boolean canChildScrollDown() {
if (android.os.Build.VERSION.SDK_INT < 14) {
if (mTarget instanceof AbsListView) {
final AbsListView absListView = (AbsListView) mTarget;
View lastChild = absListView.getChildAt(absListView.getChildCount() - 1);
if (lastChild != null) {
return (absListView.getLastVisiblePosition() == (absListView.getCount() - 1))
&& lastChild.getBottom() > absListView.getPaddingBottom();
} else {
return false;
}
} else {
return mTarget.getHeight() - mTarget.getScrollY() > 0;
}
} else {
return ViewCompat.canScrollVertically(mTarget, 1);
}
}
示例7: canChildScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
/**
* 是否能上拉
*
* @return
*/
private boolean canChildScrollDown() {
if (checkListener != null) {
return checkListener.canScrollDown();
}
if (android.os.Build.VERSION.SDK_INT < 14) {
if (child instanceof AbsListView) {
final AbsListView absListView = (AbsListView) child;
return absListView.getChildCount() > 0
&& (absListView.getLastVisiblePosition() < absListView.getChildCount() - 1
|| absListView.getChildAt(absListView.getChildCount() - 1).getBottom() > absListView.getHeight() - absListView.getPaddingBottom());
}
}
return ViewCompat.canScrollVertically(child, 1);
}
示例8: canScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
private static boolean canScrollDown(View mScrollableView) {
if (android.os.Build.VERSION.SDK_INT < 14) {
if (mScrollableView instanceof AbsListView) {
final AbsListView absListView = (AbsListView) mScrollableView;
return absListView.getChildCount() > 0
&& (absListView.getLastVisiblePosition() < absListView.getChildCount() - 1
|| absListView.getChildAt(absListView.getChildCount() - 1).getBottom() > absListView.getPaddingBottom());
} else {
return mScrollableView.getScrollY() < 0;
}
} else {
return mScrollableView.canScrollVertically(1);
}
}
示例9: canChildScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
/**
* 判断View是否可以下拉
* @return canChildScrollDown
*/
public boolean canChildScrollDown() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
if (mTargetView instanceof AbsListView) {
final AbsListView absListView = (AbsListView) mTargetView;
return absListView.getChildCount() > 0 && absListView.getAdapter() != null
&& (absListView.getLastVisiblePosition() < absListView.getAdapter().getCount() - 1 || absListView.getChildAt(absListView.getChildCount() - 1)
.getBottom() < absListView.getPaddingBottom());
} else {
return ViewCompat.canScrollVertically(mTargetView, 1) || mTargetView.getScrollY() > 0;
}
} else {
return ViewCompat.canScrollVertically(mTargetView, 1);
}
}
示例10: canChildScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
/**
* Whether it is possible for the child view of this layout to scroll down. Override this if the child view is a custom view.
* 判断是否可以上拉
*/
public static boolean canChildScrollDown(View mChildView) {
if (Build.VERSION.SDK_INT < 14) {
if (mChildView instanceof AbsListView) {
final AbsListView absListView = (AbsListView) mChildView;
return absListView.getChildCount() > 0
&& (absListView.getLastVisiblePosition() < absListView.getChildCount() - 1
|| absListView.getChildAt(absListView.getChildCount() - 1).getBottom() > absListView.getPaddingBottom());
} else {
return ViewCompat.canScrollVertically(mChildView, 1) || mChildView.getScrollY() < 0;
}
} else {
return ViewCompat.canScrollVertically(mChildView, 1);
}
}
示例11: canChildScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
/**
* 判断View是否可以下拉
* @return canChildScrollDown
*/
public boolean canChildScrollDown() {
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
if (mTargetView instanceof AbsListView) {
final AbsListView absListView = (AbsListView) mTargetView;
return absListView.getChildCount() > 0 && absListView.getAdapter() != null
&& (absListView.getLastVisiblePosition() < absListView.getAdapter().getCount() - 1 || absListView.getChildAt(absListView.getChildCount() - 1)
.getBottom() < absListView.getPaddingBottom());
} else {
return ViewCompat.canScrollVertically(mTargetView, 1) || mTargetView.getScrollY() > 0;
}
} else {
return ViewCompat.canScrollVertically(mTargetView, 1);
}
}
示例12: canChildScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
/**
* Whether it is possible for the child view of this layout to
* scroll down. Override this if the child view is a custom view.
*
* @return
*/
protected boolean canChildScrollDown() {
if (android.os.Build.VERSION.SDK_INT < 14) {
if (mTargetView instanceof AbsListView) {
final AbsListView absListView = (AbsListView) mTargetView;
return absListView.getChildCount() > 0
&& (absListView.getLastVisiblePosition() < absListView.getChildCount() - 1
|| absListView.getChildAt(absListView.getChildCount() - 1).getBottom() > absListView.getPaddingBottom());
} else {
return ViewCompat.canScrollVertically(mTargetView, 1) || mTargetView.getScrollY() < 0;
}
} else {
return ViewCompat.canScrollVertically(mTargetView, 1);
}
}
示例13: canChildScrollDown
import android.widget.AbsListView; //导入方法依赖的package包/类
public static boolean canChildScrollDown(View view) {
if (view instanceof AbsListView) {
final AbsListView absListView = (AbsListView) view;
if (Build.VERSION.SDK_INT < 14) {
return absListView.getChildCount() == 0
|| absListView.getAdapter() == null
|| (absListView.getChildCount() > 0
&& (absListView.getLastVisiblePosition() < absListView.getAdapter().getCount() - 1)
|| absListView.getChildAt(absListView.getChildCount() - 1).getBottom()
> absListView.getHeight() - absListView.getPaddingBottom());
} else {
if (Build.VERSION.SDK_INT < 26)
return absListView.getChildCount() == 0 ||
ViewCompat.canScrollVertically(view, 1);
else
return absListView.getChildCount() == 0 ||
view.canScrollVertically(1);
}
} else if (view instanceof ScrollView) {
final ScrollView scrollView = (ScrollView) view;
if (Build.VERSION.SDK_INT < 14) {
return scrollView.getChildCount() == 0
|| (scrollView.getChildCount() != 0
&& scrollView.getScrollY() < scrollView.getChildAt(0).getHeight()
- scrollView.getHeight());
} else {
if (Build.VERSION.SDK_INT < 26)
return scrollView.getChildCount() == 0 ||
ViewCompat.canScrollVertically(view, 1);
else
return scrollView.getChildCount() == 0 ||
view.canScrollVertically(1);
}
} else {
try {
if (view instanceof RecyclerView) {
final RecyclerView recyclerView = (RecyclerView) view;
if (Build.VERSION.SDK_INT < 26)
return recyclerView.getChildCount() == 0 ||
ViewCompat.canScrollVertically(view, 1);
else
return recyclerView.getChildCount() == 0 ||
view.canScrollVertically(1);
}
} catch (NoClassDefFoundError e) {
e.printStackTrace();
}
if (Build.VERSION.SDK_INT < 26)
return ViewCompat.canScrollVertically(view, 1);
else
return view.canScrollVertically(1);
}
}