本文整理匯總了Java中android.support.v7.widget.RecyclerView.getBottom方法的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerView.getBottom方法的具體用法?Java RecyclerView.getBottom怎麽用?Java RecyclerView.getBottom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.widget.RecyclerView
的用法示例。
在下文中一共展示了RecyclerView.getBottom方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawBackbackground
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void drawBackbackground(Canvas c, RecyclerView parent) {
int childCount = parent.getChildCount();
int left=0;
int right=screenWidth;
int top=0;
int bottom=parent.getBottom();
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
Object tagObj=child.getTag(R.id.short_menu_bottom);
if (tagObj != null) {
boolean tag= (boolean) tagObj;
if (tag) {
bottom=child.getBottom()+Math.round(ViewCompat.getTranslationY(child));
}
}
}
mDivider.setBounds(left, top, right, bottom);
mDivider.draw(c);
}
示例2: rvPaddingMatcher
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private ViewHolderMatcher<RecyclerView.ViewHolder> rvPaddingMatcher() {
return new ViewHolderMatcher<RecyclerView.ViewHolder>() {
@Override
public boolean matches(RecyclerView parent, View itemView, RecyclerView.ViewHolder viewHolder) {
int expectedPadding = parent.getPaddingBottom();
int bottom = layoutManager.getDecoratedBottom(itemView);
int parentBottom = parent.getBottom();
int padding = parentBottom - bottom;
assertEquals("padding of RecyclerView item doesn't equal expected padding" ,expectedPadding, padding);
return true;
}
};
}