本文整理汇总了Java中org.telegram.messenger.support.widget.RecyclerView.NO_POSITION属性的典型用法代码示例。如果您正苦于以下问题:Java RecyclerView.NO_POSITION属性的具体用法?Java RecyclerView.NO_POSITION怎么用?Java RecyclerView.NO_POSITION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.telegram.messenger.support.widget.RecyclerView
的用法示例。
在下文中一共展示了RecyclerView.NO_POSITION属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateVisibleTrendingSets
private void updateVisibleTrendingSets() {
if (layoutManager == null) {
return;
}
int first = layoutManager.findFirstVisibleItemPosition();
if (first == RecyclerView.NO_POSITION) {
return;
}
int last = layoutManager.findLastVisibleItemPosition();
if (last == RecyclerView.NO_POSITION) {
return;
}
listAdapter.notifyItemRangeChanged(first, last - first + 1);
}
示例2: checkScroll
private void checkScroll() {
int firstVisibleItem = stickersLayoutManager.findFirstVisibleItemPosition();
if (firstVisibleItem == RecyclerView.NO_POSITION) {
return;
}
checkStickersScroll(firstVisibleItem);
}
示例3: checkPanels
private void checkPanels() {
if (stickersTab == null) {
return;
}
if (trendingTabNum == -2 && trendingGridView != null && trendingGridView.getVisibility() == VISIBLE) {
gifsGridView.setVisibility(GONE);
trendingGridView.setVisibility(GONE);
stickersGridView.setVisibility(VISIBLE);
stickersEmptyView.setVisibility(stickersGridAdapter.getItemCount() != 0 ? GONE : VISIBLE);
}
if (gifTabNum == -2 && gifsGridView != null && gifsGridView.getVisibility() == VISIBLE) {
listener.onGifTab(false);
gifsGridView.setVisibility(GONE);
trendingGridView.setVisibility(GONE);
stickersGridView.setVisibility(VISIBLE);
stickersEmptyView.setVisibility(stickersGridAdapter.getItemCount() != 0 ? GONE : VISIBLE);
} else if (gifTabNum != -2) {
if (gifsGridView != null && gifsGridView.getVisibility() == VISIBLE) {
stickersTab.onPageScrolled(gifTabNum + 1, (recentTabBum > 0 ? recentTabBum : stickersTabOffset) + 1);
} else if (trendingGridView != null && trendingGridView.getVisibility() == VISIBLE) {
stickersTab.onPageScrolled(trendingTabNum + 1, (recentTabBum > 0 ? recentTabBum : stickersTabOffset) + 1);
} else {
int position = stickersLayoutManager.findFirstVisibleItemPosition();
if (position != RecyclerView.NO_POSITION) {
stickersTab.onPageScrolled(stickersGridAdapter.getTabForPosition(position) + 1, (recentTabBum > 0 ? recentTabBum : stickersTabOffset) + 1);
}
}
}
}
示例4: updateVisibleTrendingSets
private void updateVisibleTrendingSets() {
int first = trendingLayoutManager.findFirstVisibleItemPosition();
if (first == RecyclerView.NO_POSITION) {
return;
}
int last = trendingLayoutManager.findLastVisibleItemPosition();
if (last == RecyclerView.NO_POSITION) {
return;
}
trendingGridAdapter.notifyItemRangeChanged(first, last - first + 1);
}
示例5: checkPanels
private void checkPanels() {
if (scrollSlidingTabStrip == null) {
return;
}
int position = stickersLayoutManager.findFirstVisibleItemPosition();
if (position != RecyclerView.NO_POSITION) {
scrollSlidingTabStrip.onPageScrolled(stickersGridAdapter.getTabForPosition(position) + 1, (recentTabBum > 0 ? recentTabBum : stickersTabOffset) + 1);
}
}
示例6: checkScrollForLoad
public void checkScrollForLoad(boolean scroll) {
if (chatLayoutManager == null || paused) {
return;
}
int firstVisibleItem = chatLayoutManager.findFirstVisibleItemPosition();
int visibleItemCount = firstVisibleItem == RecyclerView.NO_POSITION ? 0 : Math.abs(chatLayoutManager.findLastVisibleItemPosition() - firstVisibleItem) + 1;
if (visibleItemCount > 0) {
int totalItemCount = chatAdapter.getItemCount();
int checkLoadCount;
if (scroll) {
checkLoadCount = 25;
} else {
checkLoadCount = 5;
}
if (firstVisibleItem <= checkLoadCount && !loading) {
if (!endReached[0]) {
loading = true;
waitingForLoad.add(lastLoadIndex);
if (messagesByDays.size() != 0) {
MessagesController.getInstance().loadMessages(dialog_id, 50, maxMessageId[0], !cacheEndReached[0], minDate[0], classGuid, 0, 0, ChatObject.isChannel(currentChat), lastLoadIndex++);
} else {
MessagesController.getInstance().loadMessages(dialog_id, 50, 0, !cacheEndReached[0], minDate[0], classGuid, 0, 0, ChatObject.isChannel(currentChat), lastLoadIndex++);
}
} else if (mergeDialogId != 0 && !endReached[1]) {
loading = true;
waitingForLoad.add(lastLoadIndex);
MessagesController.getInstance().loadMessages(mergeDialogId, 50, maxMessageId[1], !cacheEndReached[1], minDate[1], classGuid, 0, 0, ChatObject.isChannel(currentChat), lastLoadIndex++);
}
}
if (!loadingForward && firstVisibleItem + visibleItemCount >= totalItemCount - 10) {
if (mergeDialogId != 0 && !forwardEndReached[1]) {
waitingForLoad.add(lastLoadIndex);
MessagesController.getInstance().loadMessages(mergeDialogId, 50, minMessageId[1], true, maxDate[1], classGuid, 1, 0, ChatObject.isChannel(currentChat), lastLoadIndex++);
loadingForward = true;
} else if (!forwardEndReached[0]) {
waitingForLoad.add(lastLoadIndex);
MessagesController.getInstance().loadMessages(dialog_id, 50, minMessageId[0], true, maxDate[0], classGuid, 1, 0, ChatObject.isChannel(currentChat), lastLoadIndex++);
loadingForward = true;
}
}
}
}
示例7: checkScrollForLoad
private void checkScrollForLoad(boolean scroll) {
if (chatLayoutManager == null || paused) {
return;
}
int firstVisibleItem = chatLayoutManager.findFirstVisibleItemPosition();
int visibleItemCount = firstVisibleItem == RecyclerView.NO_POSITION ? 0 : Math.abs(chatLayoutManager.findLastVisibleItemPosition() - firstVisibleItem) + 1;
if (visibleItemCount > 0) {
int totalItemCount = chatAdapter.getItemCount();
int checkLoadCount;
if (scroll) {
checkLoadCount = 25;
} else {
checkLoadCount = 5;
}
if (firstVisibleItem <= checkLoadCount && !loading) {
if (!endReached[0]) {
loading = true;
waitingForLoad.add(lastLoadIndex);
if (messagesByDays.size() != 0) {
MessagesController.getInstance().loadMessages(dialog_id, 50, maxMessageId[0], !cacheEndReached[0], minDate[0], classGuid, 0, 0, ChatObject.isChannel(currentChat), lastLoadIndex++);
} else {
MessagesController.getInstance().loadMessages(dialog_id, 50, 0, !cacheEndReached[0], minDate[0], classGuid, 0, 0, ChatObject.isChannel(currentChat), lastLoadIndex++);
}
} else if (mergeDialogId != 0 && !endReached[1]) {
loading = true;
waitingForLoad.add(lastLoadIndex);
MessagesController.getInstance().loadMessages(mergeDialogId, 50, maxMessageId[1], !cacheEndReached[1], minDate[1], classGuid, 0, 0, ChatObject.isChannel(currentChat), lastLoadIndex++);
}
}
if (!loadingForward && firstVisibleItem + visibleItemCount >= totalItemCount - 10) {
if (mergeDialogId != 0 && !forwardEndReached[1]) {
waitingForLoad.add(lastLoadIndex);
MessagesController.getInstance().loadMessages(mergeDialogId, 50, minMessageId[1], true, maxDate[1], classGuid, 1, 0, ChatObject.isChannel(currentChat), lastLoadIndex++);
loadingForward = true;
} else if (!forwardEndReached[0]) {
waitingForLoad.add(lastLoadIndex);
MessagesController.getInstance().loadMessages(dialog_id, 50, minMessageId[0], true, maxDate[0], classGuid, 1, 0, ChatObject.isChannel(currentChat), lastLoadIndex++);
loadingForward = true;
}
}
}
}