Compare commits
14 Commits
56485ff0dd
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| f4c6060cbc | |||
| 7961a6b462 | |||
| 3b28584e4c | |||
| eb6c7ddab8 | |||
| de8bf0b61c | |||
| 38b701a4ea | |||
| a90f8bf59c | |||
| 52a82c50ab | |||
| 29f2f2f7ef | |||
| 74928e6e49 | |||
| b0704fee96 | |||
| 124518a570 | |||
| 2ce5beace4 | |||
| ad03559dac |
BIN
Keystore/coolapeKeyStore.keystore
Normal file
18
app/release/output-metadata.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"artifactType": {
|
||||||
|
"type": "APK",
|
||||||
|
"kind": "Directory"
|
||||||
|
},
|
||||||
|
"applicationId": "com.tianrun.siphone",
|
||||||
|
"variantName": "processReleaseResources",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "SINGLE",
|
||||||
|
"filters": [],
|
||||||
|
"versionCode": 1,
|
||||||
|
"versionName": "1.0",
|
||||||
|
"outputFile": "app-release.apk"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
app/release/视频对讲指挥系统20210420.apk
Normal file
@@ -3,7 +3,12 @@ package com.tianrun.sipcall;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.media.Ringtone;
|
||||||
|
import android.media.RingtoneManager;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
|
||||||
import com.tianrun.sipcall.call.CallMediaUtils;
|
import com.tianrun.sipcall.call.CallMediaUtils;
|
||||||
import com.tianrun.sipcall.call.InCallActivity;
|
import com.tianrun.sipcall.call.InCallActivity;
|
||||||
@@ -117,6 +122,7 @@ public class SipEngine implements BluetelInterface {
|
|||||||
this.ip = ip;
|
this.ip = ip;
|
||||||
this.port = port;
|
this.port = port;
|
||||||
myBluetelEngine.Register(name, pw, ip, port);
|
myBluetelEngine.Register(name, pw, ip, port);
|
||||||
|
isRelogin = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -132,6 +138,7 @@ public class SipEngine implements BluetelInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void AccountState(String uri, boolean state) {
|
public void AccountState(String uri, boolean state) {
|
||||||
|
if(isRelogin) return;
|
||||||
logmy.e(uri + "-->" + state);
|
logmy.e(uri + "-->" + state);
|
||||||
if (state) {
|
if (state) {
|
||||||
if (!onLine) {
|
if (!onLine) {
|
||||||
@@ -150,12 +157,11 @@ public class SipEngine implements BluetelInterface {
|
|||||||
}, null);
|
}, null);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(!onLine && !isRelogin) {
|
if(!onLine) {
|
||||||
UIUtl.toastI("Sip登陆失败");
|
UIUtl.toastI("Sip登陆失败");
|
||||||
ActivityMgr.sendMsg(CONS.LOGINFAILED, null);
|
ActivityMgr.sendMsg(CONS.LOGINFAILED, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isRelogin = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMeetingCall(String phoneNo) {
|
public boolean isMeetingCall(String phoneNo) {
|
||||||
@@ -171,7 +177,7 @@ public class SipEngine implements BluetelInterface {
|
|||||||
int calltype = isVideo == false ? 0 : 1;
|
int calltype = isVideo == false ? 0 : 1;
|
||||||
String state = isVideo == true ? "视频来电" : "音频来电";
|
String state = isVideo == true ? "视频来电" : "音频来电";
|
||||||
callPagesConfig.add(new InCallUtils(incomingNumber, isHolder, isVideo, rPort, lPort, incomingNumber, state, false, 0, callid));
|
callPagesConfig.add(new InCallUtils(incomingNumber, isHolder, isVideo, rPort, lPort, incomingNumber, state, false, 0, callid));
|
||||||
GoToInCall(App.getContext(), incomingNumber, "来电", calltype, callid);
|
GoToInCall(App.getContext(), incomingNumber, "来电", calltype, callid, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -219,8 +225,13 @@ public class SipEngine implements BluetelInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void NotifyCallMediaState(int callid, int r, int l, int payload) {
|
public void NotifyCallMediaState(int callid, int r, int l, int payload) {
|
||||||
logmy.e("NotifyCallMediaState" + callid + "<>" + r + "<>" + l + "<>" + payload);
|
logmy.e("NotifyCallMediaState=========" + callid + "<>" + r + "<>" + l + "<>" + payload);
|
||||||
ActivityMgr.sendMsg(CONS.MEDIASTATE, new CallMediaUtils(callid, payload, r, l));
|
ActivityMgr.topActivity.handler.postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
ActivityMgr.sendMsg(CONS.MEDIASTATE, new CallMediaUtils(callid, payload, r, l));
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -240,8 +251,10 @@ public class SipEngine implements BluetelInterface {
|
|||||||
* @param calltype
|
* @param calltype
|
||||||
* @param callid
|
* @param callid
|
||||||
*/
|
*/
|
||||||
public void GoToInCall(Context context, String callnumber, String callstate, int calltype, int callid) {
|
public void GoToInCall(Context context, String callnumber, String callstate, int calltype, int callid, boolean selfCall) {
|
||||||
Intent intent = null;
|
Intent intent = null;
|
||||||
|
|
||||||
|
logmy.e("GoToInCall==============" + isMeetingCall(callnumber) +"==="+ System.currentTimeMillis());
|
||||||
if (isMeetingCall(callnumber)) {
|
if (isMeetingCall(callnumber)) {
|
||||||
intent = new Intent(context, InCallMeetingActivity.class);
|
intent = new Intent(context, InCallMeetingActivity.class);
|
||||||
} else {
|
} else {
|
||||||
@@ -252,6 +265,7 @@ public class SipEngine implements BluetelInterface {
|
|||||||
bundle.putString("callnumber", callnumber);
|
bundle.putString("callnumber", callnumber);
|
||||||
bundle.putString("callstate", callstate);
|
bundle.putString("callstate", callstate);
|
||||||
bundle.putInt("calltype", calltype);
|
bundle.putInt("calltype", calltype);
|
||||||
|
bundle.putBoolean("selfCall", selfCall);
|
||||||
intent.putExtras(bundle);
|
intent.putExtras(bundle);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
@@ -265,9 +279,10 @@ public class SipEngine implements BluetelInterface {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int CallNumber(String number, boolean isVideo) {
|
public int CallNumber(String number, boolean isVideo) {
|
||||||
int callid = myBluetelEngine.CallNumber(number, ip, port, isVideo);
|
|
||||||
int calltype = isVideo ? 0 : 1;
|
int calltype = isVideo ? 0 : 1;
|
||||||
GoToInCall(App.getContext(), number, "呼叫中", calltype, callid);
|
int callid = myBluetelEngine.CallNumber(number, ip, port, isVideo);
|
||||||
|
GoToInCall(App.getContext(), number, "呼叫中", calltype, callid, true);
|
||||||
|
|
||||||
callPagesConfig.add(new InCallUtils(number, false, isVideo, 0, 0, number, "呼叫中", false, 0, callid));
|
callPagesConfig.add(new InCallUtils(number, false, isVideo, 0, 0, number, "呼叫中", false, 0, callid));
|
||||||
return callid;
|
return callid;
|
||||||
}
|
}
|
||||||
@@ -314,5 +329,25 @@ public class SipEngine implements BluetelInterface {
|
|||||||
return myBluetelEngine.Holder(isHolder, callid);
|
return myBluetelEngine.Holder(isHolder, callid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 播放系统默认来电铃声
|
||||||
|
*
|
||||||
|
* @return MediaPlayer对象
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public Ringtone PlaydefaultCallMediaPlayer(Context context) {
|
||||||
|
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
|
||||||
|
Ringtone r = RingtoneManager.getRingtone(context, notification);
|
||||||
|
r.play();
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
public void StopdefaultCallMediaPlayer(Ringtone r) {
|
||||||
|
// Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
|
||||||
|
// Ringtone r = RingtoneManager.getRingtone(context, notification);
|
||||||
|
// r.stop();
|
||||||
|
if(r != null) {
|
||||||
|
r.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ public class CreateGroupActivity extends TrBaseActivity {
|
|||||||
|
|
||||||
users.clear();
|
users.clear();
|
||||||
mapUsers.clear();
|
mapUsers.clear();
|
||||||
|
users.add(DBUser.mySelf);
|
||||||
|
mapUsers.put(DBUser.mySelf.phone, DBUser.mySelf);
|
||||||
|
|
||||||
DBUser u = new DBUser("", "添加分机号", "");
|
DBUser u = new DBUser("", "添加分机号", "");
|
||||||
u.isAddFlag = true;
|
u.isAddFlag = true;
|
||||||
users.add(u);
|
users.add(u);
|
||||||
@@ -161,7 +164,7 @@ public class CreateGroupActivity extends TrBaseActivity {
|
|||||||
for (DBUser u : DBUser.allUser) {
|
for (DBUser u : DBUser.allUser) {
|
||||||
if (mapUsers.get(u.phone) == null) {
|
if (mapUsers.get(u.phone) == null) {
|
||||||
listPhone.add(u.phone);
|
listPhone.add(u.phone);
|
||||||
list.add(u.phone + " | " + u.name);
|
list.add(u.phone + " " + u.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(list.size() == 0) {
|
if(list.size() == 0) {
|
||||||
@@ -215,10 +218,18 @@ public class CreateGroupActivity extends TrBaseActivity {
|
|||||||
str = str + us.phone + ",";
|
str = str + us.phone + ",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(str.length() > 0) {
|
||||||
|
str = str.substring(0, str.length() - 1);
|
||||||
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createGroup(View view) {
|
public void createGroup(View view) {
|
||||||
|
String name = meetingTopic.getText().toString();
|
||||||
|
if(name == null || name.isEmpty()) {
|
||||||
|
UIUtl.toastI("分组名不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
String userStr = getSelectedUsers();
|
String userStr = getSelectedUsers();
|
||||||
if (userStr == null || userStr == "") {
|
if (userStr == null || userStr == "") {
|
||||||
UIUtl.toastI("请添加要加入会议的分机号");
|
UIUtl.toastI("请添加要加入会议的分机号");
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import com.tianrun.sipcall.ui.TrAdapter;
|
|||||||
import com.tianrun.sipcall.ui.TrBaseActivity;
|
import com.tianrun.sipcall.ui.TrBaseActivity;
|
||||||
import com.tianrun.sipcall.ui.UIUtl;
|
import com.tianrun.sipcall.ui.UIUtl;
|
||||||
import com.tianrun.sipcall.utils.HttpUtl;
|
import com.tianrun.sipcall.utils.HttpUtl;
|
||||||
|
import com.tianrun.sipcall.utils.logmy;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -59,6 +60,8 @@ public class CreateMeetingActivity extends TrBaseActivity {
|
|||||||
|
|
||||||
users.clear();
|
users.clear();
|
||||||
mapUsers.clear();
|
mapUsers.clear();
|
||||||
|
users.add(DBUser.mySelf);
|
||||||
|
mapUsers.put(DBUser.mySelf.phone, DBUser.mySelf);
|
||||||
DBUser u = new DBUser("", "添加分机号", "");
|
DBUser u = new DBUser("", "添加分机号", "");
|
||||||
u.isAddFlag = true;
|
u.isAddFlag = true;
|
||||||
users.add(u);
|
users.add(u);
|
||||||
@@ -174,13 +177,13 @@ public class CreateMeetingActivity extends TrBaseActivity {
|
|||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
List<String> listPhone = new ArrayList<>();
|
List<String> listPhone = new ArrayList<>();
|
||||||
for (DBUser u : DBUser.allUser) {
|
for (DBUser u : DBUser.allUser) {
|
||||||
if (mapUsers.get(u.phone) == null) {
|
if (mapUsers.get(u.phone) == null && u.isOnline()) { // 只有空闲的才加入
|
||||||
listPhone.add(u.phone);
|
listPhone.add(u.phone);
|
||||||
list.add(u.phone + " | " + u.name);
|
list.add(u.phone + " " + u.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(list.size() == 0) {
|
if(list.size() == 0) {
|
||||||
UIUtl.toastI("所有分机已经添加");
|
UIUtl.toastI("所有空闲分机已经添加");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,6 +237,9 @@ public class CreateMeetingActivity extends TrBaseActivity {
|
|||||||
str = str + us.phone + ",";
|
str = str + us.phone + ",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(str.length() > 0) {
|
||||||
|
str = str.substring(0, str.length() - 1);
|
||||||
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,20 +258,23 @@ public class CreateMeetingActivity extends TrBaseActivity {
|
|||||||
UIUtl.toastI("请添加要加入会议的分机号");
|
UIUtl.toastI("请添加要加入会议的分机号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logmy.e("createMeeting==============" + System.currentTimeMillis());
|
||||||
QMUITipDialog dialog = UIUtl.toastLoading("");
|
QMUITipDialog dialog = UIUtl.toastLoading("");
|
||||||
Net.createMeeting(meetingTopic.getText().toString(), meetingDesc.getText().toString(), userStr, new HttpUtl.CallBack() {
|
Net.createMeeting(meetingTopic.getText().toString(), meetingDesc.getText().toString(), userStr, new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
JSONObject jo = JSONObject.parseObject(result);
|
// JSONObject jo = JSONObject.parseObject(result);
|
||||||
if (jo != null) {
|
// if (jo != null) {
|
||||||
String code = "";
|
// String code = "";
|
||||||
if(isVideo) {
|
// if(isVideo) {
|
||||||
code = jo.getString("video_code");
|
// code = jo.getString("video_code");
|
||||||
} else {
|
// } else {
|
||||||
code = jo.getString("audio_code");
|
// code = jo.getString("audio_code");
|
||||||
}
|
// }
|
||||||
SipEngine.getInstance().CallNumber(code, isVideo);
|
// SipEngine.getInstance().CallNumber(code, isVideo);
|
||||||
}
|
// }
|
||||||
|
// UIUtl.toastS("临时会议创建成功");
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.app.Activity;
|
|||||||
import android.app.KeyguardManager;
|
import android.app.KeyguardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.media.Ringtone;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
@@ -60,8 +61,10 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
private String callnumber = "未知";
|
private String callnumber = "未知";
|
||||||
private String callstate = "未知";
|
private String callstate = "未知";
|
||||||
private int calltype = 0; //0音频1视频
|
private int calltype = 0; //0音频1视频
|
||||||
|
private boolean selfCall = false;
|
||||||
private boolean VIDEOSTATE = false;
|
private boolean VIDEOSTATE = false;
|
||||||
public static Intent incallIntent;
|
public static Intent incallIntent;
|
||||||
|
private Ringtone ringtone;
|
||||||
|
|
||||||
public String[] screenTyps = {"经典模式", "均分模式", "远程全屏", "本地全屏"};
|
public String[] screenTyps = {"经典模式", "均分模式", "远程全屏", "本地全屏"};
|
||||||
|
|
||||||
@@ -185,17 +188,35 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
if (callstate.equals("来电")) {
|
if (callstate.equals("来电")) {
|
||||||
incall_answer.setVisibility(View.VISIBLE);
|
incall_answer.setVisibility(View.VISIBLE);
|
||||||
|
ringtone = SipEngine.getInstance().PlaydefaultCallMediaPlayer(this);
|
||||||
} else {
|
} else {
|
||||||
incall_answer.setVisibility(View.GONE);
|
incall_answer.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
show.setText(callnumber + callstate);
|
show.setText(callnumber + callstate);
|
||||||
if (incall_answer.getVisibility() == View.VISIBLE) {
|
if (incall_answer.getVisibility() == View.VISIBLE){
|
||||||
incall_answer.setVisibility(View.GONE);
|
if(selfCall) {
|
||||||
SipEngine.getInstance().answer(callid);
|
// incall_answer.setVisibility(View.GONE);
|
||||||
|
// SipEngine.getInstance().answer(callid);
|
||||||
|
// SipEngine.getInstance().StopdefaultCallMediaPlayer(ringtone);
|
||||||
|
// ringtone = null;
|
||||||
|
answer();
|
||||||
|
} else {
|
||||||
|
AutoAnwser();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void AutoAnwser() {
|
||||||
|
handler_CallActivity.postDelayed(doAutoAnwser, 5000);
|
||||||
|
}
|
||||||
|
static Runnable doAutoAnwser = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
CONS.SENDMESSAGETO(handler_CallActivity, -2, null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
@@ -206,7 +227,10 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
stopVideoStream(true);
|
stopVideoStream(true);
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
SipEngine.getInstance().StopdefaultCallMediaPlayer(ringtone);
|
||||||
|
ringtone = null;
|
||||||
SipEngine.getInstance().hangup(callid);
|
SipEngine.getInstance().hangup(callid);
|
||||||
|
handler_CallActivity.removeCallbacks(doAutoAnwser);
|
||||||
handler_CallActivity = null;
|
handler_CallActivity = null;
|
||||||
if (wakeLock != null) {
|
if (wakeLock != null) {
|
||||||
wakeLock.release();
|
wakeLock.release();
|
||||||
@@ -223,6 +247,7 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
callnumber = bundle.getString("callnumber");
|
callnumber = bundle.getString("callnumber");
|
||||||
callstate = bundle.getString("callstate");
|
callstate = bundle.getString("callstate");
|
||||||
calltype = bundle.getInt("calltype");
|
calltype = bundle.getInt("calltype");
|
||||||
|
selfCall = bundle.getBoolean("selfCall");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -240,6 +265,9 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handleMessage(Message m) {
|
public boolean handleMessage(Message m) {
|
||||||
switch (m.what) {
|
switch (m.what) {
|
||||||
|
case CONS.ONGETCALLID:
|
||||||
|
callid = (int)m.obj;
|
||||||
|
break;
|
||||||
case CONS.CALLSTATE:
|
case CONS.CALLSTATE:
|
||||||
callstate = (String) m.obj;
|
callstate = (String) m.obj;
|
||||||
show.setText(callnumber + callstate);
|
show.setText(callnumber + callstate);
|
||||||
@@ -267,6 +295,9 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
stopVideoStream(true);
|
stopVideoStream(true);
|
||||||
finish();
|
finish();
|
||||||
break;
|
break;
|
||||||
|
case -2:
|
||||||
|
answer();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -326,12 +357,23 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.incall_answer:
|
case R.id.incall_answer:
|
||||||
incall_answer.setVisibility(View.GONE);
|
// incall_answer.setVisibility(View.GONE);
|
||||||
SipEngine.getInstance().answer(callid);
|
// SipEngine.getInstance().answer(callid);
|
||||||
|
// SipEngine.getInstance().StopdefaultCallMediaPlayer(ringtone);
|
||||||
|
// ringtone = null;
|
||||||
|
answer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void answer() {
|
||||||
|
incall_answer.setVisibility(View.GONE);
|
||||||
|
SipEngine.getInstance().answer(callid);
|
||||||
|
SipEngine.getInstance().StopdefaultCallMediaPlayer(ringtone);
|
||||||
|
ringtone = null;
|
||||||
|
handler_CallActivity.removeCallbacks(doAutoAnwser);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void ShowVideoView(boolean show) {
|
public void ShowVideoView(boolean show) {
|
||||||
if (show) {
|
if (show) {
|
||||||
|
|||||||
@@ -2,17 +2,18 @@ package com.tianrun.sipcall.call;
|
|||||||
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.KeyguardManager;
|
import android.app.KeyguardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.media.Ringtone;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import android.os.PowerManager.WakeLock;
|
import android.os.PowerManager.WakeLock;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -39,10 +40,8 @@ import com.qmuiteam.qmui.widget.tab.QMUITabIndicator;
|
|||||||
import com.qmuiteam.qmui.widget.tab.QMUITabSegment;
|
import com.qmuiteam.qmui.widget.tab.QMUITabSegment;
|
||||||
import com.tianrun.sipcall.R;
|
import com.tianrun.sipcall.R;
|
||||||
import com.tianrun.sipcall.SipEngine;
|
import com.tianrun.sipcall.SipEngine;
|
||||||
import com.tianrun.sipcall.db.DBGroup;
|
|
||||||
import com.tianrun.sipcall.db.DBUser;
|
import com.tianrun.sipcall.db.DBUser;
|
||||||
import com.tianrun.sipcall.db.UserMeetingViews;
|
import com.tianrun.sipcall.db.UserMeetingViews;
|
||||||
import com.tianrun.sipcall.db.UserViews;
|
|
||||||
import com.tianrun.sipcall.net.Net;
|
import com.tianrun.sipcall.net.Net;
|
||||||
import com.tianrun.sipcall.ui.TrAdapter;
|
import com.tianrun.sipcall.ui.TrAdapter;
|
||||||
import com.tianrun.sipcall.ui.TrBaseActivity;
|
import com.tianrun.sipcall.ui.TrBaseActivity;
|
||||||
@@ -70,6 +69,8 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
private SMPercentFrameLayout remoteRenderLayout;
|
private SMPercentFrameLayout remoteRenderLayout;
|
||||||
private ImageButton incall_answer, incall_hangup;
|
private ImageButton incall_answer, incall_hangup;
|
||||||
private View imageButtonAddUser;
|
private View imageButtonAddUser;
|
||||||
|
ImageButton incall_mute;
|
||||||
|
ImageButton incall_muteVideo;
|
||||||
private TextView show;
|
private TextView show;
|
||||||
GridView gridUser;
|
GridView gridUser;
|
||||||
QMUITabSegment mTabSegment;
|
QMUITabSegment mTabSegment;
|
||||||
@@ -82,8 +83,13 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
private String callnumber = "未知";
|
private String callnumber = "未知";
|
||||||
private String callstate = "未知";
|
private String callstate = "未知";
|
||||||
private int calltype = 0; //0音频1视频
|
private int calltype = 0; //0音频1视频
|
||||||
|
private boolean selfCall = false;
|
||||||
private boolean VIDEOSTATE = false;
|
private boolean VIDEOSTATE = false;
|
||||||
public static Intent incallIntent;
|
public static Intent incallIntent;
|
||||||
|
private Ringtone ringtone;
|
||||||
|
|
||||||
|
|
||||||
|
private boolean isinited = false;
|
||||||
|
|
||||||
TrAdapter adapterUser;
|
TrAdapter adapterUser;
|
||||||
|
|
||||||
@@ -142,16 +148,39 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
KeyguardManager.KeyguardLock kl = km.newKeyguardLock("unLock");
|
KeyguardManager.KeyguardLock kl = km.newKeyguardLock("unLock");
|
||||||
kl.disableKeyguard();
|
kl.disableKeyguard();
|
||||||
initview();
|
initview();
|
||||||
|
|
||||||
|
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||||
|
imageButtonAddUser.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
imageButtonAddUser.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
incallIntent = getIntent();
|
incallIntent = getIntent();
|
||||||
setDate(this.getIntent());
|
setDate(this.getIntent());
|
||||||
|
|
||||||
allUsers.clear();
|
allUsers.clear();
|
||||||
setUsers();
|
setUsers();
|
||||||
getMembers();
|
|
||||||
initTabAndPager();
|
initTabAndPager();
|
||||||
|
mTabSegment.setVisibility(View.INVISIBLE);
|
||||||
|
// getMembers();
|
||||||
|
getMemberTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void getMemberTimer() {
|
||||||
|
if(handler_CallActivity != null) {
|
||||||
|
handler_CallActivity.postDelayed(getMemberRunner, 2000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static Runnable getMemberRunner = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
CONS.SENDMESSAGETO(handler_CallActivity, -1, null);
|
||||||
|
getMemberTimer();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private void initview() {
|
private void initview() {
|
||||||
|
if(isinited) return;
|
||||||
|
isinited = true;
|
||||||
View view = findViewById(R.id.IncallMeetingRoot);
|
View view = findViewById(R.id.IncallMeetingRoot);
|
||||||
gridUser = view.findViewById(R.id.GridUser);
|
gridUser = view.findViewById(R.id.GridUser);
|
||||||
show = (TextView) findViewById(R.id.show);
|
show = (TextView) findViewById(R.id.show);
|
||||||
@@ -164,16 +193,19 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
remoteRender = (SMSurfaceViewRenderer) findViewById(R.id.remote_video_view);
|
remoteRender = (SMSurfaceViewRenderer) findViewById(R.id.remote_video_view);
|
||||||
localRenderLayout = (SMPercentFrameLayout) findViewById(R.id.local_video_layout);
|
localRenderLayout = (SMPercentFrameLayout) findViewById(R.id.local_video_layout);
|
||||||
remoteRenderLayout = (SMPercentFrameLayout) findViewById(R.id.remote_video_layout);
|
remoteRenderLayout = (SMPercentFrameLayout) findViewById(R.id.remote_video_layout);
|
||||||
|
logmy.e("new EngineServer============================" + System.currentTimeMillis());
|
||||||
engineServer = new EngineServer(localRender, remoteRender, localRenderLayout, remoteRenderLayout, true);
|
engineServer = new EngineServer(localRender, remoteRender, localRenderLayout, remoteRenderLayout, true);
|
||||||
|
|
||||||
|
incall_mute = findViewById(R.id.incall_mute);
|
||||||
|
incall_mute.setOnClickListener(this);
|
||||||
|
incall_muteVideo = findViewById(R.id.incall_muteVideo);
|
||||||
|
incall_muteVideo.setOnClickListener(this);
|
||||||
|
incall_mute.setVisibility(View.INVISIBLE);
|
||||||
|
incall_muteVideo.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
mTabSegment = findViewById(R.id.ScreenType);
|
mTabSegment = findViewById(R.id.ScreenType);
|
||||||
mContentViewPager = findViewById(R.id.contentViewPager);
|
mContentViewPager = findViewById(R.id.contentViewPager);
|
||||||
imageButtonAddUser = findViewById(R.id.imageButtonAddUser);
|
imageButtonAddUser = findViewById(R.id.imageButtonAddUser);
|
||||||
if (DBUser.mySelf.isManager) {
|
|
||||||
imageButtonAddUser.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
imageButtonAddUser.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initTabAndPager() {
|
private void initTabAndPager() {
|
||||||
@@ -253,6 +285,8 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
} else {
|
} else {
|
||||||
views = (UserMeetingViews) (prefabView.getTag());
|
views = (UserMeetingViews) (prefabView.getTag());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
views.memberStatus3.setVisibility(View.GONE);
|
||||||
DBUser d = (DBUser) data;
|
DBUser d = (DBUser) data;
|
||||||
views.textViewName.setText(d.name);
|
views.textViewName.setText(d.name);
|
||||||
views.textViewNum.setText(d.phone);
|
views.textViewNum.setText(d.phone);
|
||||||
@@ -272,14 +306,33 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
views.imageViewPhoneIcon.setVisibility(View.VISIBLE);
|
views.imageViewPhoneIcon.setVisibility(View.VISIBLE);
|
||||||
views.imageViewAddflag.setVisibility(View.INVISIBLE);
|
views.imageViewAddflag.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (d.isMute) {
|
||||||
|
views.memberStatus1.setImageResource(R.drawable.mute);
|
||||||
|
} else {
|
||||||
|
views.memberStatus1.setImageResource(R.drawable.unmute);
|
||||||
|
}
|
||||||
|
if (VIDEOSTATE) {
|
||||||
|
views.memberStatus2.setVisibility(View.VISIBLE);
|
||||||
|
if (d.isVMute) {
|
||||||
|
views.memberStatus2.setImageResource(R.drawable.unvideo);
|
||||||
|
} else {
|
||||||
|
views.memberStatus2.setImageResource(R.drawable.video);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
views.memberStatus2.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clickCallback(Object data, AdapterView<?> parent, View view, int position, long id) {
|
public void clickCallback(Object data, AdapterView<?> parent, View view, int position, long id) {
|
||||||
if (!DBUser.mySelf.isManager) {
|
if (DBUser.mySelf == null || !DBUser.mySelf.isManager) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DBUser d = (DBUser) data;
|
DBUser d = (DBUser) data;
|
||||||
|
if(d.isOffline()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
QMUIQuickAction qa = QMUIPopups.quickAction(InCallMeetingActivity.this,
|
QMUIQuickAction qa = QMUIPopups.quickAction(InCallMeetingActivity.this,
|
||||||
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56),
|
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56),
|
||||||
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56))
|
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56))
|
||||||
@@ -287,55 +340,15 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
.dimAmount(0.5f)
|
.dimAmount(0.5f)
|
||||||
.skinManager(QMUISkinManager.defaultInstance(InCallMeetingActivity.this))
|
.skinManager(QMUISkinManager.defaultInstance(InCallMeetingActivity.this))
|
||||||
.edgeProtection(QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 20));
|
.edgeProtection(QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 20));
|
||||||
if (DBUser.mySelf.isManager) {
|
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||||
if (d.isMute) {
|
if(d.isBusy()) {
|
||||||
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("取消禁言").onClick(
|
if (d.isMute) {
|
||||||
new QMUIQuickAction.OnClickListener() {
|
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.unmute).text("取消禁言").onClick(
|
||||||
@Override
|
|
||||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
|
||||||
quickAction.dismiss();
|
|
||||||
Net.unmuteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
|
||||||
@Override
|
|
||||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
|
||||||
getMembers();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRequestError(int cmd, String result, Object orgs) {
|
|
||||||
}
|
|
||||||
}, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
));
|
|
||||||
} else {
|
|
||||||
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("禁言").onClick(
|
|
||||||
new QMUIQuickAction.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
|
||||||
quickAction.dismiss();
|
|
||||||
Net.muteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
|
||||||
@Override
|
|
||||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
|
||||||
getMembers();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRequestError(int cmd, String result, Object orgs) {
|
|
||||||
}
|
|
||||||
}, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (VIDEOSTATE) {
|
|
||||||
if (d.isVMute) {
|
|
||||||
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("回复视频").onClick(
|
|
||||||
new QMUIQuickAction.OnClickListener() {
|
new QMUIQuickAction.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
quickAction.dismiss();
|
quickAction.dismiss();
|
||||||
Net.unvmuteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
Net.unmuteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
getMembers();
|
getMembers();
|
||||||
@@ -349,12 +362,12 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("停止视频").onClick(
|
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.mute).text("禁言").onClick(
|
||||||
new QMUIQuickAction.OnClickListener() {
|
new QMUIQuickAction.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
quickAction.dismiss();
|
quickAction.dismiss();
|
||||||
Net.vmuteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
Net.muteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
getMembers();
|
getMembers();
|
||||||
@@ -369,27 +382,48 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d.isLayout) {
|
if (VIDEOSTATE) {
|
||||||
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("恢复布局").onClick(
|
if (d.isVMute) {
|
||||||
new QMUIQuickAction.OnClickListener() {
|
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.video).text("恢复视频").onClick(
|
||||||
@Override
|
new QMUIQuickAction.OnClickListener() {
|
||||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
@Override
|
||||||
quickAction.dismiss();
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
Net.vidlayoutMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
quickAction.dismiss();
|
||||||
@Override
|
Net.unvmuteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
@Override
|
||||||
getMembers();
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
}
|
getMembers();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRequestError(int cmd, String result, Object orgs) {
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
}
|
}
|
||||||
}, null);
|
}, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
));
|
||||||
));
|
} else {
|
||||||
} else {
|
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.unvideo).text("停止视频").onClick(
|
||||||
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("切换布局").onClick(
|
new QMUIQuickAction.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
|
quickAction.dismiss();
|
||||||
|
Net.vmuteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
getMembers();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.fullscreen).text("主界面").onClick(
|
||||||
new QMUIQuickAction.OnClickListener() {
|
new QMUIQuickAction.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
@@ -408,30 +442,55 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("移除").onClick(
|
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("移除").onClick(
|
||||||
new QMUIQuickAction.OnClickListener() {
|
new QMUIQuickAction.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
quickAction.dismiss();
|
quickAction.dismiss();
|
||||||
QMUITipDialog dialog = UIUtl.toastLoading("");
|
QMUITipDialog dialog = UIUtl.toastLoading("");
|
||||||
Net.kickMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
Net.kickMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
UIUtl.toastS("移除分机成功");
|
UIUtl.toastS("移除分机成功");
|
||||||
getMembers();
|
getMembers();
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRequestError(int cmd, String result, Object orgs) {
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
}, null);
|
}, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
));
|
||||||
));
|
} else if (d.isOnline()) {
|
||||||
|
//空闲的可以加入进来
|
||||||
|
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.add).text("加入会议").onClick(
|
||||||
|
new QMUIQuickAction.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
|
quickAction.dismiss();
|
||||||
|
QMUITipDialog dialog = UIUtl.toastLoading("");
|
||||||
|
Net.addMember2Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
UIUtl.toastS("加入会议成功");
|
||||||
|
getMembers();
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
qa.show(view);
|
qa.show(view);
|
||||||
}
|
}
|
||||||
@@ -454,17 +513,44 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
if (callstate.equals("来电")) {
|
if (callstate.equals("来电")) {
|
||||||
incall_answer.setVisibility(View.VISIBLE);
|
incall_answer.setVisibility(View.VISIBLE);
|
||||||
|
incall_mute.setVisibility(View.GONE);
|
||||||
|
incall_muteVideo.setVisibility(View.GONE);
|
||||||
|
ringtone = SipEngine.getInstance().PlaydefaultCallMediaPlayer(this);
|
||||||
} else {
|
} else {
|
||||||
incall_answer.setVisibility(View.GONE);
|
incall_answer.setVisibility(View.GONE);
|
||||||
|
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||||
|
incall_mute.setVisibility(View.VISIBLE);
|
||||||
|
if (VIDEOSTATE) {
|
||||||
|
incall_muteVideo.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
incall_muteVideo.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
show.setText(callnumber + callstate);
|
show.setText(callnumber + callstate);
|
||||||
//控件显示号码,来电,去电,通话中...
|
//控件显示号码,来电,去电,通话中...
|
||||||
if (incall_answer.getVisibility() == View.VISIBLE) {
|
if (incall_answer.getVisibility() == View.VISIBLE ) {
|
||||||
incall_answer.setVisibility(View.GONE);
|
if(selfCall) {
|
||||||
SipEngine.getInstance().answer(callid);
|
// incall_answer.setVisibility(View.GONE);
|
||||||
|
// SipEngine.getInstance().answer(callid);
|
||||||
|
// SipEngine.getInstance().StopdefaultCallMediaPlayer(ringtone);
|
||||||
|
// ringtone = null;
|
||||||
|
answer();
|
||||||
|
} else {
|
||||||
|
AutoAnwser();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
static void AutoAnwser() {
|
||||||
|
handler_CallActivity.postDelayed(doAutoAnwser, 5000);
|
||||||
|
}
|
||||||
|
static Runnable doAutoAnwser = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
CONS.SENDMESSAGETO(handler_CallActivity, -2, null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
@@ -476,12 +562,17 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
stopVideoStream(true);
|
stopVideoStream(true);
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
SipEngine.getInstance().StopdefaultCallMediaPlayer(ringtone);
|
||||||
|
ringtone = null;
|
||||||
SipEngine.getInstance().hangup(callid);
|
SipEngine.getInstance().hangup(callid);
|
||||||
|
handler_CallActivity.removeCallbacks(getMemberRunner);
|
||||||
|
handler_CallActivity.removeCallbacks(doAutoAnwser);
|
||||||
handler_CallActivity = null;
|
handler_CallActivity = null;
|
||||||
if (wakeLock != null) {
|
if (wakeLock != null) {
|
||||||
wakeLock.release();
|
wakeLock.release();
|
||||||
wakeLock = null;
|
wakeLock = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -493,6 +584,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
callnumber = bundle.getString("callnumber");
|
callnumber = bundle.getString("callnumber");
|
||||||
callstate = bundle.getString("callstate");
|
callstate = bundle.getString("callstate");
|
||||||
calltype = bundle.getInt("calltype");
|
calltype = bundle.getInt("calltype");
|
||||||
|
selfCall = bundle.getBoolean("selfCall");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -502,6 +594,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
*/
|
*/
|
||||||
public synchronized void stopVideoStream(boolean isExit) {
|
public synchronized void stopVideoStream(boolean isExit) {
|
||||||
if (VIDEOSTATE && engineServer != null) {
|
if (VIDEOSTATE && engineServer != null) {
|
||||||
|
logmy.e("stopVideoStream============================" + System.currentTimeMillis());
|
||||||
engineServer.stopVideoStream(isExit);
|
engineServer.stopVideoStream(isExit);
|
||||||
VIDEOSTATE = false;
|
VIDEOSTATE = false;
|
||||||
}
|
}
|
||||||
@@ -510,6 +603,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
@Override
|
@Override
|
||||||
public boolean handleMessage(Message m) {
|
public boolean handleMessage(Message m) {
|
||||||
switch (m.what) {
|
switch (m.what) {
|
||||||
|
case CONS.ONGETCALLID:
|
||||||
|
callid = (int)m.obj;
|
||||||
|
break;
|
||||||
case CONS.CALLSTATE:
|
case CONS.CALLSTATE:
|
||||||
callstate = (String) m.obj;
|
callstate = (String) m.obj;
|
||||||
show.setText(callnumber + callstate);
|
show.setText(callnumber + callstate);
|
||||||
@@ -524,10 +620,12 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
int l = utils.getL();
|
int l = utils.getL();
|
||||||
int payload = utils.getPayload();
|
int payload = utils.getPayload();
|
||||||
if (r != 0 || l != 0) {
|
if (r != 0 || l != 0) {
|
||||||
|
mTabSegment.setVisibility(View.VISIBLE);
|
||||||
//开始视频
|
//开始视频
|
||||||
ShowVideoView(true);
|
ShowVideoView(true);
|
||||||
startVideoStream(SipEngine.getInstance().getip(), r, l, payload);
|
startVideoStream(SipEngine.getInstance().getip(), r, l, payload);
|
||||||
} else {
|
} else {
|
||||||
|
mTabSegment.setVisibility(View.INVISIBLE);
|
||||||
//开始音频
|
//开始音频
|
||||||
stopVideoStream(false);
|
stopVideoStream(false);
|
||||||
ShowVideoView(false);
|
ShowVideoView(false);
|
||||||
@@ -540,6 +638,12 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
case Net
|
case Net
|
||||||
.CMD_getGroupMenbers:
|
.CMD_getGroupMenbers:
|
||||||
break;
|
break;
|
||||||
|
case -1:
|
||||||
|
getMembers();
|
||||||
|
break;
|
||||||
|
case -2:
|
||||||
|
answer();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -563,7 +667,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
c = 0;
|
c = 0;
|
||||||
logmy.e(callnumber + "--" + server + "--" + rport + "--" + lport);
|
logmy.e("startVideoStream=============="+ callnumber + "--" + server + "--" + rport + "--" + lport +"====" + System.currentTimeMillis());
|
||||||
if (engineServer != null) {
|
if (engineServer != null) {
|
||||||
ShowVideoView(true);
|
ShowVideoView(true);
|
||||||
/*
|
/*
|
||||||
@@ -585,6 +689,11 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
*/
|
*/
|
||||||
engineServer.startVideoStream(this, server, rport, lport, payload, BitRate, FrameRate, w, h, c, true);
|
engineServer.startVideoStream(this, server, rport, lport, payload, BitRate, FrameRate, w, h, c, true);
|
||||||
VIDEOSTATE = true;
|
VIDEOSTATE = true;
|
||||||
|
|
||||||
|
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||||
|
incall_mute.setVisibility(View.VISIBLE);
|
||||||
|
incall_muteVideo.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -599,12 +708,120 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.incall_answer:
|
case R.id.incall_answer:
|
||||||
incall_answer.setVisibility(View.GONE);
|
answer();
|
||||||
SipEngine.getInstance().answer(callid);
|
break;
|
||||||
|
case R.id.incall_mute:
|
||||||
|
muteAll(v);
|
||||||
|
break;
|
||||||
|
case R.id.incall_muteVideo:
|
||||||
|
videomuteAll(v);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void answer() {
|
||||||
|
incall_answer.setVisibility(View.GONE);
|
||||||
|
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||||
|
incall_mute.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
SipEngine.getInstance().answer(callid);
|
||||||
|
SipEngine.getInstance().StopdefaultCallMediaPlayer(ringtone);
|
||||||
|
ringtone = null;
|
||||||
|
handler_CallActivity.removeCallbacks(doAutoAnwser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void muteAll(View view) {
|
||||||
|
QMUIQuickAction qa = QMUIPopups.quickAction(InCallMeetingActivity.this,
|
||||||
|
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56),
|
||||||
|
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56))
|
||||||
|
.shadow(true)
|
||||||
|
.dimAmount(0.5f)
|
||||||
|
.skinManager(QMUISkinManager.defaultInstance(InCallMeetingActivity.this))
|
||||||
|
.edgeProtection(QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 20));
|
||||||
|
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.mute).text("全部禁言").onClick(
|
||||||
|
new QMUIQuickAction.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
|
quickAction.dismiss();
|
||||||
|
Net.muteMember4Group(callnumber, "all", new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
getMembers();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
));
|
||||||
|
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.unmute).text("取消禁言").onClick(
|
||||||
|
new QMUIQuickAction.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
|
quickAction.dismiss();
|
||||||
|
Net.unmuteMember4Group(callnumber, "all", new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
getMembers();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
));
|
||||||
|
qa.show(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void videomuteAll(View view) {
|
||||||
|
QMUIQuickAction qa = QMUIPopups.quickAction(InCallMeetingActivity.this,
|
||||||
|
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56),
|
||||||
|
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56))
|
||||||
|
.shadow(true)
|
||||||
|
.dimAmount(0.5f)
|
||||||
|
.skinManager(QMUISkinManager.defaultInstance(InCallMeetingActivity.this))
|
||||||
|
.edgeProtection(QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 20));
|
||||||
|
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.unvideo).text("全部关闭").onClick(
|
||||||
|
new QMUIQuickAction.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
|
quickAction.dismiss();
|
||||||
|
Net.vmuteMember4Group(callnumber, "all", new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
getMembers();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
));
|
||||||
|
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.video).text("全部恢复").onClick(
|
||||||
|
new QMUIQuickAction.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
|
quickAction.dismiss();
|
||||||
|
Net.unvmuteMember4Group(callnumber, "all", new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
getMembers();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
));
|
||||||
|
qa.show(view);
|
||||||
|
}
|
||||||
|
|
||||||
public void ShowVideoView(boolean show) {
|
public void ShowVideoView(boolean show) {
|
||||||
if (show) {
|
if (show) {
|
||||||
@@ -633,9 +850,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
List<String> listPhone = new ArrayList<>();
|
List<String> listPhone = new ArrayList<>();
|
||||||
for (DBUser u : DBUser.allUser) {
|
for (DBUser u : DBUser.allUser) {
|
||||||
if (!containMember(u.phone)) {
|
if (!containMember(u.phone) || u.isOnline()) {
|
||||||
listPhone.add(u.phone);
|
listPhone.add(u.phone);
|
||||||
list.add(u.phone + " | " + u.name);
|
list.add(u.phone + " " + u.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
@@ -672,6 +889,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
String phNum = listPhone.get(selectIndexs[i]);
|
String phNum = listPhone.get(selectIndexs[i]);
|
||||||
members = members + phNum + ",";
|
members = members + phNum + ",";
|
||||||
}
|
}
|
||||||
|
if(members.length() > 0) {
|
||||||
|
members = members.substring(0, members.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
Net.addMember2Group(callnumber, members, new HttpUtl.CallBack() {
|
Net.addMember2Group(callnumber, members, new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
package com.tianrun.sipcall.db;
|
package com.tianrun.sipcall.db;
|
||||||
|
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class DBGroup {
|
public class DBGroup {
|
||||||
public DBHead head;
|
public DBHead head;
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package com.tianrun.sipcall.db;
|
package com.tianrun.sipcall.db;
|
||||||
|
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.tianrun.sipcall.net.Net;
|
import com.tianrun.sipcall.net.Net;
|
||||||
@@ -19,6 +23,7 @@ public class DBRoot {
|
|||||||
case Net.CMD_getGroupMenbers:
|
case Net.CMD_getGroupMenbers:
|
||||||
JSONObject o = JSONObject.parseObject(content);
|
JSONObject o = JSONObject.parseObject(content);
|
||||||
DBGroup.onGetGroupMembers(o);
|
DBGroup.onGetGroupMembers(o);
|
||||||
|
DBUser.onGetGroupMembers(o);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.tianrun.sipcall.db;
|
package com.tianrun.sipcall.db;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -18,12 +19,16 @@ public class DBUser {
|
|||||||
public String name = "";
|
public String name = "";
|
||||||
public String phone = "";
|
public String phone = "";
|
||||||
public String status = "";
|
public String status = "";
|
||||||
public boolean isManager = false;
|
public int groupOrder = 0;
|
||||||
|
public int priority = 0;
|
||||||
|
public boolean isManager = true;
|
||||||
public boolean isAddFlag = false;
|
public boolean isAddFlag = false;
|
||||||
|
|
||||||
public boolean isMute = false;
|
public boolean isMute = false;
|
||||||
public boolean isVMute = false;
|
public boolean isVMute = false;
|
||||||
public boolean isLayout = false;
|
public boolean isLayout = false;
|
||||||
|
public boolean isEmpty = false;
|
||||||
|
private static final String TAG = "DBUser";
|
||||||
|
|
||||||
public DBUser(String name, String phone, String status) {
|
public DBUser(String name, String phone, String status) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -31,15 +36,33 @@ public class DBUser {
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DBUser () {
|
||||||
|
}
|
||||||
|
|
||||||
public DBUser(JSONObject d) {
|
public DBUser(JSONObject d) {
|
||||||
this.name = d.getString("name");
|
try {
|
||||||
this.phone = d.getString("extn");
|
this.name = d.getString("name");
|
||||||
this.status = d.getString("sip_state");
|
this.phone = d.getString("extn");
|
||||||
String weight = d.getString("weight");
|
this.status = d.getString("sip_state");
|
||||||
if(weight != null) {
|
status = status == null ? "" : status;
|
||||||
this.isManager = weight.equals("1");
|
String weight = d.getString("weight");
|
||||||
} else {
|
if (weight != null) {
|
||||||
this.isManager = false;
|
this.isManager = weight.equals("1") ? true : false;
|
||||||
|
} else {
|
||||||
|
this.isManager = false;
|
||||||
|
}
|
||||||
|
String ifMute = d.getString("ifMute");
|
||||||
|
this.isMute = ifMute != null ? ifMute.equals("true") : false;
|
||||||
|
String ifVMute = d.getString("ifVMute");
|
||||||
|
this.isVMute = ifVMute != null ? ifVMute.equals("true") : false;
|
||||||
|
|
||||||
|
String _groupOrder = d.getString("group_order");
|
||||||
|
this.groupOrder = _groupOrder != null ? Integer.parseInt(_groupOrder) : 0;
|
||||||
|
String _priority = d.getString("priority");
|
||||||
|
this.priority = _priority != null ? Integer.parseInt(_priority) : 0;
|
||||||
|
isEmpty = false;
|
||||||
|
} catch (Exception e){
|
||||||
|
Log.i(TAG, "onRequestComplete: " + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,16 +81,54 @@ public class DBUser {
|
|||||||
public static void onGetUsers(JSONArray array) {
|
public static void onGetUsers(JSONArray array) {
|
||||||
allUser.clear();
|
allUser.clear();
|
||||||
DBUser u;
|
DBUser u;
|
||||||
|
int cellSize = 5;
|
||||||
|
int oldGroupOrder = -1;
|
||||||
for (Object o : array) {
|
for (Object o : array) {
|
||||||
u = new DBUser((JSONObject) o);
|
u = new DBUser((JSONObject) o);
|
||||||
|
if(oldGroupOrder >= 0 && oldGroupOrder != u.groupOrder) {
|
||||||
|
//需要分组
|
||||||
|
int yushu = allUser.size() % cellSize;
|
||||||
|
if(yushu > 0){
|
||||||
|
yushu = cellSize - yushu;
|
||||||
|
for (int i=0;i<yushu;i++){
|
||||||
|
DBUser _u = new DBUser();
|
||||||
|
_u.isEmpty = true;
|
||||||
|
allUser.add(_u);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
oldGroupOrder = u.groupOrder;
|
||||||
allUser.add(u);
|
allUser.add(u);
|
||||||
mapUsers.put(u.phone, u);
|
mapUsers.put(u.phone, u);
|
||||||
if (mySelf != null && u.phone == mySelf.phone) {
|
if (mySelf != null && u.phone.equals(mySelf.phone)) {
|
||||||
mySelf = u;
|
mySelf = u;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void refreshUser(DBUser user) {
|
||||||
|
for(int i=0; i < allUser.size();i++) {
|
||||||
|
DBUser u = allUser.get(i);
|
||||||
|
if(u.phone.equals(user.phone)) {
|
||||||
|
allUser.set(i, user);
|
||||||
|
mapUsers.put(user.phone, user);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
allUser.add(user);
|
||||||
|
mapUsers.put(user.phone, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onGetGroupMembers(JSONObject content) {
|
||||||
|
DBGroup group = new DBGroup();
|
||||||
|
group.head = new DBHead(content);
|
||||||
|
JSONArray array = content.getJSONArray("members_msg");
|
||||||
|
for (Object o : array) {
|
||||||
|
DBUser u = new DBUser((JSONObject) o);
|
||||||
|
refreshUser(u);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static DBUser getUser(String phoneNo) {
|
public static DBUser getUser(String phoneNo) {
|
||||||
return mapUsers.get(phoneNo);
|
return mapUsers.get(phoneNo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class LoginActivity extends TrBaseActivity {
|
public class LoginActivity extends TrBaseActivity {
|
||||||
private TextView show;
|
private TextView show;
|
||||||
private EditText username, userpw, userip, userport;
|
private EditText username, userpw, userip, userport, httpHost, httpPort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号密码服务器地址端口直接在这输入
|
* 账号密码服务器地址端口直接在这输入
|
||||||
@@ -54,6 +54,8 @@ public class LoginActivity extends TrBaseActivity {
|
|||||||
private String pw = "";
|
private String pw = "";
|
||||||
private int port = 0;
|
private int port = 0;
|
||||||
private String ip = "";
|
private String ip = "";
|
||||||
|
private String http_ip = "";
|
||||||
|
private int http_port = 0;
|
||||||
QMUITipDialog dialogLoading;
|
QMUITipDialog dialogLoading;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -65,6 +67,8 @@ public class LoginActivity extends TrBaseActivity {
|
|||||||
userpw = findViewById(R.id.userpw);
|
userpw = findViewById(R.id.userpw);
|
||||||
userip = findViewById(R.id.userip);
|
userip = findViewById(R.id.userip);
|
||||||
userport = findViewById(R.id.userport);
|
userport = findViewById(R.id.userport);
|
||||||
|
httpHost = findViewById(R.id.http_host);
|
||||||
|
httpPort = findViewById(R.id.http_port);
|
||||||
if (Build.VERSION.SDK_INT >= 23) {//6.0才用动态权限
|
if (Build.VERSION.SDK_INT >= 23) {//6.0才用动态权限
|
||||||
initPermission();
|
initPermission();
|
||||||
}
|
}
|
||||||
@@ -75,7 +79,11 @@ public class LoginActivity extends TrBaseActivity {
|
|||||||
username.setText(obj.getString("name"));
|
username.setText(obj.getString("name"));
|
||||||
userpw.setText(obj.getString("password"));
|
userpw.setText(obj.getString("password"));
|
||||||
userip.setText(obj.getString("ip"));
|
userip.setText(obj.getString("ip"));
|
||||||
userport.setText(obj.getInteger("port").toString());
|
Integer port = obj.getInteger("port");
|
||||||
|
userport.setText(port == null? "" : port.toString());
|
||||||
|
httpHost.setText(obj.getString("http_ip"));
|
||||||
|
port = obj.getInteger("http_port");
|
||||||
|
httpPort.setText(port == null? "" : port.toString());
|
||||||
|
|
||||||
handler.postDelayed(new Runnable() {
|
handler.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -100,6 +108,10 @@ public class LoginActivity extends TrBaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
if(dialogLoading != null) {
|
||||||
|
dialogLoading.dismiss();
|
||||||
|
dialogLoading = null;
|
||||||
|
}
|
||||||
if (InCallActivity.handler_CallActivity != null) {
|
if (InCallActivity.handler_CallActivity != null) {
|
||||||
startActivity(InCallActivity.incallIntent);
|
startActivity(InCallActivity.incallIntent);
|
||||||
return;
|
return;
|
||||||
@@ -122,9 +134,13 @@ public class LoginActivity extends TrBaseActivity {
|
|||||||
public void doLogin() {
|
public void doLogin() {
|
||||||
if (SipEngine.getInstance().isonLine())
|
if (SipEngine.getInstance().isonLine())
|
||||||
return;
|
return;
|
||||||
if (!isEnable())
|
if (!isEnable()) {
|
||||||
|
UIUtl.toastI("请填写完整的设置信息");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
dialogLoading = UIUtl.toastLoading("");
|
dialogLoading = UIUtl.toastLoading("");
|
||||||
|
Net.ip = http_ip;
|
||||||
|
Net.port = http_port;
|
||||||
SipEngine.getInstance().init();//先初始化
|
SipEngine.getInstance().init();//先初始化
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -143,6 +159,8 @@ public class LoginActivity extends TrBaseActivity {
|
|||||||
boolean b = false;
|
boolean b = false;
|
||||||
boolean c = false;
|
boolean c = false;
|
||||||
boolean d = false;
|
boolean d = false;
|
||||||
|
boolean e = false;
|
||||||
|
boolean f = false;
|
||||||
if (username.getText().toString() != null && !username.getText().toString().equals("")) {
|
if (username.getText().toString() != null && !username.getText().toString().equals("")) {
|
||||||
name = username.getText().toString();
|
name = username.getText().toString();
|
||||||
a = true;
|
a = true;
|
||||||
@@ -160,7 +178,16 @@ public class LoginActivity extends TrBaseActivity {
|
|||||||
d = true;
|
d = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return a && b && c && d;
|
if (httpHost.getText().toString() != null && !httpHost.getText().toString().equals("")) {
|
||||||
|
http_ip = httpHost.getText().toString();
|
||||||
|
e = true;
|
||||||
|
}
|
||||||
|
if (httpPort.getText().toString() != null && !httpPort.getText().toString().equals("")) {
|
||||||
|
http_port = Integer.parseInt(httpPort.getText().toString());
|
||||||
|
f = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return a && b && c && d && e && f;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,12 +202,18 @@ public class LoginActivity extends TrBaseActivity {
|
|||||||
jo.put("password", password);
|
jo.put("password", password);
|
||||||
jo.put("ip", ip);
|
jo.put("ip", ip);
|
||||||
jo.put("port", port);
|
jo.put("port", port);
|
||||||
|
jo.put("http_ip", http_ip);
|
||||||
|
jo.put("http_port", http_port);
|
||||||
SharedPreferences sp = getSharedPreferences("UserInfor", MODE_PRIVATE);
|
SharedPreferences sp = getSharedPreferences("UserInfor", MODE_PRIVATE);
|
||||||
sp.edit().putString("content", jo.toJSONString()).commit();
|
sp.edit().putString("content", jo.toJSONString()).commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
|
if(dialogLoading != null) {
|
||||||
|
dialogLoading.dismiss();
|
||||||
|
dialogLoading = null;
|
||||||
|
}
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,17 +227,19 @@ public class LoginActivity extends TrBaseActivity {
|
|||||||
case CONS.LOGINFAILED:
|
case CONS.LOGINFAILED:
|
||||||
if(dialogLoading != null) {
|
if(dialogLoading != null) {
|
||||||
dialogLoading.dismiss();
|
dialogLoading.dismiss();
|
||||||
|
dialogLoading = null;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CONS.LOGIN:
|
case CONS.LOGIN:
|
||||||
if(dialogLoading != null) {
|
if(dialogLoading != null) {
|
||||||
dialogLoading.dismiss();
|
dialogLoading.dismiss();
|
||||||
|
dialogLoading = null;
|
||||||
}
|
}
|
||||||
if (isEnable()) {
|
if (isEnable()) {
|
||||||
saveUserInfor(this.name, this.pw, this.ip, this.port);
|
saveUserInfor(this.name, this.pw, this.ip, this.port);
|
||||||
}
|
}
|
||||||
startActivity(new Intent(this, MainActivity.class));
|
|
||||||
DBUser.mySelf = new DBUser("", this.name, "true");
|
DBUser.mySelf = new DBUser("", this.name, "true");
|
||||||
|
startActivity(new Intent(this, MainActivity.class));
|
||||||
finish();
|
finish();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -344,7 +379,7 @@ public class LoginActivity extends TrBaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void exit2(View view) {
|
public void exit2(View view) {
|
||||||
Net.login(this.name, this.pw, new HttpUtl.CallBack() {
|
Net.login("5503", "!@#123Qw", new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
ActivityMgr.sendMsg(CONS.LOGIN, null);
|
ActivityMgr.sendMsg(CONS.LOGIN, null);
|
||||||
|
|||||||
@@ -4,10 +4,13 @@ import android.content.Context;
|
|||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.os.ParcelUuid;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
@@ -18,6 +21,7 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.viewpager.widget.PagerAdapter;
|
import androidx.viewpager.widget.PagerAdapter;
|
||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
|
|
||||||
@@ -56,6 +60,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class MainActivity extends TrBaseActivity {
|
public class MainActivity extends TrBaseActivity {
|
||||||
|
public static Handler mainHandler;
|
||||||
TextView textVolum;
|
TextView textVolum;
|
||||||
TextView textSelfNum;
|
TextView textSelfNum;
|
||||||
QMUITabSegment mTabSegment;
|
QMUITabSegment mTabSegment;
|
||||||
@@ -70,7 +75,9 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
AudioManager audioManager;
|
AudioManager audioManager;
|
||||||
ImageView buttonAddVol;
|
ImageView buttonAddVol;
|
||||||
ImageView buttonDelVol;
|
ImageView buttonDelVol;
|
||||||
DBHead currSelectData;
|
public static DBHead currSelectData;
|
||||||
|
ImageView imageViewSelfStatus;
|
||||||
|
TextView textViewSelfStatus;
|
||||||
|
|
||||||
GridView gridUser;
|
GridView gridUser;
|
||||||
List<Object> allUsers = new ArrayList<>();
|
List<Object> allUsers = new ArrayList<>();
|
||||||
@@ -119,6 +126,8 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
textVolum = findViewById(R.id.Volumne);
|
textVolum = findViewById(R.id.Volumne);
|
||||||
textSelfNum = findViewById(R.id.textViewSelfNum);
|
textSelfNum = findViewById(R.id.textViewSelfNum);
|
||||||
|
imageViewSelfStatus = findViewById(R.id.imageViewSelfStatus);
|
||||||
|
textViewSelfStatus = findViewById(R.id.textViewSelfStatus);
|
||||||
mTabSegment = findViewById(R.id.HeadList);
|
mTabSegment = findViewById(R.id.HeadList);
|
||||||
gridUser = findViewById(R.id.GridUser);
|
gridUser = findViewById(R.id.GridUser);
|
||||||
mContentViewPager = findViewById(R.id.contentViewPager);
|
mContentViewPager = findViewById(R.id.contentViewPager);
|
||||||
@@ -144,6 +153,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
mainHandler = this.handler;
|
||||||
|
|
||||||
ButtonDelGroup.setVisibility(View.INVISIBLE);
|
ButtonDelGroup.setVisibility(View.INVISIBLE);
|
||||||
StartMeetingVoice.setVisibility(View.INVISIBLE);
|
StartMeetingVoice.setVisibility(View.INVISIBLE);
|
||||||
@@ -155,12 +165,13 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
headers.add(currSelectData);
|
headers.add(currSelectData);
|
||||||
initTabAndPager();
|
initTabAndPager();
|
||||||
Net.getGroups(null, null);
|
Net.getGroups(null, null);
|
||||||
Net.getUsers(null, null);
|
getUsersData();
|
||||||
checkBeforeMeetingState();
|
checkBeforeMeetingState();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理当前分机号可能有需要加入的会议
|
// 处理当前分机号可能有需要加入的会议
|
||||||
private void checkBeforeMeetingState() {
|
private void checkBeforeMeetingState() {
|
||||||
|
if(DBUser.mySelf == null) return;
|
||||||
Net.getUserInfor(DBUser.mySelf.phone, new HttpUtl.CallBack() {
|
Net.getUserInfor(DBUser.mySelf.phone, new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
@@ -206,6 +217,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
mTabSegment.notifyDataChanged();
|
mTabSegment.notifyDataChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||||
private void initTabAndPager() {
|
private void initTabAndPager() {
|
||||||
mContentViewPager.setAdapter(mPagerAdapter);
|
mContentViewPager.setAdapter(mPagerAdapter);
|
||||||
// mContentViewPager.setCurrentItem(mDestPage.getPosition(), false);
|
// mContentViewPager.setCurrentItem(mDestPage.getPosition(), false);
|
||||||
@@ -213,7 +225,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
for (int i = 0; i < headers.size(); i++) {
|
for (int i = 0; i < headers.size(); i++) {
|
||||||
mTabSegment.addTab(tabBuilder.setText(headers.get(i).name).build(this));
|
mTabSegment.addTab(tabBuilder.setText(headers.get(i).name).build(this));
|
||||||
}
|
}
|
||||||
int space = QMUIDisplayHelper.dp2px(this, 16);
|
int space = QMUIDisplayHelper.dp2px(this, 17);
|
||||||
mTabSegment.setIndicator(new QMUITabIndicator(
|
mTabSegment.setIndicator(new QMUITabIndicator(
|
||||||
QMUIDisplayHelper.dp2px(this, 2), false, true));
|
QMUIDisplayHelper.dp2px(this, 2), false, true));
|
||||||
mTabSegment.setMode(QMUITabSegment.MODE_SCROLLABLE);
|
mTabSegment.setMode(QMUITabSegment.MODE_SCROLLABLE);
|
||||||
@@ -231,7 +243,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
} else {
|
} else {
|
||||||
StartMeetingVoice.setVisibility(View.VISIBLE);
|
StartMeetingVoice.setVisibility(View.VISIBLE);
|
||||||
StartMeetingVideo.setVisibility(View.VISIBLE);
|
StartMeetingVideo.setVisibility(View.VISIBLE);
|
||||||
if (DBUser.mySelf.isManager) {
|
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||||
ButtonDelGroup.setVisibility(View.VISIBLE);
|
ButtonDelGroup.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
ButtonDelGroup.setVisibility(View.INVISIBLE);
|
ButtonDelGroup.setVisibility(View.INVISIBLE);
|
||||||
@@ -243,13 +255,14 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
if (currSelectData.isAll()) {
|
if (currSelectData.isAll()) {
|
||||||
allUsers.addAll(DBUser.allUser);
|
allUsers.addAll(DBUser.allUser);
|
||||||
setUsers();
|
setUsers();
|
||||||
|
Net.getUsers(null, null);
|
||||||
} else {
|
} else {
|
||||||
DBGroup group = DBGroup.getGroup(currSelectData.id);
|
DBGroup group = DBGroup.getGroup(currSelectData.id);
|
||||||
if (group != null) {
|
if (group != null) {
|
||||||
allUsers.addAll(group.users);
|
allUsers.addAll(group.users);
|
||||||
}
|
}
|
||||||
//根据权限来处理
|
//根据权限来处理
|
||||||
if (DBUser.mySelf.isManager) {
|
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||||
DBUser u = new DBUser("", "添加分机", "false");
|
DBUser u = new DBUser("", "添加分机", "false");
|
||||||
u.isAddFlag = true;
|
u.isAddFlag = true;
|
||||||
allUsers.add(u);
|
allUsers.add(u);
|
||||||
@@ -290,6 +303,17 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
buttonAddGroup.setVisibility(View.INVISIBLE);
|
buttonAddGroup.setVisibility(View.INVISIBLE);
|
||||||
imageViewAddGroupIcon.setVisibility(View.INVISIBLE);
|
imageViewAddGroupIcon.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (DBUser.mySelf != null && DBUser.mySelf.isBusy()) {
|
||||||
|
imageViewSelfStatus.setColorFilter(Color.RED);
|
||||||
|
textViewSelfStatus.setText("通话中");
|
||||||
|
} else if (DBUser.mySelf != null && DBUser.mySelf.isOnline()) {
|
||||||
|
imageViewSelfStatus.setColorFilter(Color.GREEN);
|
||||||
|
textViewSelfStatus.setText("在线");
|
||||||
|
} else {
|
||||||
|
imageViewSelfStatus.setColorFilter(Color.GRAY);
|
||||||
|
textViewSelfStatus.setText("离线");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void chgVolum(View v, boolean isAdd) {
|
void chgVolum(View v, boolean isAdd) {
|
||||||
@@ -314,7 +338,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
static Runnable runGetUsers = new Runnable() {
|
static Runnable runGetUsers = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Net.getUsers(null, null);
|
getUsersData();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -322,8 +346,13 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
return gridUser;
|
return gridUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getUsersData() {
|
public static void getUsersData() {
|
||||||
handler.postDelayed(runGetUsers, 3000);
|
if(currSelectData != null && !currSelectData.isAll()) {
|
||||||
|
Net.getGroupMenbers(currSelectData.id, null, currSelectData.id);
|
||||||
|
} else {
|
||||||
|
Net.getUsers(null, null);
|
||||||
|
}
|
||||||
|
mainHandler.postDelayed(runGetUsers, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsers() {
|
public void setUsers() {
|
||||||
@@ -397,14 +426,14 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
if (DBUser.mySelf.isManager) {
|
if (DBUser.mySelf != null && DBUser.mySelf.isManager && currSelectData != null && (!currSelectData.isAll())) {
|
||||||
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("移除").onClick(
|
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("移除").onClick(
|
||||||
new QMUIQuickAction.OnClickListener() {
|
new QMUIQuickAction.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
quickAction.dismiss();
|
quickAction.dismiss();
|
||||||
QMUITipDialog dialog = UIUtl.toastLoading("");
|
QMUITipDialog dialog = UIUtl.toastLoading("");
|
||||||
Net.kickMember4Group(currSelectData.id, d.phone, new HttpUtl.CallBack() {
|
Net.deleteMember4Group(currSelectData.id, d.phone, new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
UIUtl.toastS("移除分机成功");
|
UIUtl.toastS("移除分机成功");
|
||||||
@@ -440,7 +469,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
for (DBUser u : DBUser.allUser) {
|
for (DBUser u : DBUser.allUser) {
|
||||||
if (!group.containsUser(u.phone)) {
|
if (!group.containsUser(u.phone)) {
|
||||||
listPhone.add(u.phone);
|
listPhone.add(u.phone);
|
||||||
list.add(u.phone + " | " + u.name);
|
list.add(u.phone + " " + u.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
@@ -477,8 +506,11 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
String phNum = listPhone.get(selectIndexs[i]);
|
String phNum = listPhone.get(selectIndexs[i]);
|
||||||
members = members + phNum + ",";
|
members = members + phNum + ",";
|
||||||
}
|
}
|
||||||
|
if(members.length() > 0) {
|
||||||
|
members = members.substring(0, members.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
Net.addMember2Group(currSelectData.id, members, new HttpUtl.CallBack() {
|
Net.addMember2Group(currSelectData.audio_code, members, new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
Net.getGroupMenbers(currSelectData.id, null, currSelectData.id);
|
Net.getGroupMenbers(currSelectData.id, null, currSelectData.id);
|
||||||
@@ -526,6 +558,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
mainHandler.removeCallbacks(runGetUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -535,12 +568,12 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
finish();
|
finish();
|
||||||
break;
|
break;
|
||||||
case Net.CMD_getUsers:
|
case Net.CMD_getUsers:
|
||||||
getUsersData();
|
|
||||||
if (currSelectData.isAll()) {
|
if (currSelectData.isAll()) {
|
||||||
allUsers.clear();
|
allUsers.clear();
|
||||||
allUsers.addAll(DBUser.allUser);
|
allUsers.addAll(DBUser.allUser);
|
||||||
setUsers();
|
setUsers();
|
||||||
}
|
}
|
||||||
|
refreshView();
|
||||||
break;
|
break;
|
||||||
case Net.CMD_getGroupMenbers:
|
case Net.CMD_getGroupMenbers:
|
||||||
NetPkg pkg = (NetPkg) (m.obj);
|
NetPkg pkg = (NetPkg) (m.obj);
|
||||||
@@ -550,13 +583,13 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
allUsers.clear();
|
allUsers.clear();
|
||||||
allUsers.addAll(group.users);
|
allUsers.addAll(group.users);
|
||||||
//根据权限来处理
|
//根据权限来处理
|
||||||
if (DBUser.mySelf.isManager) {
|
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||||
DBUser u = new DBUser("", "添加分机", "false");
|
DBUser u = new DBUser("", "添加分机", "false");
|
||||||
u.isAddFlag = true;
|
u.isAddFlag = true;
|
||||||
allUsers.add(u);
|
allUsers.add(u);
|
||||||
}
|
}
|
||||||
setUsers();
|
|
||||||
}
|
}
|
||||||
|
setUsers();
|
||||||
break;
|
break;
|
||||||
case Net.CMD_getGroups:
|
case Net.CMD_getGroups:
|
||||||
refreshHeaders();
|
refreshHeaders();
|
||||||
@@ -568,7 +601,6 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
handler.removeCallbacks(runGetUsers);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addVolume(View view) {
|
public void addVolume(View view) {
|
||||||
@@ -595,16 +627,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void logout(View v) {
|
public void logout(View v) {
|
||||||
SipEngine.getInstance().onLine = false;
|
UIUtl.doLogout();
|
||||||
SipEngine.getInstance().isRelogin = true;
|
|
||||||
// SipEngine.getInstance().Unregister();
|
|
||||||
// SipEngine.getInstance().stop();
|
|
||||||
Intent intent = new Intent(App.getContext(), LoginActivity.class);
|
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
bundle.putBoolean("donotAutoLogin", true);
|
|
||||||
intent.putExtras(bundle);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
startActivity(intent);
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public class Net {
|
|||||||
public static final int CMD_unvmuteMember4Group = 7013;
|
public static final int CMD_unvmuteMember4Group = 7013;
|
||||||
public static final int CMD_vidlayoutMember4Group = 7014;
|
public static final int CMD_vidlayoutMember4Group = 7014;
|
||||||
public static final int CMD_vidfloorMember4Group = 7015;
|
public static final int CMD_vidfloorMember4Group = 7015;
|
||||||
|
public static final int CMD_deleteMember4Group = 7016;
|
||||||
|
|
||||||
static HttpUtl.CallBack _callback = new HttpUtl.CallBack() {
|
static HttpUtl.CallBack _callback = new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
@@ -41,18 +42,22 @@ public class Net {
|
|||||||
Object[] _params = (Object[]) params;
|
Object[] _params = (Object[]) params;
|
||||||
HttpUtl.CallBack callback = (HttpUtl.CallBack) (_params[0]);
|
HttpUtl.CallBack callback = (HttpUtl.CallBack) (_params[0]);
|
||||||
Object orgs = _params[1];
|
Object orgs = _params[1];
|
||||||
if (ActivityMgr.topActivity != null && callback != null) {
|
try {
|
||||||
ActivityMgr.topActivity.handler.post(new Runnable() {
|
if (ActivityMgr.topActivity != null && callback != null) {
|
||||||
@Override
|
ActivityMgr.topActivity.handler.post(new Runnable() {
|
||||||
public void run() {
|
@Override
|
||||||
if (callback != null) {
|
public void run() {
|
||||||
callback.onRequestComplete(cmd, result, orgs);
|
if (callback != null) {
|
||||||
|
callback.onRequestComplete(cmd, result, orgs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
|
ActivityMgr.sendMsg(cmd, new NetPkg(result, orgs));
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
ActivityMgr.sendMsg(cmd, new NetPkg(result, orgs));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -71,7 +76,10 @@ public class Net {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
UIUtl.toastI(result);
|
// UIUtl.toastI(result);
|
||||||
|
if(cmd == CMD_getUsers) {
|
||||||
|
UIUtl.doLogout();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -97,7 +105,7 @@ public class Net {
|
|||||||
|
|
||||||
public static void createMeeting(String topic, String description, String members, HttpUtl.CallBack callBack, Object orgs) {
|
public static void createMeeting(String topic, String description, String members, HttpUtl.CallBack callBack, Object orgs) {
|
||||||
String url = "http://" + ip + ":" + port + "/api/conferences/conference/insert";
|
String url = "http://" + ip + ":" + port + "/api/conferences/conference/insert";
|
||||||
String _params = "topic=" + topic + "&description=" + description + "&members=" + members + "&typ=prompt" + "&start_member=" + DBUser.mySelf.phone;
|
String _params = "topic=" + topic + "&description=" + description + "&members=" + members + "&type=prompt" + "&start_member=" + DBUser.mySelf.phone;
|
||||||
Object[] params = {callBack, orgs};
|
Object[] params = {callBack, orgs};
|
||||||
HttpUtl.doPostAsyn(url, _params, _callback, CMD_createMeeting, params);
|
HttpUtl.doPostAsyn(url, _params, _callback, CMD_createMeeting, params);
|
||||||
}
|
}
|
||||||
@@ -128,7 +136,6 @@ public class Net {
|
|||||||
HttpUtl.doPostAsyn(url, _params, _callback, CMD_deleteGroup, params);
|
HttpUtl.doPostAsyn(url, _params, _callback, CMD_deleteGroup, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:确认下参数
|
|
||||||
public static void addMember2Group(String task_uuid, String members, HttpUtl.CallBack callBack, Object orgs) {
|
public static void addMember2Group(String task_uuid, String members, HttpUtl.CallBack callBack, Object orgs) {
|
||||||
String url = "http://" + ip + ":" + port + "/api/conferences/conference/add";
|
String url = "http://" + ip + ":" + port + "/api/conferences/conference/add";
|
||||||
String _params = "opr_nbr=" + task_uuid + "&opr_member=" + members;
|
String _params = "opr_nbr=" + task_uuid + "&opr_member=" + members;
|
||||||
@@ -136,7 +143,13 @@ public class Net {
|
|||||||
HttpUtl.doPostAsyn(url, _params, _callback, CMD_addUser2Group, params);
|
HttpUtl.doPostAsyn(url, _params, _callback, CMD_addUser2Group, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:确认下参数
|
public static void deleteMember4Group(String task_uuid, String members, HttpUtl.CallBack callBack, Object orgs) {
|
||||||
|
String url = "http://" + ip + ":" + port + "/api/conferences/conference/delete";
|
||||||
|
String _params = "task_uuid=" + task_uuid + "&members=" + members;
|
||||||
|
Object[] params = {callBack, orgs};
|
||||||
|
HttpUtl.doPostAsyn(url, _params, _callback, CMD_deleteMember4Group, params);
|
||||||
|
}
|
||||||
|
|
||||||
public static void kickMember4Group(String task_uuid, String members, HttpUtl.CallBack callBack, Object orgs) {
|
public static void kickMember4Group(String task_uuid, String members, HttpUtl.CallBack callBack, Object orgs) {
|
||||||
String url = "http://" + ip + ":" + port + "/api/conferences/conference/update";
|
String url = "http://" + ip + ":" + port + "/api/conferences/conference/update";
|
||||||
String _params = "opr_nbr=" + task_uuid + "&opr_member=" + members + "&opr_action=kick";
|
String _params = "opr_nbr=" + task_uuid + "&opr_member=" + members + "&opr_action=kick";
|
||||||
|
|||||||
@@ -11,26 +11,41 @@ import java.util.concurrent.ConcurrentSkipListSet;
|
|||||||
public class ActivityMgr {
|
public class ActivityMgr {
|
||||||
public static Map<Class, TrBaseActivity> actives = new ConcurrentHashMap<>();
|
public static Map<Class, TrBaseActivity> actives = new ConcurrentHashMap<>();
|
||||||
public static TrBaseActivity topActivity;
|
public static TrBaseActivity topActivity;
|
||||||
public static TrBaseActivity getActivity(Class _class){
|
|
||||||
|
public static TrBaseActivity getActivity(Class _class) {
|
||||||
return actives.get(_class);
|
return actives.get(_class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onShowActivity(TrBaseActivity a) {
|
public static void onShowActivity(TrBaseActivity a) {
|
||||||
topActivity = a;
|
topActivity = a;
|
||||||
if(!actives.containsKey(a.getClass())) {
|
if (!actives.containsKey(a.getClass())) {
|
||||||
actives.put(a.getClass(), a);
|
actives.put(a.getClass(), a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onHideActivity(TrBaseActivity a) {
|
public static void onHideActivity(TrBaseActivity a) {
|
||||||
|
UIUtl.onHideActivity(a);
|
||||||
actives.remove(a.getClass());
|
actives.remove(a.getClass());
|
||||||
if(a == topActivity) {
|
if (a == topActivity) {
|
||||||
topActivity = null;
|
topActivity = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendMsg(int menu, Object obj) {
|
public static void sendMsg(int menu, Object obj) {
|
||||||
for(TrBaseActivity a : actives.values()) {
|
for (TrBaseActivity a : actives.values()) {
|
||||||
CONS.SENDMESSAGETO( a.handler, menu, obj);
|
if(a != null && a.handler != null) {
|
||||||
}
|
CONS.SENDMESSAGETO(a.handler, menu, obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void hideAll() {
|
||||||
|
try {
|
||||||
|
for (TrBaseActivity a : actives.values()) {
|
||||||
|
a.finish();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ public class TrBaseActivity extends AppCompatActivity implements Handler.Callbac
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
@@ -25,10 +26,19 @@ public class TrBaseActivity extends AppCompatActivity implements Handler.Callbac
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onStop();
|
super.onCreate(savedInstanceState);
|
||||||
ActivityMgr.onHideActivity(this);
|
ActivityMgr.onShowActivity(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
ActivityMgr.onHideActivity(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.tianrun.sipcall.ui;
|
package com.tianrun.sipcall.ui;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.GridView;
|
import android.widget.GridView;
|
||||||
@@ -9,13 +11,54 @@ import android.widget.Toast;
|
|||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
import com.qmuiteam.qmui.skin.QMUISkinManager;
|
import com.qmuiteam.qmui.skin.QMUISkinManager;
|
||||||
|
import com.qmuiteam.qmui.widget.dialog.QMUIBaseDialog;
|
||||||
import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet;
|
import com.qmuiteam.qmui.widget.dialog.QMUIBottomSheet;
|
||||||
import com.qmuiteam.qmui.widget.dialog.QMUITipDialog;
|
import com.qmuiteam.qmui.widget.dialog.QMUITipDialog;
|
||||||
import com.tianrun.sipcall.App;
|
import com.tianrun.sipcall.App;
|
||||||
|
import com.tianrun.sipcall.SipEngine;
|
||||||
|
import com.tianrun.sipcall.login.LoginActivity;
|
||||||
|
import com.tianrun.sipcall.utils.HttpUtl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
public class UIUtl {
|
public class UIUtl {
|
||||||
|
public static Map<Class, ArrayList<QMUIBaseDialog>> activesWithDialogs = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
private static void onShowDialog(TrBaseActivity activity, QMUIBaseDialog dialog){
|
||||||
|
try {
|
||||||
|
ArrayList<QMUIBaseDialog> list = activesWithDialogs.get(activity.getClass());
|
||||||
|
if (list == null) {
|
||||||
|
list = new ArrayList<QMUIBaseDialog>();
|
||||||
|
}
|
||||||
|
list.add(dialog);
|
||||||
|
activesWithDialogs.put(activity.getClass(), list);
|
||||||
|
} catch (Exception e){
|
||||||
|
System.out.println(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void onHideActivity(TrBaseActivity activity){
|
||||||
|
try {
|
||||||
|
if(activity == null) return;
|
||||||
|
ArrayList<QMUIBaseDialog> list = activesWithDialogs.get(activity.getClass());
|
||||||
|
if(list != null) {
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
QMUIBaseDialog dialog =list.get(i);
|
||||||
|
if(dialog != null) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
list.clear();
|
||||||
|
}
|
||||||
|
activesWithDialogs.remove(activity.getClass());
|
||||||
|
} catch (Exception e){
|
||||||
|
System.out.println(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void toast(String tip) {
|
public static void toast(String tip) {
|
||||||
if (ActivityMgr.topActivity == null) return;
|
if (ActivityMgr.topActivity == null) return;
|
||||||
try {
|
try {
|
||||||
@@ -27,7 +70,7 @@ public class UIUtl {
|
|||||||
.setTipWord(tip)
|
.setTipWord(tip)
|
||||||
.create();
|
.create();
|
||||||
tipDialog.show();
|
tipDialog.show();
|
||||||
hideToast(tipDialog);
|
hideToast(ActivityMgr.topActivity, tipDialog);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -46,7 +89,7 @@ public class UIUtl {
|
|||||||
.setTipWord(tip)
|
.setTipWord(tip)
|
||||||
.create();
|
.create();
|
||||||
tipDialog.show();
|
tipDialog.show();
|
||||||
hideToast(tipDialog);
|
hideToast(ActivityMgr.topActivity, tipDialog);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -65,7 +108,7 @@ public class UIUtl {
|
|||||||
.setTipWord(tip)
|
.setTipWord(tip)
|
||||||
.create();
|
.create();
|
||||||
tipDialog.show();
|
tipDialog.show();
|
||||||
hideToast(tipDialog);
|
hideToast(ActivityMgr.topActivity, tipDialog);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -84,7 +127,7 @@ public class UIUtl {
|
|||||||
.setTipWord(tip)
|
.setTipWord(tip)
|
||||||
.create();
|
.create();
|
||||||
tipDialog.show();
|
tipDialog.show();
|
||||||
hideToast(tipDialog);
|
hideToast(ActivityMgr.topActivity, tipDialog);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -103,18 +146,22 @@ public class UIUtl {
|
|||||||
return tipDialog;
|
return tipDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void hideToast(QMUITipDialog tipDialog) {
|
private static void hideToast(TrBaseActivity activity, QMUITipDialog tipDialog) {
|
||||||
if (ActivityMgr.topActivity == null) return;
|
if (activity == null) return;
|
||||||
ActivityMgr.topActivity.handler.postDelayed(new Runnable() {
|
activity.handler.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
ArrayList<QMUIBaseDialog> list = activesWithDialogs.get(activity.getClass());
|
||||||
|
if(list != null && list.contains(tipDialog)) {
|
||||||
|
list.remove(tipDialog);
|
||||||
|
}
|
||||||
tipDialog.dismiss();
|
tipDialog.dismiss();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println(e);
|
System.out.println(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 1200);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TrAdapter setList(Context context, GridView grid, int convertViewId, Object list, TrAdapter.Callback callback) {
|
public static TrAdapter setList(Context context, GridView grid, int convertViewId, Object list, TrAdapter.Callback callback) {
|
||||||
@@ -168,4 +215,21 @@ public class UIUtl {
|
|||||||
}
|
}
|
||||||
builder.build().show();
|
builder.build().show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void doLogout() {
|
||||||
|
UIUtl.toastI("Token 失效");
|
||||||
|
HttpUtl.token = null;
|
||||||
|
ActivityMgr.hideAll();
|
||||||
|
SipEngine.getInstance().onLine = false;
|
||||||
|
SipEngine.getInstance().isRelogin = true;
|
||||||
|
// SipEngine.getInstance().Unregister();
|
||||||
|
// SipEngine.getInstance().stop();
|
||||||
|
Intent intent = new Intent(App.getContext(), LoginActivity.class);
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putBoolean("donotAutoLogin", true);
|
||||||
|
intent.putExtras(bundle);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
// ActivityMgr.topActivity.startActivity(intent);
|
||||||
|
App.getInstance().startActivity(intent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public class CONS {
|
|||||||
public static final int INCOMINGMESSAGE = 208;//来短信了
|
public static final int INCOMINGMESSAGE = 208;//来短信了
|
||||||
public static final int showpic = 209;
|
public static final int showpic = 209;
|
||||||
public static final int LOGINFAILED = 210;
|
public static final int LOGINFAILED = 210;
|
||||||
|
public static final int ONGETCALLID = 211;
|
||||||
|
|
||||||
public static void SENDMESSAGETO(Handler handler, int menu, Object object) {
|
public static void SENDMESSAGETO(Handler handler, int menu, Object object) {
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
|
|||||||
@@ -1,10 +1,19 @@
|
|||||||
package com.tianrun.sipcall.utils;
|
package com.tianrun.sipcall.utils;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageItemInfo;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.tianrun.sipcall.App;
|
||||||
|
import com.tianrun.sipcall.SipEngine;
|
||||||
|
import com.tianrun.sipcall.login.LoginActivity;
|
||||||
|
import com.tianrun.sipcall.ui.ActivityMgr;
|
||||||
|
import com.tianrun.sipcall.ui.UIUtl;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
@@ -22,7 +31,6 @@ import java.util.Map;
|
|||||||
* Http请求的工具类
|
* Http请求的工具类
|
||||||
*
|
*
|
||||||
* @author suming
|
* @author suming
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class HttpUtl {
|
public class HttpUtl {
|
||||||
|
|
||||||
@@ -31,11 +39,12 @@ public class HttpUtl {
|
|||||||
|
|
||||||
public interface CallBack {
|
public interface CallBack {
|
||||||
void onRequestComplete(int cmd, String result, Object orgs);
|
void onRequestComplete(int cmd, String result, Object orgs);
|
||||||
|
|
||||||
void onRequestError(int cmd, String result, Object orgs);
|
void onRequestError(int cmd, String result, Object orgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String token;
|
public static String token = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步的Get请求
|
* 异步的Get请求
|
||||||
@@ -58,7 +67,7 @@ public class HttpUtl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
}
|
||||||
}.start();
|
}.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +93,7 @@ public class HttpUtl {
|
|||||||
callBack.onRequestError(cmd, e.toString(), orgs);
|
callBack.onRequestError(cmd, e.toString(), orgs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}.start();
|
}.start();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -119,7 +128,7 @@ public class HttpUtl {
|
|||||||
conn.setRequestProperty("connection", "Keep-Alive");
|
conn.setRequestProperty("connection", "Keep-Alive");
|
||||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||||
conn.setRequestProperty("charset", "utf-8");
|
conn.setRequestProperty("charset", "utf-8");
|
||||||
if(token != null) {
|
if (token != null) {
|
||||||
conn.setRequestProperty("X-Auth-Token", token);
|
conn.setRequestProperty("X-Auth-Token", token);
|
||||||
}
|
}
|
||||||
int retCode = conn.getResponseCode();
|
int retCode = conn.getResponseCode();
|
||||||
@@ -137,13 +146,18 @@ public class HttpUtl {
|
|||||||
baos.write(buf, 0, len);
|
baos.write(buf, 0, len);
|
||||||
}
|
}
|
||||||
baos.flush();
|
baos.flush();
|
||||||
if (baos.toString()==null||baos.toString().equals("")) {
|
if (baos.toString() == null || baos.toString().equals("")) {
|
||||||
Log.i("http", "result为空");
|
Log.i("http", "result为空");
|
||||||
} else {
|
} else {
|
||||||
Log.i("http", baos.toString());
|
Log.i("http", baos.toString());
|
||||||
}
|
}
|
||||||
return baos.toString();
|
return baos.toString();
|
||||||
|
} else if (retCode == 401) {
|
||||||
|
checkTokenFailed(retCode);
|
||||||
|
return "";
|
||||||
} else {
|
} else {
|
||||||
|
UIUtl.toastI("内部错误");
|
||||||
|
Log.e("http", urlStr);
|
||||||
throw new RuntimeException(" responseCode :" + retCode);
|
throw new RuntimeException(" responseCode :" + retCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,17 +180,21 @@ public class HttpUtl {
|
|||||||
// return null;
|
// return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void checkTokenFailed(int code) {
|
||||||
|
if (code == 401) {
|
||||||
|
UIUtl.doLogout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向指定 URL 发送POST方法的请求
|
* 向指定 URL 发送POST方法的请求
|
||||||
*
|
*
|
||||||
* @param url
|
* @param url 发送请求的 URL
|
||||||
* 发送请求的 URL
|
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
|
||||||
* @param param
|
|
||||||
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
|
|
||||||
* @return 所代表远程资源的响应结果
|
* @return 所代表远程资源的响应结果
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static String doPost(String url, String param) {
|
public static String doPost(String url, String param) throws Exception {
|
||||||
PrintWriter out = null;
|
PrintWriter out = null;
|
||||||
BufferedReader in = null;
|
BufferedReader in = null;
|
||||||
String result = "";
|
String result = "";
|
||||||
@@ -190,7 +208,7 @@ public class HttpUtl {
|
|||||||
conn.setRequestMethod("POST");
|
conn.setRequestMethod("POST");
|
||||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||||
conn.setRequestProperty("charset", "utf-8");
|
conn.setRequestProperty("charset", "utf-8");
|
||||||
if(token != null) {
|
if (token != null) {
|
||||||
conn.setRequestProperty("X-Auth-Token", token);
|
conn.setRequestProperty("X-Auth-Token", token);
|
||||||
}
|
}
|
||||||
conn.setUseCaches(false);
|
conn.setUseCaches(false);
|
||||||
@@ -214,8 +232,18 @@ public class HttpUtl {
|
|||||||
while ((line = in.readLine()) != null) {
|
while ((line = in.readLine()) != null) {
|
||||||
result += line;
|
result += line;
|
||||||
}
|
}
|
||||||
if (result .equals("{}")){
|
if (result.equals("{}")) {
|
||||||
result = conn.getResponseCode()+"";
|
result = conn.getResponseCode() + "";
|
||||||
|
}
|
||||||
|
|
||||||
|
int retCode = conn.getResponseCode();
|
||||||
|
|
||||||
|
if (retCode == 200) {
|
||||||
|
} else if(retCode == 401) {
|
||||||
|
checkTokenFailed(retCode);
|
||||||
|
} else {
|
||||||
|
UIUtl.toastI("内部错误");
|
||||||
|
throw new RuntimeException(" responseCode :" + retCode);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -234,7 +262,7 @@ public class HttpUtl {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result==null&&result.equals("")) {
|
if (result == null && result.equals("")) {
|
||||||
Log.i("http", "result为空");
|
Log.i("http", "result为空");
|
||||||
} else {
|
} else {
|
||||||
Log.i("http", result);
|
Log.i("http", result);
|
||||||
@@ -269,7 +297,7 @@ public class HttpUtl {
|
|||||||
conn.setRequestProperty("connection", "keep-alive");
|
conn.setRequestProperty("connection", "keep-alive");
|
||||||
conn.setRequestProperty("Charsert", "UTF-8");
|
conn.setRequestProperty("Charsert", "UTF-8");
|
||||||
conn.setRequestProperty("Content-Type", MULTIPART_FROM_DATA + ";boundary=" + BOUNDARY);
|
conn.setRequestProperty("Content-Type", MULTIPART_FROM_DATA + ";boundary=" + BOUNDARY);
|
||||||
if(token != null) {
|
if (token != null) {
|
||||||
conn.setRequestProperty("X-Auth-Token", token);
|
conn.setRequestProperty("X-Auth-Token", token);
|
||||||
}
|
}
|
||||||
// 首先组拼文本类型的参数
|
// 首先组拼文本类型的参数
|
||||||
|
|||||||
BIN
app/src/main/res/drawable-hdpi/fullscreen.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 27 KiB |
BIN
app/src/main/res/drawable-hdpi/kick.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/drawable-hdpi/mute.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/drawable-hdpi/splash1.jpg
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
BIN
app/src/main/res/drawable-hdpi/splash2.jpg
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
BIN
app/src/main/res/drawable-hdpi/unmute.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-hdpi/unvideo.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 27 KiB |
BIN
app/src/main/res/drawable/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
@@ -1,4 +1,5 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:background="@color/whitesmoke"
|
android:background="@color/whitesmoke"
|
||||||
@@ -11,8 +12,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
android:text="null"
|
android:text="设置"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#363636"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
@@ -23,62 +24,230 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:orientation="vertical">
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="10dp">
|
|
||||||
|
|
||||||
<EditText
|
<TextView
|
||||||
android:id="@+id/username"
|
android:id="@+id/textView3"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50sp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:background="@drawable/corners_black"
|
android:layout_weight="1"
|
||||||
android:hint="账号"
|
android:gravity="center_vertical"
|
||||||
android:padding="5dp"
|
android:singleLine="true"
|
||||||
android:text="5503"
|
android:text="SIP设置"
|
||||||
android:textColor="@color/blackcolor"
|
android:textColor="#CCCCCC"
|
||||||
android:textColorHint="@color/gray"
|
android:textSize="18sp"
|
||||||
android:textSize="15sp" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<EditText
|
<LinearLayout
|
||||||
android:id="@+id/userpw"
|
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="50sp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginTop="10dp"
|
android:background="#FFFFFF"
|
||||||
android:background="@drawable/corners_black"
|
android:orientation="horizontal"
|
||||||
android:hint="密码"
|
android:visibility="visible">
|
||||||
android:padding="5dp"
|
|
||||||
android:text="!@#123Qw"
|
|
||||||
android:textColor="@color/blackcolor"
|
|
||||||
android:textColorHint="@color/gray"
|
|
||||||
android:textSize="15sp" />
|
|
||||||
|
|
||||||
<EditText
|
<TextView
|
||||||
android:id="@+id/userip"
|
android:layout_width="0dp"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_height="50sp"
|
android:layout_marginLeft="5dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_weight="0.5"
|
||||||
android:background="@drawable/corners_black"
|
android:gravity="center_vertical"
|
||||||
android:hint="服务器地址"
|
android:singleLine="true"
|
||||||
android:padding="5dp"
|
android:text="分机号"
|
||||||
android:text="47.111.20.34"
|
android:textColor="#000000"
|
||||||
android:textColor="@color/blackcolor"
|
android:textSize="18sp"
|
||||||
android:textColorHint="@color/gray"
|
android:textStyle="bold" />
|
||||||
android:textSize="15sp" />
|
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/userport"
|
android:id="@+id/username"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_weight="1.5"
|
||||||
|
android:hint="请输入"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:background="#FFFFFF"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="密码"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/userpw"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_weight="1.5"
|
||||||
|
android:hint="请输入"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:background="#FFFFFF"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="SIP服务器"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/userip"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_weight="1.5"
|
||||||
|
android:hint="请输入"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:background="#FFFFFF"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="SIP端口"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/userport"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_weight="1.5"
|
||||||
|
android:hint="请输入"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView4"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="服务器设置"
|
||||||
|
android:textColor="#CCCCCC"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:background="#FFFFFF"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="服务器"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/http_host"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_weight="1.5"
|
||||||
|
android:hint="请输入"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="50sp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="5dp"
|
||||||
android:background="@drawable/corners_black"
|
android:background="#FFFFFF"
|
||||||
android:hint="端口"
|
android:orientation="horizontal"
|
||||||
android:padding="5dp"
|
android:visibility="visible">
|
||||||
android:text="5060"
|
|
||||||
android:textColor="@color/blackcolor"
|
<TextView
|
||||||
android:textColorHint="@color/gray"
|
android:layout_width="0dp"
|
||||||
android:textSize="15sp" />
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="端口"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/http_port"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_weight="1.5"
|
||||||
|
android:hint="请输入"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView5"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
@@ -86,12 +255,12 @@
|
|||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:background="@drawable/callpad_bg"
|
android:background="@drawable/callpad_bg"
|
||||||
android:onClick="login"
|
android:onClick="login"
|
||||||
android:text="登录"
|
android:text="确定"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="20sp" />
|
android:textSize="20sp" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
@@ -101,8 +270,9 @@
|
|||||||
android:text="退出"
|
android:text="退出"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
android:visibility="visible" />
|
android:visibility="invisible" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</LinearLayout>
|
</RelativeLayout>
|
||||||
@@ -94,9 +94,33 @@
|
|||||||
android:layout_marginBottom="50dp"
|
android:layout_marginBottom="50dp"
|
||||||
android:background="@drawable/bt_bgd"
|
android:background="@drawable/bt_bgd"
|
||||||
android:onClick="logout"
|
android:onClick="logout"
|
||||||
android:text="退出"
|
android:text="设置"
|
||||||
android:textColor="#FFFFFF" />
|
android:textColor="#FFFFFF" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageViewSelfStatus"
|
||||||
|
android:layout_width="10dp"
|
||||||
|
android:layout_height="10dp"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginStart="18dp"
|
||||||
|
android:layout_marginBottom="7dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/circle"
|
||||||
|
app:tint="#5EE463" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewSelfStatus"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginStart="30dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:text="在线"
|
||||||
|
android:textAlignment="textStart"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textViewSelfNum"
|
android:id="@+id/textViewSelfNum"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -105,7 +129,7 @@
|
|||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="24dp"
|
||||||
android:text="号码:xxxx"
|
android:text="号码:xxxx"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
@@ -240,7 +264,7 @@
|
|||||||
android:clickable="false">
|
android:clickable="false">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/button"
|
android:id="@+id/videobutton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:onClick="doMeetingVideo4Group"
|
android:onClick="doMeetingVideo4Group"
|
||||||
@@ -248,7 +272,7 @@
|
|||||||
android:textAlignment="viewEnd" />
|
android:textAlignment="viewEnd" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView2"
|
android:id="@+id/imageView22"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
@@ -267,7 +291,7 @@
|
|||||||
android:focusableInTouchMode="false">
|
android:focusableInTouchMode="false">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/button"
|
android:id="@+id/delGroupbutton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:onClick="deleteGroup"
|
android:onClick="deleteGroup"
|
||||||
@@ -276,7 +300,7 @@
|
|||||||
android:textColor="#F44336" />
|
android:textColor="#F44336" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView2"
|
android:id="@+id/imageView3"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="20dp"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
@@ -304,7 +328,7 @@
|
|||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView4"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
@@ -312,7 +336,7 @@
|
|||||||
app:tint="#5EE463" />
|
app:tint="#5EE463" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView"
|
android:id="@+id/textView5"
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
@@ -330,7 +354,7 @@
|
|||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView6"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
@@ -338,7 +362,7 @@
|
|||||||
app:tint="#F44336" />
|
app:tint="#F44336" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView"
|
android:id="@+id/textView7"
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
|
|||||||
@@ -78,6 +78,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/qmui_divider"
|
||||||
android:onClick="exit"
|
android:onClick="exit"
|
||||||
android:text="取消"
|
android:text="取消"
|
||||||
android:textColor="@color/redcolor"
|
android:textColor="@color/redcolor"
|
||||||
@@ -88,8 +89,10 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/callpad_bg"
|
||||||
android:onClick="createGroup"
|
android:onClick="createGroup"
|
||||||
android:text="创建分组" />
|
android:text="创建分组"
|
||||||
|
android:textColor="#FFFFFF" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:background="@drawable/callbackground" >
|
android:background="@drawable/callbackground" >
|
||||||
|
|
||||||
<blue.view.SMPercentFrameLayout
|
<blue.view.SMPercentFrameLayout
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
</blue.view.SMPercentFrameLayout>
|
</blue.view.SMPercentFrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
android:id="@+id/IncallMeetingRoot"
|
android:id="@+id/IncallMeetingRoot"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:background="@drawable/callbackground">
|
android:background="@drawable/callbackground"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView3"
|
android:id="@+id/imageView3"
|
||||||
@@ -57,7 +58,7 @@
|
|||||||
android:id="@+id/remote_video_layout"
|
android:id="@+id/remote_video_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:visibility="visible">
|
android:visibility="invisible">
|
||||||
|
|
||||||
<blue.view.SMSurfaceViewRenderer
|
<blue.view.SMSurfaceViewRenderer
|
||||||
android:id="@+id/remote_video_view"
|
android:id="@+id/remote_video_view"
|
||||||
@@ -70,7 +71,7 @@
|
|||||||
android:id="@+id/local_video_layout"
|
android:id="@+id/local_video_layout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="visible">
|
android:visibility="invisible">
|
||||||
|
|
||||||
<blue.view.SMSurfaceViewRenderer
|
<blue.view.SMSurfaceViewRenderer
|
||||||
android:id="@+id/local_video_view"
|
android:id="@+id/local_video_view"
|
||||||
@@ -89,6 +90,24 @@
|
|||||||
android:layout_marginStart="160dp"
|
android:layout_marginStart="160dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/incall_mute"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bt_bgd"
|
||||||
|
android:src="@drawable/mute"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/incall_muteVideo"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bt_bgd"
|
||||||
|
android:src="@drawable/unvideo"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/incall_answer"
|
android:id="@+id/incall_answer"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -105,6 +124,7 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/call_hangup_background"
|
android:background="@drawable/call_hangup_background"
|
||||||
android:src="@drawable/phone3" />
|
android:src="@drawable/phone3" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
<com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
|
||||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 27 KiB |
@@ -1,5 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">SIP电话</string>
|
<string name="app_name">视频对讲指挥系统</string>
|
||||||
<string name="title_activity_scrolling">ScrollingActivity</string>
|
<string name="title_activity_scrolling">ScrollingActivity</string>
|
||||||
<string name="large_text">
|
<string name="large_text">
|
||||||
"Material is the metaphor.\n\n"
|
"Material is the metaphor.\n\n"
|
||||||
|
|||||||
@@ -5,11 +5,10 @@ buildscript {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.0.1'
|
classpath 'com.android.tools.build:gradle:4.1.0'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
}
|
}
|
||||||
@@ -19,7 +18,6 @@ allprojects {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
#Tue Aug 25 12:37:32 CST 2020
|
#Fri Oct 16 07:42:12 CST 2020
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
|
||||||
|
|||||||