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


Java EaseAlertDialog类代码示例

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


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

示例1: emptyHistory

import com.hyphenate.easeui.widget.EaseAlertDialog; //导入依赖的package包/类
/**
 * clear the conversation history
 * 
 */
protected void emptyHistory() {
    String msg = getResources().getString(R.string.Whether_to_empty_all_chats);
    new EaseAlertDialog(getActivity(),null, msg, null,new AlertDialogUser() {
        
        @Override
        public void onResult(boolean confirmed, Bundle bundle) {
            if(confirmed){
                if (conversation != null) {
                    conversation.clearAllMessages();
                }
                messageList.refresh();
            }
        }
    }, true).show();
}
 
开发者ID:turoDog,项目名称:KTalk,代码行数:20,代码来源:EaseChatFragment.java

示例2: emptyHistory

import com.hyphenate.easeui.widget.EaseAlertDialog; //导入依赖的package包/类
/**
 * clear the conversation history
 * 
 */
protected void emptyHistory() {
    String msg = getResources().getString(R.string.Whether_to_empty_all_chats);
    new EaseAlertDialog(getActivity(),null, msg, null,new AlertDialogUser() {
        
        @Override
        public void onResult(boolean confirmed, Bundle bundle) {
            if(confirmed){
                if (conversation != null) {
                    conversation.clearAllMessages();
                }
                messageList.refresh();
                haveMoreData = true;
            }
        }
    }, true).show();
}
 
开发者ID:funnyzhaov,项目名称:Tribe,代码行数:21,代码来源:EaseChatFragment.java

示例3: emptyHistory

import com.hyphenate.easeui.widget.EaseAlertDialog; //导入依赖的package包/类
/**
 * 点击清空聊天记录
 * 
 */
protected void emptyHistory() {
    String msg = getResources().getString(R.string.Whether_to_empty_all_chats);
    new EaseAlertDialog(getActivity(),null, msg, null,new AlertDialogUser() {
        
        @Override
        public void onResult(boolean confirmed, Bundle bundle) {
            if(confirmed){
                // 清空会话
            	
                EMClient.getInstance().chatManager().deleteConversation(toChatUsername, true);
                messageList.refresh();
            }
        }
    }, true).show();;
}
 
开发者ID:Rabbit00,项目名称:MeifuGO,代码行数:20,代码来源:EaseChatFragment.java

示例4: onClick

import com.hyphenate.easeui.widget.EaseAlertDialog; //导入依赖的package包/类
@Override
public void onClick(View v) {
	switch (v.getId()) {
	case R.id.clear_all_history: // clear conversation history
		String st9 = getResources().getString(R.string.sure_to_empty_this);
		new EaseAlertDialog(ChatRoomDetailsActivity.this, null, st9, null, new AlertDialogUser() {
               
               @Override
               public void onResult(boolean confirmed, Bundle bundle) {
                   if(confirmed){
                       clearGroupHistory();
                   }
               }
           }, true).show();
		break;

	default:
		break;
	}

}
 
开发者ID:laoduDYM,项目名称:ChatDemoUI3.0,代码行数:22,代码来源:ChatRoomDetailsActivity.java

示例5: searchContact

import com.hyphenate.easeui.widget.EaseAlertDialog; //导入依赖的package包/类
/**
 * search contact
 * @param v
 */
public void searchContact(View v) {
	final String name = editText.getText().toString();
	String saveText = searchBtn.getText().toString();
	
	if (getString(R.string.button_search).equals(saveText)) {
		toAddUsername = name;
		if(TextUtils.isEmpty(name)) {
			new EaseAlertDialog(this, R.string.Please_enter_a_username).show();
			return;
		}
		
		// TODO you can search the user from your app server here.
		
		//show the userame and add button if user exist
		searchedUserLayout.setVisibility(View.VISIBLE);
		nameText.setText(toAddUsername);
		
	} 
}
 
开发者ID:laoduDYM,项目名称:ChatDemoUI3.0,代码行数:24,代码来源:AddContactActivity.java

示例6: onListItemClick

import com.hyphenate.easeui.widget.EaseAlertDialog; //导入依赖的package包/类
@Override
protected void onListItemClick(int position) {
	selectUser = contactAdapter.getItem(position);
	new EaseAlertDialog(this, null, getString(R.string.confirm_forward_to, selectUser.getNick()), null, new AlertDialogUser() {
           @Override
           public void onResult(boolean confirmed, Bundle bundle) {
               if (confirmed) {
                   if (selectUser == null)
                       return;
                   try {
                       ChatActivity.activityInstance.finish();
                   } catch (Exception e) {
                   }
                   Intent intent = new Intent(ForwardMessageActivity.this, ChatActivity.class);
                   // it is single chat
                   intent.putExtra("userId", selectUser.getUsername());
                   intent.putExtra("forward_msg_id", forward_msg_id);
                   startActivity(intent);
                   finish();
               }
           }
       }, true).show();
}
 
开发者ID:laoduDYM,项目名称:ChatDemoUI3.0,代码行数:24,代码来源:ForwardMessageActivity.java

示例7: emptyHistory

import com.hyphenate.easeui.widget.EaseAlertDialog; //导入依赖的package包/类
/**
 * clear the conversation history
 * 
 */
