use of com.lingtuan.firefly.listener.RequestListener in project SmartMesh_Android by SmartMeshFoundation.
the class DiscussGroupSettingUI method removeMember.
public void removeMember(final int arg2) {
if (mProgressDialog != null) {
mProgressDialog.dismiss();
mProgressDialog = null;
}
mProgressDialog = LoadingDialog.showDialog(this, null, null);
mProgressDialog.setCancelable(false);
NetRequestImpl.getInstance().removeDiscussMember(showdata.get(arg2).getLocalId(), cid, new RequestListener() {
@Override
public void start() {
}
@Override
public void success(JSONObject response) {
if (mProgressDialog != null) {
mProgressDialog.dismiss();
mProgressDialog = null;
}
showToast(response.optString("msg"));
UserBaseVo user = showdata.get(arg2);
data.remove(user);
showdata.remove(user);
removeMemberChatMsg(user.getShowName());
resetlist();
}
@Override
public void error(int errorCode, String errorMsg) {
if (mProgressDialog != null) {
mProgressDialog.dismiss();
mProgressDialog = null;
}
showToast(errorMsg);
}
});
}
use of com.lingtuan.firefly.listener.RequestListener in project SmartMesh_Android by SmartMeshFoundation.
the class DiscussGroupSettingUI method dissmissDicusss.
private void dissmissDicusss() {
if (mProgressDialog != null) {
mProgressDialog.dismiss();
mProgressDialog = null;
}
mProgressDialog = LoadingDialog.showDialog(this, null, null);
mProgressDialog.setCancelable(false);
NetRequestImpl.getInstance().removeDiscussMember(NextApplication.myInfo.getLocalId(), cid, new RequestListener() {
@Override
public void start() {
}
@Override
public void success(JSONObject response) {
if (mProgressDialog != null) {
mProgressDialog.dismiss();
mProgressDialog = null;
}
showToast(response.optString("msg"));
ChattingManager.getInstance(DiscussGroupSettingUI.this).setFinish(true);
Utils.exitActivityAndBackAnim(DiscussGroupSettingUI.this, true);
FinalUserDataBase.getInstance().deleteChatMsgByChatId("group-" + cid);
}
@Override
public void error(int errorCode, String errorMsg) {
if (mProgressDialog != null) {
mProgressDialog.dismiss();
mProgressDialog = null;
}
showToast(errorMsg);
}
});
}
use of com.lingtuan.firefly.listener.RequestListener in project SmartMesh_Android by SmartMeshFoundation.
the class SelectGroupMemberListUI method loadData.
private void loadData() {
int cid = getIntent().getIntExtra("cid", 0);
NetRequestImpl.getInstance().getDiscussMumbers(cid + "", new RequestListener() {
@Override
public void start() {
}
@Override
public void success(JSONObject response) {
Utils.writeToFile(response, "conversation-get_conversation" + NextApplication.myInfo.getLocalId() + ".json");
parserJson(response);
}
@Override
public void error(int errorCode, String errorMsg) {
}
});
}
use of com.lingtuan.firefly.listener.RequestListener in project SmartMesh_Android by SmartMeshFoundation.
the class BindMobileCodeUI method verifySmsc.
/**
* Verify the message
*/
private void verifySmsc() {
String code = codeEt.getText().toString().trim();
if (TextUtils.isEmpty(code)) {
showToast(getString(R.string.code_number_not_empty));
return;
}
NetRequestImpl.getInstance().verifySmsc(code, phoneNumber, new RequestListener() {
@Override
public void start() {
LoadingDialog.show(BindMobileCodeUI.this, "");
}
@Override
public void success(JSONObject response) {
if (type == 0) {
// Binding mobile phone number
bindMobileMethod();
} else {
// Mobile phone number to retrieve password
Intent intent = new Intent(BindMobileCodeUI.this, RegistUI.class);
intent.putExtra("number", phoneNumber);
intent.putExtra("type", type);
startActivity(intent);
Utils.openNewActivityAnim(BindMobileCodeUI.this, false);
}
}
@Override
public void error(int errorCode, String errorMsg) {
LoadingDialog.close();
showToast(errorMsg);
}
});
}
use of com.lingtuan.firefly.listener.RequestListener in project SmartMesh_Android by SmartMeshFoundation.
the class BindEmailUI method sendSmsc.
/**
* Verify the signature for text messages
*/
private void sendSmsc() {
this.aeskey = Utils.makeRandomKey(16);
final String emailNumber = emailEt.getText().toString().trim();
NetRequestImpl.getInstance().sendMail(aeskey, type == 1 ? 0 : 1, emailNumber, new RequestListener() {
@Override
public void start() {
LoadingDialog.show(BindEmailUI.this, "");
}
@Override
public void success(JSONObject response) {
LoadingDialog.close();
showToast(response.optString("msg"));
Intent intent = new Intent(BindEmailUI.this, BindMobileCodeUI.class);
intent.putExtra("email", emailNumber);
intent.putExtra("type", type);
startActivity(intent);
Utils.openNewActivityAnim(BindEmailUI.this, false);
}
@Override
public void error(int errorCode, String errorMsg) {
LoadingDialog.close();
showToast(errorMsg);
}
});
}
Aggregations