private void showMetionUser() { if (mTeamMemberList == null || mTeamMemberList.isEmpty()) return; if (metionUserDialog == null) { metionUserDialog = DialogHelper.getPinterestDialogCancelable(this); metionUserDialog.setTitle("艾特团队成员"); final CharSequence[] toUsers = new CharSequence[mTeamMemberList.size() + 1]; toUsers[0] = "全体成员(all)"; for (int i = 1; i < toUsers.length; i++) { toUsers[i] = mTeamMemberList.get(i - 1).getName(); } metionUserDialog.setItems( toUsers, -1, new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // TODO Auto-generated method st mEtInput .getText() .insert(mEtInput.getSelectionStart(), "@" + toUsers[position] + " "); mEtInput.setSelection(mEtInput.length()); metionUserDialog.dismiss(); } }); } metionUserDialog.show(); }
private void handleSelectPicture() { final CommonDialog dialog = DialogHelper.getPinterestDialogCancelable(this); dialog.setTitle(R.string.choose_picture); dialog.setNegativeButton(R.string.cancle, null); dialog.setItemsWithoutChk( getResources().getStringArray(R.array.choose_picture), new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { dialog.dismiss(); goToSelectPicture(position); } }); dialog.show(); }
private void handleClearWords() { if (TextUtils.isEmpty(mEtInput.getText().toString())) return; final CommonDialog dialog = DialogHelper.getPinterestDialogCancelable(this); dialog.setMessage(R.string.clearwords); dialog.setPositiveButton( R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); mEtInput.getText().clear(); } }); dialog.setNegativeButton(R.string.cancle, null); dialog.show(); }
private void showConfirmExit() { CommonDialog dialog = DialogHelper.getPinterestDialogCancelable(this); dialog.setMessage("是否取消发送动态?"); dialog.setNegativeButton( R.string.cancle, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); dialog.setPositiveButton( R.string.ok, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); finish(); } }); dialog.show(); }