当前位置: 首页>>代码示例>>Java>>正文


Java BotSwitchCell类代码示例

本文整理汇总了Java中org.telegram.ui.Cells.BotSwitchCell的典型用法代码示例。如果您正苦于以下问题:Java BotSwitchCell类的具体用法?Java BotSwitchCell怎么用?Java BotSwitchCell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BotSwitchCell类属于org.telegram.ui.Cells包,在下文中一共展示了BotSwitchCell类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onBindViewHolder

import org.telegram.ui.Cells.BotSwitchCell; //导入依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    if (searchResultBotContext != null) {
        boolean hasTop = searchResultBotContextSwitch != null;
        if (holder.getItemViewType() == 2) {
            if (hasTop) {
                ((BotSwitchCell) holder.itemView).setText(searchResultBotContextSwitch.text);
            }
        } else {
            if (hasTop) {
                position--;
            }
            ((ContextLinkCell) holder.itemView).setLink(searchResultBotContext.get(position), contextMedia, position != searchResultBotContext.size() - 1, hasTop && position == 0);
        }
    } else {
        if (searchResultUsernames != null) {
            ((MentionCell) holder.itemView).setUser(searchResultUsernames.get(position));
        } else if (searchResultHashtags != null) {
            ((MentionCell) holder.itemView).setText(searchResultHashtags.get(position));
        } else if (searchResultCommands != null) {
            ((MentionCell) holder.itemView).setBotCommand(searchResultCommands.get(position), searchResultCommandsHelp.get(position), searchResultCommandsUsers != null ? searchResultCommandsUsers.get(position) : null);
        }
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:25,代码来源:MentionsAdapter.java

示例2: onBindViewHolder

import org.telegram.ui.Cells.BotSwitchCell; //导入依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    if (holder.getItemViewType() == 3) {
        TextView textView = (TextView) holder.itemView;
        TLRPC.Chat chat = parentFragment.getCurrentChat();
        if (chat != null) {
            if (AndroidUtilities.isBannedForever(chat.banned_rights.until_date)) {
                textView.setText(LocaleController.getString("AttachInlineRestrictedForever", R.string.AttachInlineRestrictedForever));
            } else {
                textView.setText(LocaleController.formatString("AttachInlineRestricted", R.string.AttachInlineRestricted, LocaleController.formatDateForBan(chat.banned_rights.until_date)));
            }
        }
    } else if (searchResultBotContext != null) {
        boolean hasTop = searchResultBotContextSwitch != null;
        if (holder.getItemViewType() == 2) {
            if (hasTop) {
                ((BotSwitchCell) holder.itemView).setText(searchResultBotContextSwitch.text);
            }
        } else {
            if (hasTop) {
                position--;
            }
            ((ContextLinkCell) holder.itemView).setLink(searchResultBotContext.get(position), contextMedia, position != searchResultBotContext.size() - 1, hasTop && position == 0);
        }
    } else {
        if (searchResultUsernames != null) {
            ((MentionCell) holder.itemView).setUser(searchResultUsernames.get(position));
        } else if (searchResultHashtags != null) {
            ((MentionCell) holder.itemView).setText(searchResultHashtags.get(position));
        } else if (searchResultSuggestions != null) {
            ((MentionCell) holder.itemView).setEmojiSuggestion(searchResultSuggestions.get(position));
        } else if (searchResultCommands != null) {
            ((MentionCell) holder.itemView).setBotCommand(searchResultCommands.get(position), searchResultCommandsHelp.get(position), searchResultCommandsUsers != null ? searchResultCommandsUsers.get(position) : null);
        }
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:37,代码来源:MentionsAdapter.java


注:本文中的org.telegram.ui.Cells.BotSwitchCell类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。