protected void emptyHistory() {
    String msg = getResources().getString(R.string.Whether_to_empty_all_chats);
    new EaseAlertDialog(getActivity(),null, msg, null,new AlertDialogUser() {
        
        @Override
        public void onResult(boolean confirmed, Bundle bundle) {
            if(confirmed){
                EMClient.getInstance().chatManager().deleteConversation(toChatUsername, true);
                messageList.refresh();
            }
        }
    }, true).show();
}
 
开发者ID:Vicent9920,项目名称:FanChat,代码行数:18,代码来源:EaseChatFragment.java

示例8: emptyHistory

import com.hyphenate.easeui.widget.EaseAlertDialog; //导入依赖的package包/类
/**
 * clear the conversation history
 * 
 */
protected void emptyHistory() {
    String msg = getResources().getString(R.string.Whether_to_empty_all_chats);
    new EaseAlertDialog(getActivity(),null, msg, null,new AlertDialogUser() {
        
        @Override
        public void onResult(boolean confirmed, Bundle bundle) {
            if(confirmed){
                EMClient.getInstance().chatManager().deleteConversation(toChatUsername, true);
                messageList.refresh();
            }
        }
    }, true).show();;
}
 
开发者ID:HyphenateInc,项目名称:Hyphenate-EaseUI-Android,代码行数:18,代码来源:EaseChatFragment.java

示例9: onClick

import com.hyphenate.easeui.widget.EaseAlertDialog; //导入依赖的package包/类
@Override
public void onClick(View v) {
	switch (v.getId()) {
	case R.id.rl_switch_block_groupmsg: // 屏蔽或取消屏蔽群组
		toggleBlockGroup();
		break;

	case R.id.clear_all_history: // 清空聊天记录
		String st9 = getResources().getString(R.string.sure_to_empty_this);
		new EaseAlertDialog(GroupDetailsActivity.this, null, st9, null, new AlertDialogUser() {
               
               @Override
               public void onResult(boolean confirmed, Bundle bundle) {
                   if(confirmed){
                       clearGroupHistory();
                   }
               }
           }, true).show();
		
		break;

	case R.id.rl_blacklist: // 黑名单列表
		startActivity(new Intent(GroupDetailsActivity.this, GroupBlacklistActivity.class).putExtra("groupId", groupId));
		break;

	case R.id.rl_change_group_name:
		startActivityForResult(new Intent(this, EditActivity.class).putExtra("data", group.getGroupName()), REQUEST_CODE_EDIT_GROUPNAME);
		break;
	case R.id.rl_search:
           startActivity(new Intent(this, GroupSearchMessageActivity.class).putExtra("groupId", groupId));
           
           break;
	default:
		break;
	}

}
 
开发者ID:laoduDYM,项目名称:ChatDemoUI3.0,代码行数:38,代码来源:GroupDetailsActivity.java

示例10: save

import com.hyphenate.easeui.widget.EaseAlertDialog; //导入依赖的package包/类
/**
 * @param v
 */
public void save(View v) {
	String name = groupNameEditText.getText().toString();
	if (TextUtils.isEmpty(name)) {
	    new EaseAlertDialog(this, R.string.Group_name_cannot_be_empty).show();
	} else {
		// select from contact list
		startActivityForResult(new Intent(this, GroupPickContactsActivity.class).putExtra("groupName", name), 0);
	}
}
 
开发者ID:laoduDYM,项目名称:ChatDemoUI3.0,代码行数:13,代码来源:NewGroupActivity.java

示例11: addContact

import com.hyphenate.easeui.widget.EaseAlertDialog; //导入依赖的package包/类
/**
 *  add contact
 * @param view
 */
public void addContact(View view){
	if(EMClient.getInstance().getCurrentUser().equals(nameText.getText().toString())){
		new EaseAlertDialog(this, R.string.not_add_myself).show();
		return;
	}
	
	if(DemoHelper.getInstance().getContactList().containsKey(nameText.getText().toString())){
	    //let the user know the contact already in your contact list
	    if(EMClient.getInstance().contactManager().getBlackListUsernames().contains(nameText.getText().toString())){
	        new EaseAlertDialog(this, R.string.user_already_in_contactlist).show();
	        return;
	    }
		new EaseAlertDialog(this, R.string.This_user_is_already_your_friend).show();
		return;
	}
	
	progressDialog = new ProgressDialog(this);
	String stri = getResources().getString(R.string.Is_sending_a_request);
	progressDialog.setMessage(stri);
	progressDialog.setCanceledOnTouchOutside(false);
	progressDialog.show();
	
	new Thread(new Runnable() {
		public void run() {
			
			try {
				//demo use a hardcode reason here, you need let user to input if you like
				String s = getResources().getString(R.string.Add_a_friend);
				EMClient.getInstance().contactManager().addContact(toAddUsername, s);
				runOnUiThread(new Runnable() {
					public void run() {
						progressDialog.dismiss();
						String s1 = getResources().getString(R.string.send_successful);
						Toast.makeText(getApplicationContext(), s1, 1).show();
					}
				});
			} catch (final Exception e) {
				runOnUiThread(new Runnable() {
					public void run() {
						progressDialog.dismiss();
						String s2 = getResources().getString(R.string.Request_add_buddy_failure);
						Toast.makeText(getApplicationContext(), s2 + e.getMessage(), 1).show();
					}
				});
			}
		}
	}).start();
}
 
开发者ID:laoduDYM,项目名称:ChatDemoUI3.0,代码行数:53,代码来源:AddContactActivity.java


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