本文整理汇总了Java中com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter.isRefreshHeader方法的典型用法代码示例。如果您正苦于以下问题:Java LRecyclerViewAdapter.isRefreshHeader方法的具体用法?Java LRecyclerViewAdapter.isRefreshHeader怎么用?Java LRecyclerViewAdapter.isRefreshHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter
的用法示例。
在下文中一共展示了LRecyclerViewAdapter.isRefreshHeader方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawHorizontal
import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter; //导入方法依赖的package包/类
public void drawHorizontal(Canvas c, RecyclerView parent) {
int childCount = parent.getChildCount();
LRecyclerView recyclerView = (LRecyclerView) parent;
LRecyclerViewAdapter adapter = (LRecyclerViewAdapter) parent.getAdapter();
for (int i = 0; i < childCount; i++) {
if ((recyclerView.isOnTop() && (adapter.isHeader(i) || adapter.isRefreshHeader(i))) || adapter.isFooter(i)) {
c.drawRect(0, 0, 0, 0, mPaint);
} else {
final View child = parent.getChildAt(i);
final int top = child.getBottom();
final int bottom = top + verticalSpace;
int left = child.getLeft();
int right = child.getRight();
c.drawRect(left, top, right, bottom, mPaint);
}
}
}
示例2: drawVertical
import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter; //导入方法依赖的package包/类
public void drawVertical(Canvas c, RecyclerView parent) {
final int childCount = parent.getChildCount();
LRecyclerView recyclerView = (LRecyclerView) parent;
LRecyclerViewAdapter adapter = (LRecyclerViewAdapter) parent.getAdapter();
for (int i = 0; i < childCount; i++) {
if ((recyclerView.isOnTop() && (adapter.isHeader(i) || adapter.isRefreshHeader(i))) || adapter.isFooter(i)) {
c.drawRect(0, 0, 0, 0, mPaint);
} else {
final View child = parent.getChildAt(i);
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
final int top = child.getTop();
final int bottom = child.getBottom() + verticalSpace;
final int left = child.getRight() + params.rightMargin;
final int right = left + horizontalSpace;
c.drawRect(left, top, right, bottom, mPaint);
}
}
}
示例3: drawHorizontal
import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter; //导入方法依赖的package包/类
public void drawHorizontal(Canvas c, RecyclerView parent,LRecyclerViewAdapter adapter) {
int count = parent.getChildCount();
for (int i = 0; i < count; i++) {
final View child = parent.getChildAt(i);
final int top = child.getBottom();
final int bottom = top + verticalSpacing;
int left = child.getLeft() ;
int right = child.getRight();
int position = parent.getChildAdapterPosition(child);
c.save();
if (adapter.isRefreshHeader(position) || adapter. isHeader(position) || adapter.isFooter(position)) {
c.drawRect(0, 0, 0, 0, mPaint);
}else {
c.drawRect(left, top, right, bottom, mPaint);
}
c.restore();
}
}
示例4: drawVertical
import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter; //导入方法依赖的package包/类
public void drawVertical(Canvas c, RecyclerView parent,LRecyclerViewAdapter adapter) {
int count = parent.getChildCount();
for (int i = 0; i < count; i++) {
final View child = parent.getChildAt(i);
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
final int top = child.getTop();
//final int bottom = child.getBottom() + params.bottomMargin;
final int bottom = child.getBottom() + verticalSpacing; //这里使用verticalSpacing 代替 params.bottomMargin
final int left = child.getRight() + params.rightMargin;
final int right = left + itemSplitMarginEven*2;
int position = parent.getChildAdapterPosition(child);
c.save();
if (adapter.isRefreshHeader(position) || adapter. isHeader(position) || adapter.isFooter(position)) {
c.drawRect(0, 0, 0, 0, mPaint);
}else {
c.drawRect(left, top, right, bottom, mPaint);
}
c.restore();
}
}
示例5: getItemTopSpacing
import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter; //导入方法依赖的package包/类
private static int getItemTopSpacing(SpanLookup spanLookup, int verticalSpacing, int itemPosition, int spanCount, int childCount, LRecyclerViewAdapter adapter) {
if(adapter.isHeader(itemPosition) || adapter.isRefreshHeader(itemPosition) || adapter.isFooter(itemPosition)) {
return 0;
} else {
if (itemIsOnTheTopRow(spanLookup, itemPosition, spanCount, childCount)) {
return 0;
} else {
return (int) (.5f * verticalSpacing);
}
}
}
示例6: getItemBottomSpacing
import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter; //导入方法依赖的package包/类
private static int getItemBottomSpacing(SpanLookup spanLookup, int verticalSpacing, int itemPosition, int childCount, LRecyclerViewAdapter adapter) {
if(adapter.isHeader(itemPosition) || adapter.isRefreshHeader(itemPosition) || adapter.isFooter(itemPosition)) {
return 0;
} else {
if (itemIsOnTheBottomRow(spanLookup, itemPosition, childCount)) {
return 0;
} else {
return (int) (.5f * verticalSpacing);
}
}
}
示例7: getItemOffsets
import com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter; //导入方法依赖的package包/类
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, State state) {
super.getItemOffsets(outRect, view, parent, state);
int itemPosition = parent.getChildAdapterPosition(view);
int spanCount = getSpanCount(parent);
int childCount = parent.getAdapter().getItemCount();
LRecyclerViewAdapter adapter = (LRecyclerViewAdapter) parent.getAdapter();
if (adapter.isFooter(itemPosition) || adapter.isHeader(itemPosition) || adapter.isRefreshHeader(itemPosition)) {
//header,footer不进行绘制
outRect.set(0, 0, 0, 0);
} else {
if (!(parent.getLayoutManager() instanceof GridLayoutManager)) {
//LinearLayoutManager
if (itemPosition == (childCount - 2 - adapter.getHeaderViews().size()))
outRect.set(0, 0, 0, 0);
else
outRect.set(0, 0, 0, verticalSpace);
} else {
//GridLayoutManager
if (isLastRaw(parent, itemPosition, spanCount, childCount - 2 - adapter.getHeaderViews().size())) {
//最后一行
if (isLastColumn(parent, itemPosition, spanCount)) {
// 最后一行最后一列
outRect.set(0, 0, 0, verticalSpace);
} else {
// 最后一行不是最后一列
outRect.set(0, 0, horizontalSpace, verticalSpace);
}
} else {
//最后一列
if (isLastColumn(parent, itemPosition, spanCount)) {
// 最后一列最后一行
outRect.set(0, 0, 0, verticalSpace);
} else {
// 最后一列非最后一行
outRect.set(0, 0, horizontalSpace, verticalSpace);
}
}
}
}
}