-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
translation ui changes for message chat view and conversation list view #232
base: EaseIMKit
Are you sure you want to change the base?
Conversation
new AlertDialog.Builder(getContext()) | ||
.setTitle("Using Translate") | ||
.setMessage("Each translation can be retranslated only once. The translation provided is for reference only.") | ||
.setPositiveButton("OK", new DialogInterface.OnClickListener() { | ||
public void onClick(DialogInterface dialog, int which) { | ||
messageListLayout.reTranslate(message, targetLanguageCode); | ||
} | ||
}).show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议将此dialog移到demo层,并将相应的文案统一(用中文还是英文?),并修改为资源引用的形式。
public void reTranslate(EMMessage message, String languageCode) { | ||
EMTranslationMessage translationMessage = (EMTranslationMessage) message; | ||
EMMessage parent = translationMessage.getParent(); | ||
translationMessage.clearParent();; | ||
parent.setSubMessage(null); | ||
translateMessage(parent, languageCode); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
相关逻辑是否可以移到EaseChatLayout中的EaseHandleMessagePresenterImpl中?与发送消息等放到一块,方便将来维护。
EMTranslationResult result = EMTranslationManager.getInstance().getTranslationMessage(message.getMsgId()); | ||
if(result.getShowTranslation()) { | ||
EMTranslationMessage translationMessage = EMTranslationMessage.createMessage(message, result); | ||
message.setSubMessage(translationMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDK中是否提供了EMMessage.setSubMessage的接口?
|
||
if(message.subMessage() != null) { | ||
translationContainer.setVisibility(View.VISIBLE); | ||
EMTranslationResult result = ((EMTranslationMessage)message.subMessage()).getTranslationResult(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
核实一下subMessage的逻辑。
No description provided.