本文整理汇总了Java中com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper类的典型用法代码示例。如果您正苦于以下问题:Java EasyAlertDialogHelper类的具体用法?Java EasyAlertDialogHelper怎么用?Java EasyAlertDialogHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EasyAlertDialogHelper类属于com.netease.nim.uikit.common.ui.dialog包,在下文中一共展示了EasyAlertDialogHelper类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onItemClick
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
@Override
public void onItemClick(final PopupMenuItem item) {
switch (item.getTag()) {
case ACTION_HISTORY_QUERY:
MessageHistoryActivity.start(item.getContext(), item.getSessionId(), item.getSessionTypeEnum()); // 漫游消息查询
break;
case ACTION_SEARCH_MESSAGE:
SearchMessageActivity.start(item.getContext(), item.getSessionId(), item.getSessionTypeEnum());
break;
case ACTION_CLEAR_MESSAGE:
EasyAlertDialogHelper.createOkCancelDiolag(item.getContext(), null, "确定要清空吗?", true, new EasyAlertDialogHelper.OnDialogActionListener() {
@Override
public void doCancelAction() {
}
@Override
public void doOkAction() {
NIMClient.getService(MsgService.class).clearChattingHistory(item.getSessionId(), item.getSessionTypeEnum());
MessageListPanelHelper.getInstance().notifyClearMessages(item.getSessionId());
}
}).show();
break;
}
}
示例2: onParseIntent
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
private void onParseIntent() {
if (getIntent().getBooleanExtra(KICK_OUT, false)) {
int type = NIMClient.getService(AuthService.class).getKickedClientType();
String client;
switch (type) {
case ClientType.Web:
client = "网页端";
break;
case ClientType.Windows:
case ClientType.MAC:
client = "电脑端";
break;
case ClientType.REST:
client = "服务端";
break;
default:
client = "移动端";
break;
}
EasyAlertDialogHelper.showOneButtonDiolag(LoginActivity.this, getString(R.string.kickout_notify),
String.format(getString(R.string.kickout_content), client), getString(R.string.ok), true, null);
}
}
示例3: showReDownloadConfirmDlg
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
private void showReDownloadConfirmDlg(final IMMessage message) {
EasyAlertDialogHelper.OnDialogActionListener listener = new EasyAlertDialogHelper.OnDialogActionListener() {
@Override
public void doCancelAction() {
}
@Override
public void doOkAction() {
// 正常情况收到消息后附件会自动下载。如果下载失败,可调用该接口重新下载
if (message.getAttachment() != null && message.getAttachment() instanceof FileAttachment)
NIMClient.getService(ChatRoomService.class).downloadAttachment((ChatRoomMessage) message, true);
}
};
final EasyAlertDialog dialog = EasyAlertDialogHelper.createOkCancelDiolag(container.activity, null,
container.activity.getString(R.string.repeat_download_message), true, listener);
dialog.show();
}
示例4: initActionBarButton
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
private void initActionBarButton() {
TextView closeSessionBtn = findView(R.id.action_bar_right_clickable_textview);
closeSessionBtn.setText(R.string.close);
closeSessionBtn.setBackgroundResource(R.drawable.nim_message_button_bottom_send_selector);
closeSessionBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EasyAlertDialogHelper.OnDialogActionListener listener = new EasyAlertDialogHelper.OnDialogActionListener() {
@Override
public void doCancelAction() {
}
@Override
public void doOkAction() {
endSession(); // 挂断
}
};
final EasyAlertDialog dialog = EasyAlertDialogHelper.createOkCancelDiolag(RTSActivity.this,
getString(R.string.end_session_tip_head),
getString(R.string.end_session_tip_content),
getString(R.string.ok), getString(R.string.cancel), true, listener);
dialog.show();
}
});
}
示例5: showConfirmButton
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
/**
* 移除群成员确认
*/
private void showConfirmButton() {
EasyAlertDialogHelper.OnDialogActionListener listener = new EasyAlertDialogHelper.OnDialogActionListener() {
@Override
public void doCancelAction() {
}
@Override
public void doOkAction() {
removeMember();
}
};
final EasyAlertDialog dialog = EasyAlertDialogHelper.createOkCancelDiolag(this, null, getString(R.string.team_member_remove_confirm),
getString(R.string.remove), getString(R.string.cancel), true, listener);
dialog.show();
}
示例6: showReDownloadConfirmDlg
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
private void showReDownloadConfirmDlg(final IMMessage message) {
EasyAlertDialogHelper.OnDialogActionListener listener = new EasyAlertDialogHelper.OnDialogActionListener() {
@Override
public void doCancelAction() {
}
@Override
public void doOkAction() {
// 正常情况收到消息后附件会自动下载。如果下载失败,可调用该接口重新下载
if (message.getAttachment() != null && message.getAttachment() instanceof FileAttachment)
NIMClient.getService(MsgService.class).downloadAttachment(message, true);
}
};
final EasyAlertDialog dialog = EasyAlertDialogHelper.createOkCancelDiolag(container.activity, null,
container.activity.getString(R.string.repeat_download_message), true, listener);
dialog.show();
}
示例7: showResendConfirm
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
private void showResendConfirm(final IMMessage message, final int index) {
EasyAlertDialogHelper.OnDialogActionListener listener = new EasyAlertDialogHelper.OnDialogActionListener() {
@Override
public void doCancelAction() {
}
@Override
public void doOkAction() {
resendMessage(message);
}
};
final EasyAlertDialog dialog = EasyAlertDialogHelper.createOkCancelDiolag(container.activity, null,
container.activity.getString(R.string.repeat_send_message), true, listener);
dialog.show();
}
示例8: query
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
private void query() {
DialogMaker.showProgressDialog(this, null, false);
final String account = searchEdit.getText().toString().toLowerCase();
NimUserInfoCache.getInstance().getUserInfoFromRemote(account, new RequestCallback<NimUserInfo>() {
@Override
public void onSuccess(NimUserInfo user) {
DialogMaker.dismissProgressDialog();
if (user == null) {
EasyAlertDialogHelper.showOneButtonDiolag(AddFriendActivity.this, R.string.user_not_exsit,
R.string.user_tips, R.string.ok, false, null);
} else {
UserProfileActivity.start(AddFriendActivity.this, account);
}
}
@Override
public void onFailed(int code) {
DialogMaker.dismissProgressDialog();
if (code == 408) {
Toast.makeText(AddFriendActivity.this, R.string.network_is_not_available, Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(AddFriendActivity.this, "on failed:" + code, Toast.LENGTH_SHORT).show();
}
}
@Override
public void onException(Throwable exception) {
DialogMaker.dismissProgressDialog();
Toast.makeText(AddFriendActivity.this, "on exception:" + exception.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
示例9: onRecordReachedMaxTime
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
@Override
public void onRecordReachedMaxTime(final int maxTime) {
stopAudioRecordAnim();
EasyAlertDialogHelper.createOkCancelDiolag(container.activity, "", container.activity.getString(R.string.recording_max_time), false, new EasyAlertDialogHelper.OnDialogActionListener() {
@Override
public void doCancelAction() {
}
@Override
public void doOkAction() {
audioMessageHelper.handleEndRecord(true, maxTime);
}
}).show();
}
示例10: sendVideo
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
private void sendVideo() {
File convertedFile = new File(filename);
String message = "";
if (convertedFile.exists()) {
int b = (int) convertedFile.length();
int kb = b / 1024;
float mb = kb / 1024f;
message += mb > 1 ? getString(R.string.capture_video_size_in_mb, mb) : getString(
R.string.capture_video_size_in_kb, kb);
message += getString(R.string.is_send_video);
if (mb <= 1 && kb < 10) {
tooShortAlert();
return;
}
}
EasyAlertDialogHelper.OnDialogActionListener listener = new EasyAlertDialogHelper.OnDialogActionListener() {
@Override
public void doCancelAction() {
cancelRecord();
}
@Override
public void doOkAction() {
Intent intent = new Intent();
intent.putExtra("duration", duration);
setResult(RESULT_OK, intent);
finish();
}
};
final EasyAlertDialog dialog = EasyAlertDialogHelper.createOkCancelDiolag(this, null, message, true, listener);
if (!isFinishing() && !destroyed) {
dialog.show();
}
}
示例11: tooShortAlert
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
/**
* 视频录制太短
*/
private void tooShortAlert() {
EasyAlertDialogHelper.showOneButtonDiolag(this, null, getString(R.string.video_record_short), getString(R.string.iknow), true, new OnClickListener() {
@Override
public void onClick(View v) {
cancelRecord();
}
});
}
示例12: onRemoveFriend
import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper; //导入依赖的package包/类
private void onRemoveFriend() {
Log.i(TAG, "onRemoveFriend");
if (!NetworkUtil.isNetAvailable(this)) {
Toast.makeText(UserProfileActivity.this, R.string.network_is_not_available, Toast.LENGTH_SHORT).show();
return;
}
EasyAlertDialog dialog = EasyAlertDialogHelper.createOkCancelDiolag(this, getString(R.string.remove_friend),
getString(R.string.remove_friend_tip), true,
new EasyAlertDialogHelper.OnDialogActionListener() {
@Override
public void doCancelAction() {
}
@Override
public void doOkAction() {
DialogMaker.showProgressDialog(UserProfileActivity.this, "", true);
NIMClient.getService(FriendService.class).deleteFriend(account).setCallback(new RequestCallback<Void>() {
@Override
public void onSuccess(Void param) {
DialogMaker.dismissProgressDialog();
Toast.makeText(UserProfileActivity.this, R.string.remove_friend_success, Toast.LENGTH_SHORT).show();
finish();
}
@Override
public void onFailed(int code) {
DialogMaker.dismissProgressDialog();
if (code == 408) {
Toast.makeText(UserProfileActivity.this, R.string.network_is_not_available, Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(UserProfileActivity.this, "on failed:" + code, Toast.LENGTH_SHORT).show();
}
}
@Override
public void onException(Throwable exception) {
DialogMaker.dismissProgressDialog();
}
});
}
});
if (!isFinishing() && !isDestroyedCompatible()) {
dialog.show();
}
}