|
@@ -2,6 +2,8 @@ package com.wdkl.ncs.android.component.home.util;
|
|
|
|
|
|
import android.app.Activity;
|
|
|
import android.app.AlertDialog;
|
|
|
+import android.content.Intent;
|
|
|
+import android.net.Uri;
|
|
|
import android.telephony.SmsManager;
|
|
|
import android.text.TextUtils;
|
|
|
import android.view.Gravity;
|
|
@@ -33,6 +35,7 @@ public class PhoneNumberDialogHelper {
|
|
|
EditText smsCmd = contentView.findViewById(R.id.edit_sms_cmd);
|
|
|
TextView cancel = contentView.findViewById(R.id.btn_cancel_send);
|
|
|
TextView send = contentView.findViewById(R.id.btn_send);
|
|
|
+ TextView call = contentView.findViewById(R.id.btn_call);
|
|
|
|
|
|
phoneNum.setText("本机号码: " + ContactHelper.getPhoneNumber());
|
|
|
operator.setText(SettingConfig.getOperatorNumber(activity));
|
|
@@ -72,6 +75,22 @@ public class PhoneNumberDialogHelper {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ call.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ String number = operator.getText().toString();
|
|
|
+ if (!TextUtils.isEmpty(number)) {
|
|
|
+ SettingConfig.setOperatorNumber(activity, number);
|
|
|
+
|
|
|
+ Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
|
|
|
+ activity.startActivity(intent);
|
|
|
+
|
|
|
+ Constants.Companion.setSmsCheck(true);
|
|
|
+ dismissCallDialog();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
dialog = builder.create();
|
|
|
dialog.setCanceledOnTouchOutside(false);
|