当前位置: 首页>>代码示例>>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;未经允许,请勿转载。