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


Java ChatObject.canWriteToChat方法代码示例

本文整理汇总了Java中org.telegram.messenger.ChatObject.canWriteToChat方法的典型用法代码示例。如果您正苦于以下问题:Java ChatObject.canWriteToChat方法的具体用法?Java ChatObject.canWriteToChat怎么用?Java ChatObject.canWriteToChat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.telegram.messenger.ChatObject的用法示例。


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

示例1: updateBottomOverlay

import org.telegram.messenger.ChatObject; //导入方法依赖的package包/类
public void updateBottomOverlay() {
    if (bottomOverlayChatText == null) {
        return;
    }
    if (currentChat != null) {
        if (ChatObject.isChannel(currentChat) && !(currentChat instanceof TLRPC.TL_channelForbidden)) {
            if (ChatObject.isNotInChat(currentChat)) {
                bottomOverlayChatText.setText(LocaleController.getString("ChannelJoin", R.string.ChannelJoin));
            } else {
                if (!MessagesController.getInstance().isDialogMuted(dialog_id)) {
                    bottomOverlayChatText.setText(LocaleController.getString("ChannelMute", R.string.ChannelMute));
                } else {
                    bottomOverlayChatText.setText(LocaleController.getString("ChannelUnmute", R.string.ChannelUnmute));
                }
            }
        } else {
            bottomOverlayChatText.setText(LocaleController.getString("DeleteThisGroup", R.string.DeleteThisGroup));
        }
    } else {
        if (userBlocked) {
            if (currentUser.bot) {
                bottomOverlayChatText.setText(LocaleController.getString("BotUnblock", R.string.BotUnblock));
            } else {
                bottomOverlayChatText.setText(LocaleController.getString("Unblock", R.string.Unblock));
            }
            if (botButtons != null) {
                botButtons = null;
                if (chatActivityEnterView != null) {
                    if (replyingMessageObject != null && botReplyButtons == replyingMessageObject) {
                        botReplyButtons = null;
                        showReplyPanel(false, null, null, null, false, true);
                    }
                    chatActivityEnterView.setButtons(botButtons, false);
                }
            }
        } else if (botUser != null && currentUser.bot) {
            bottomOverlayChatText.setText(LocaleController.getString("BotStart", R.string.BotStart));
            chatActivityEnterView.hidePopup(false);
            if (getParentActivity() != null) {
                AndroidUtilities.hideKeyboard(getParentActivity().getCurrentFocus());
            }
        } else {
            bottomOverlayChatText.setText(LocaleController.getString("DeleteThisChat", R.string.DeleteThisChat));
        }
    }

    if (searchItem != null && searchItem.getVisibility() == View.VISIBLE) {
        searchContainer.setVisibility(View.VISIBLE);
        bottomOverlayChat.setVisibility(View.INVISIBLE);
        chatActivityEnterView.setFieldFocused(false);
        chatActivityEnterView.setVisibility(View.INVISIBLE);
    } else {
        searchContainer.setVisibility(View.INVISIBLE);
        if (currentChat != null && (ChatObject.isNotInChat(currentChat) || !ChatObject.canWriteToChat(currentChat)) ||
                currentUser != null && (UserObject.isDeleted(currentUser) || userBlocked)) {
            bottomOverlayChat.setVisibility(View.VISIBLE);
            muteItem.setVisibility(View.GONE);
            chatActivityEnterView.setFieldFocused(false);
            chatActivityEnterView.setVisibility(View.INVISIBLE);
        } else {
            if (botUser != null && currentUser.bot) {
                bottomOverlayChat.setVisibility(View.VISIBLE);
                chatActivityEnterView.setVisibility(View.INVISIBLE);
            } else {
                chatActivityEnterView.setVisibility(View.VISIBLE);
                bottomOverlayChat.setVisibility(View.INVISIBLE);
            }
            muteItem.setVisibility(View.VISIBLE);
        }
    }
    checkRaiseSensors();
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:73,代码来源:ChatActivity.java


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