當前位置: 首頁>>代碼示例>>Java>>正文


Java RecyclerView.NO_POSITION屬性代碼示例

本文整理匯總了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);
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:14,代碼來源:FeaturedStickersActivity.java

示例2: checkScroll

private void checkScroll() {
    int firstVisibleItem = stickersLayoutManager.findFirstVisibleItemPosition();
    if (firstVisibleItem == RecyclerView.NO_POSITION) {
        return;
    }
    checkStickersScroll(firstVisibleItem);
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:7,代碼來源:EmojiView.java

示例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);
            }
        }
    }
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:29,代碼來源:EmojiView.java

示例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);
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:11,代碼來源:EmojiView.java

示例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);
    }
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:9,代碼來源:StickerMasksView.java

示例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;
            }
        }
    }
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:42,代碼來源:ChatActivity.java

示例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;
            }
        }
    }
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:42,代碼來源:ChatActivity.java


注:本文中的org.telegram.messenger.support.widget.RecyclerView.NO_POSITION屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。