Compare commits
12 Commits
2ce5beace4
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| f4c6060cbc | |||
| 7961a6b462 | |||
| 3b28584e4c | |||
| eb6c7ddab8 | |||
| de8bf0b61c | |||
| 38b701a4ea | |||
| a90f8bf59c | |||
| 52a82c50ab | |||
| 29f2f2f7ef | |||
| 74928e6e49 | |||
| b0704fee96 | |||
| 124518a570 |
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.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.media.Ringtone;
|
||||
import android.media.RingtoneManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
||||
import com.tianrun.sipcall.call.CallMediaUtils;
|
||||
import com.tianrun.sipcall.call.InCallActivity;
|
||||
@@ -172,7 +177,7 @@ public class SipEngine implements BluetelInterface {
|
||||
int calltype = isVideo == false ? 0 : 1;
|
||||
String state = isVideo == true ? "视频来电" : "音频来电";
|
||||
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
|
||||
@@ -220,8 +225,13 @@ public class SipEngine implements BluetelInterface {
|
||||
|
||||
@Override
|
||||
public void NotifyCallMediaState(int callid, int r, int l, int payload) {
|
||||
logmy.e("NotifyCallMediaState" + callid + "<>" + r + "<>" + l + "<>" + payload);
|
||||
ActivityMgr.sendMsg(CONS.MEDIASTATE, new CallMediaUtils(callid, payload, r, l));
|
||||
logmy.e("NotifyCallMediaState=========" + callid + "<>" + r + "<>" + l + "<>" + payload);
|
||||
ActivityMgr.topActivity.handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ActivityMgr.sendMsg(CONS.MEDIASTATE, new CallMediaUtils(callid, payload, r, l));
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -241,8 +251,10 @@ public class SipEngine implements BluetelInterface {
|
||||
* @param calltype
|
||||
* @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;
|
||||
|
||||
logmy.e("GoToInCall==============" + isMeetingCall(callnumber) +"==="+ System.currentTimeMillis());
|
||||
if (isMeetingCall(callnumber)) {
|
||||
intent = new Intent(context, InCallMeetingActivity.class);
|
||||
} else {
|
||||
@@ -253,6 +265,7 @@ public class SipEngine implements BluetelInterface {
|
||||
bundle.putString("callnumber", callnumber);
|
||||
bundle.putString("callstate", callstate);
|
||||
bundle.putInt("calltype", calltype);
|
||||
bundle.putBoolean("selfCall", selfCall);
|
||||
intent.putExtras(bundle);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
@@ -266,9 +279,10 @@ public class SipEngine implements BluetelInterface {
|
||||
* @return
|
||||
*/
|
||||
public int CallNumber(String number, boolean isVideo) {
|
||||
int callid = myBluetelEngine.CallNumber(number, ip, port, isVideo);
|
||||
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));
|
||||
return callid;
|
||||
}
|
||||
@@ -315,5 +329,25 @@ public class SipEngine implements BluetelInterface {
|
||||
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,10 +53,12 @@ public class CreateGroupActivity extends TrBaseActivity {
|
||||
|
||||
users.clear();
|
||||
mapUsers.clear();
|
||||
users.add(DBUser.mySelf);
|
||||
mapUsers.put(DBUser.mySelf.phone, DBUser.mySelf);
|
||||
|
||||
DBUser u = new DBUser("", "添加分机号", "");
|
||||
u.isAddFlag = true;
|
||||
users.add(u);
|
||||
users.add(DBUser.mySelf);
|
||||
|
||||
setList(null);
|
||||
}
|
||||
@@ -162,7 +164,7 @@ public class CreateGroupActivity extends TrBaseActivity {
|
||||
for (DBUser u : DBUser.allUser) {
|
||||
if (mapUsers.get(u.phone) == null) {
|
||||
listPhone.add(u.phone);
|
||||
list.add(u.phone + " | " + u.name);
|
||||
list.add(u.phone + " " + u.name);
|
||||
}
|
||||
}
|
||||
if(list.size() == 0) {
|
||||
@@ -216,6 +218,9 @@ public class CreateGroupActivity extends TrBaseActivity {
|
||||
str = str + us.phone + ",";
|
||||
}
|
||||
}
|
||||
if(str.length() > 0) {
|
||||
str = str.substring(0, str.length() - 1);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.tianrun.sipcall.ui.TrAdapter;
|
||||
import com.tianrun.sipcall.ui.TrBaseActivity;
|
||||
import com.tianrun.sipcall.ui.UIUtl;
|
||||
import com.tianrun.sipcall.utils.HttpUtl;
|
||||
import com.tianrun.sipcall.utils.logmy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -59,6 +60,8 @@ public class CreateMeetingActivity extends TrBaseActivity {
|
||||
|
||||
users.clear();
|
||||
mapUsers.clear();
|
||||
users.add(DBUser.mySelf);
|
||||
mapUsers.put(DBUser.mySelf.phone, DBUser.mySelf);
|
||||
DBUser u = new DBUser("", "添加分机号", "");
|
||||
u.isAddFlag = true;
|
||||
users.add(u);
|
||||
@@ -174,13 +177,13 @@ public class CreateMeetingActivity extends TrBaseActivity {
|
||||
List<String> list = new ArrayList<>();
|
||||
List<String> listPhone = new ArrayList<>();
|
||||
for (DBUser u : DBUser.allUser) {
|
||||
if (mapUsers.get(u.phone) == null && (!u.isBusy())) { // 只有空间的才加入
|
||||
if (mapUsers.get(u.phone) == null && u.isOnline()) { // 只有空闲的才加入
|
||||
listPhone.add(u.phone);
|
||||
list.add(u.phone + " | " + u.name);
|
||||
list.add(u.phone + " " + u.name);
|
||||
}
|
||||
}
|
||||
if(list.size() == 0) {
|
||||
UIUtl.toastI("所有分机已经添加");
|
||||
UIUtl.toastI("所有空闲分机已经添加");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -234,6 +237,9 @@ public class CreateMeetingActivity extends TrBaseActivity {
|
||||
str = str + us.phone + ",";
|
||||
}
|
||||
}
|
||||
if(str.length() > 0) {
|
||||
str = str.substring(0, str.length() - 1);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -252,6 +258,8 @@ public class CreateMeetingActivity extends TrBaseActivity {
|
||||
UIUtl.toastI("请添加要加入会议的分机号");
|
||||
return;
|
||||
}
|
||||
|
||||
logmy.e("createMeeting==============" + System.currentTimeMillis());
|
||||
QMUITipDialog dialog = UIUtl.toastLoading("");
|
||||
Net.createMeeting(meetingTopic.getText().toString(), meetingDesc.getText().toString(), userStr, new HttpUtl.CallBack() {
|
||||
@Override
|
||||
@@ -266,7 +274,7 @@ public class CreateMeetingActivity extends TrBaseActivity {
|
||||
// }
|
||||
// SipEngine.getInstance().CallNumber(code, isVideo);
|
||||
// }
|
||||
UIUtl.toastS("临时会议创建成功");
|
||||
// UIUtl.toastS("临时会议创建成功");
|
||||
dialog.dismiss();
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.app.Activity;
|
||||
import android.app.KeyguardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.Ringtone;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
@@ -60,8 +61,10 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
||||
private String callnumber = "未知";
|
||||
private String callstate = "未知";
|
||||
private int calltype = 0; //0音频1视频
|
||||
private boolean selfCall = false;
|
||||
private boolean VIDEOSTATE = false;
|
||||
public static Intent incallIntent;
|
||||
private Ringtone ringtone;
|
||||
|
||||
public String[] screenTyps = {"经典模式", "均分模式", "远程全屏", "本地全屏"};
|
||||
|
||||
@@ -185,17 +188,35 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
||||
super.onResume();
|
||||
if (callstate.equals("来电")) {
|
||||
incall_answer.setVisibility(View.VISIBLE);
|
||||
ringtone = SipEngine.getInstance().PlaydefaultCallMediaPlayer(this);
|
||||
} else {
|
||||
incall_answer.setVisibility(View.GONE);
|
||||
}
|
||||
show.setText(callnumber + callstate);
|
||||
if (incall_answer.getVisibility() == View.VISIBLE) {
|
||||
incall_answer.setVisibility(View.GONE);
|
||||
SipEngine.getInstance().answer(callid);
|
||||
if (incall_answer.getVisibility() == View.VISIBLE){
|
||||
if(selfCall) {
|
||||
// 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
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
@@ -206,7 +227,10 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
||||
protected void onDestroy() {
|
||||
stopVideoStream(true);
|
||||
super.onDestroy();
|
||||
SipEngine.getInstance().StopdefaultCallMediaPlayer(ringtone);
|
||||
ringtone = null;
|
||||
SipEngine.getInstance().hangup(callid);
|
||||
handler_CallActivity.removeCallbacks(doAutoAnwser);
|
||||
handler_CallActivity = null;
|
||||
if (wakeLock != null) {
|
||||
wakeLock.release();
|
||||
@@ -223,6 +247,7 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
||||
callnumber = bundle.getString("callnumber");
|
||||
callstate = bundle.getString("callstate");
|
||||
calltype = bundle.getInt("calltype");
|
||||
selfCall = bundle.getBoolean("selfCall");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,6 +265,9 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
||||
@Override
|
||||
public boolean handleMessage(Message m) {
|
||||
switch (m.what) {
|
||||
case CONS.ONGETCALLID:
|
||||
callid = (int)m.obj;
|
||||
break;
|
||||
case CONS.CALLSTATE:
|
||||
callstate = (String) m.obj;
|
||||
show.setText(callnumber + callstate);
|
||||
@@ -267,6 +295,9 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
||||
stopVideoStream(true);
|
||||
finish();
|
||||
break;
|
||||
case -2:
|
||||
answer();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -326,12 +357,23 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
||||
}
|
||||
break;
|
||||
case R.id.incall_answer:
|
||||
incall_answer.setVisibility(View.GONE);
|
||||
SipEngine.getInstance().answer(callid);
|
||||
// incall_answer.setVisibility(View.GONE);
|
||||
// SipEngine.getInstance().answer(callid);
|
||||
// SipEngine.getInstance().StopdefaultCallMediaPlayer(ringtone);
|
||||
// ringtone = null;
|
||||
answer();
|
||||
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) {
|
||||
if (show) {
|
||||
|
||||
@@ -7,11 +7,13 @@ import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.media.Ringtone;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.PowerManager;
|
||||
import android.os.PowerManager.WakeLock;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
@@ -81,8 +83,13 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
private String callnumber = "未知";
|
||||
private String callstate = "未知";
|
||||
private int calltype = 0; //0音频1视频
|
||||
private boolean selfCall = false;
|
||||
private boolean VIDEOSTATE = false;
|
||||
public static Intent incallIntent;
|
||||
private Ringtone ringtone;
|
||||
|
||||
|
||||
private boolean isinited = false;
|
||||
|
||||
TrAdapter adapterUser;
|
||||
|
||||
@@ -141,28 +148,39 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
KeyguardManager.KeyguardLock kl = km.newKeyguardLock("unLock");
|
||||
kl.disableKeyguard();
|
||||
initview();
|
||||
|
||||
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||
imageButtonAddUser.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
imageButtonAddUser.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
incallIntent = getIntent();
|
||||
setDate(this.getIntent());
|
||||
|
||||
allUsers.clear();
|
||||
setUsers();
|
||||
getMembers();
|
||||
getMemberTimer();
|
||||
initTabAndPager();
|
||||
mTabSegment.setVisibility(View.INVISIBLE);
|
||||
// getMembers();
|
||||
getMemberTimer();
|
||||
}
|
||||
|
||||
static void getMemberTimer() {
|
||||
CONS.SENDMESSAGETO(handler_CallActivity, -1, null);
|
||||
handler_CallActivity.postDelayed(getMemberRunner, 2000);
|
||||
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() {
|
||||
if(isinited) return;
|
||||
isinited = true;
|
||||
View view = findViewById(R.id.IncallMeetingRoot);
|
||||
gridUser = view.findViewById(R.id.GridUser);
|
||||
show = (TextView) findViewById(R.id.show);
|
||||
@@ -175,6 +193,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
remoteRender = (SMSurfaceViewRenderer) findViewById(R.id.remote_video_view);
|
||||
localRenderLayout = (SMPercentFrameLayout) findViewById(R.id.local_video_layout);
|
||||
remoteRenderLayout = (SMPercentFrameLayout) findViewById(R.id.remote_video_layout);
|
||||
logmy.e("new EngineServer============================" + System.currentTimeMillis());
|
||||
engineServer = new EngineServer(localRender, remoteRender, localRenderLayout, remoteRenderLayout, true);
|
||||
|
||||
incall_mute = findViewById(R.id.incall_mute);
|
||||
@@ -187,11 +206,6 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
mTabSegment = findViewById(R.id.ScreenType);
|
||||
mContentViewPager = findViewById(R.id.contentViewPager);
|
||||
imageButtonAddUser = findViewById(R.id.imageButtonAddUser);
|
||||
if (DBUser.mySelf.isManager) {
|
||||
imageButtonAddUser.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
imageButtonAddUser.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void initTabAndPager() {
|
||||
@@ -312,10 +326,13 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
DBUser d = (DBUser) data;
|
||||
if(d.isOffline()) {
|
||||
return;
|
||||
}
|
||||
QMUIQuickAction qa = QMUIPopups.quickAction(InCallMeetingActivity.this,
|
||||
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56),
|
||||
QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 56))
|
||||
@@ -323,55 +340,15 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
.dimAmount(0.5f)
|
||||
.skinManager(QMUISkinManager.defaultInstance(InCallMeetingActivity.this))
|
||||
.edgeProtection(QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 20));
|
||||
if (DBUser.mySelf.isManager) {
|
||||
if (d.isMute) {
|
||||
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, 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(R.drawable.mute).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(R.drawable.video).text("恢复视频").onClick(
|
||||
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||
if(d.isBusy()) {
|
||||
if (d.isMute) {
|
||||
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.unvmuteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||
Net.unmuteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||
@Override
|
||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||
getMembers();
|
||||
@@ -385,12 +362,12 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
}
|
||||
));
|
||||
} else {
|
||||
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.unvideo).text("停止视频").onClick(
|
||||
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.vmuteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||
Net.muteMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||
@Override
|
||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||
getMembers();
|
||||
@@ -405,48 +382,115 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
));
|
||||
}
|
||||
|
||||
qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.fullscreen).text("主界面").onClick(
|
||||
if (VIDEOSTATE) {
|
||||
if (d.isVMute) {
|
||||
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, 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(R.drawable.unvideo).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() {
|
||||
@Override
|
||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||
quickAction.dismiss();
|
||||
Net.vidfloorMember4Group(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(android.R.drawable.ic_delete).text("移除").onClick(
|
||||
new QMUIQuickAction.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||
quickAction.dismiss();
|
||||
Net.vidfloorMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||
QMUITipDialog dialog = UIUtl.toastLoading("");
|
||||
Net.kickMember4Group(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);
|
||||
}
|
||||
}
|
||||
));
|
||||
}
|
||||
} 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();
|
||||
}
|
||||
|
||||
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();
|
||||
QMUITipDialog dialog = UIUtl.toastLoading("");
|
||||
Net.kickMember4Group(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);
|
||||
@Override
|
||||
public void onRequestError(int cmd, String result, Object orgs) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
));
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
qa.show(view);
|
||||
}
|
||||
@@ -471,9 +515,10 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
incall_answer.setVisibility(View.VISIBLE);
|
||||
incall_mute.setVisibility(View.GONE);
|
||||
incall_muteVideo.setVisibility(View.GONE);
|
||||
ringtone = SipEngine.getInstance().PlaydefaultCallMediaPlayer(this);
|
||||
} else {
|
||||
incall_answer.setVisibility(View.GONE);
|
||||
if (DBUser.mySelf.isManager) {
|
||||
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||
incall_mute.setVisibility(View.VISIBLE);
|
||||
if (VIDEOSTATE) {
|
||||
incall_muteVideo.setVisibility(View.VISIBLE);
|
||||
@@ -484,12 +529,28 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
}
|
||||
show.setText(callnumber + callstate);
|
||||
//控件显示号码,来电,去电,通话中...
|
||||
if (incall_answer.getVisibility() == View.VISIBLE) {
|
||||
incall_answer.setVisibility(View.GONE);
|
||||
SipEngine.getInstance().answer(callid);
|
||||
if (incall_answer.getVisibility() == View.VISIBLE ) {
|
||||
if(selfCall) {
|
||||
// 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
|
||||
protected void onPause() {
|
||||
@@ -501,8 +562,11 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
protected void onDestroy() {
|
||||
stopVideoStream(true);
|
||||
super.onDestroy();
|
||||
SipEngine.getInstance().StopdefaultCallMediaPlayer(ringtone);
|
||||
ringtone = null;
|
||||
SipEngine.getInstance().hangup(callid);
|
||||
handler_CallActivity.removeCallbacks(getMemberRunner);
|
||||
handler_CallActivity.removeCallbacks(doAutoAnwser);
|
||||
handler_CallActivity = null;
|
||||
if (wakeLock != null) {
|
||||
wakeLock.release();
|
||||
@@ -520,6 +584,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
callnumber = bundle.getString("callnumber");
|
||||
callstate = bundle.getString("callstate");
|
||||
calltype = bundle.getInt("calltype");
|
||||
selfCall = bundle.getBoolean("selfCall");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -529,6 +594,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
*/
|
||||
public synchronized void stopVideoStream(boolean isExit) {
|
||||
if (VIDEOSTATE && engineServer != null) {
|
||||
logmy.e("stopVideoStream============================" + System.currentTimeMillis());
|
||||
engineServer.stopVideoStream(isExit);
|
||||
VIDEOSTATE = false;
|
||||
}
|
||||
@@ -537,6 +603,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
@Override
|
||||
public boolean handleMessage(Message m) {
|
||||
switch (m.what) {
|
||||
case CONS.ONGETCALLID:
|
||||
callid = (int)m.obj;
|
||||
break;
|
||||
case CONS.CALLSTATE:
|
||||
callstate = (String) m.obj;
|
||||
show.setText(callnumber + callstate);
|
||||
@@ -551,10 +620,12 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
int l = utils.getL();
|
||||
int payload = utils.getPayload();
|
||||
if (r != 0 || l != 0) {
|
||||
mTabSegment.setVisibility(View.VISIBLE);
|
||||
//开始视频
|
||||
ShowVideoView(true);
|
||||
startVideoStream(SipEngine.getInstance().getip(), r, l, payload);
|
||||
} else {
|
||||
mTabSegment.setVisibility(View.INVISIBLE);
|
||||
//开始音频
|
||||
stopVideoStream(false);
|
||||
ShowVideoView(false);
|
||||
@@ -570,6 +641,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
case -1:
|
||||
getMembers();
|
||||
break;
|
||||
case -2:
|
||||
answer();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -593,7 +667,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
break;
|
||||
}
|
||||
c = 0;
|
||||
logmy.e(callnumber + "--" + server + "--" + rport + "--" + lport);
|
||||
logmy.e("startVideoStream=============="+ callnumber + "--" + server + "--" + rport + "--" + lport +"====" + System.currentTimeMillis());
|
||||
if (engineServer != null) {
|
||||
ShowVideoView(true);
|
||||
/*
|
||||
@@ -616,7 +690,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
engineServer.startVideoStream(this, server, rport, lport, payload, BitRate, FrameRate, w, h, c, true);
|
||||
VIDEOSTATE = true;
|
||||
|
||||
if (DBUser.mySelf.isManager) {
|
||||
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||
incall_mute.setVisibility(View.VISIBLE);
|
||||
incall_muteVideo.setVisibility(View.VISIBLE);
|
||||
}
|
||||
@@ -634,11 +708,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
}
|
||||
break;
|
||||
case R.id.incall_answer:
|
||||
incall_answer.setVisibility(View.GONE);
|
||||
if (DBUser.mySelf.isManager) {
|
||||
incall_mute.setVisibility(View.VISIBLE);
|
||||
}
|
||||
SipEngine.getInstance().answer(callid);
|
||||
answer();
|
||||
break;
|
||||
case R.id.incall_mute:
|
||||
muteAll(v);
|
||||
@@ -648,6 +718,16 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
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,
|
||||
@@ -770,9 +850,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
List<String> list = new ArrayList<>();
|
||||
List<String> listPhone = new ArrayList<>();
|
||||
for (DBUser u : DBUser.allUser) {
|
||||
if (!containMember(u.phone)) {
|
||||
if (!containMember(u.phone) || u.isOnline()) {
|
||||
listPhone.add(u.phone);
|
||||
list.add(u.phone + " | " + u.name);
|
||||
list.add(u.phone + " " + u.name);
|
||||
}
|
||||
}
|
||||
if (list.size() == 0) {
|
||||
@@ -809,6 +889,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
String phNum = listPhone.get(selectIndexs[i]);
|
||||
members = members + phNum + ",";
|
||||
}
|
||||
if(members.length() > 0) {
|
||||
members = members.substring(0, members.length() - 1);
|
||||
}
|
||||
|
||||
Net.addMember2Group(callnumber, members, new HttpUtl.CallBack() {
|
||||
@Override
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
package com.tianrun.sipcall.db;
|
||||
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class DBGroup {
|
||||
public DBHead head;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.tianrun.sipcall.db;
|
||||
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.tianrun.sipcall.net.Net;
|
||||
@@ -19,6 +23,7 @@ public class DBRoot {
|
||||
case Net.CMD_getGroupMenbers:
|
||||
JSONObject o = JSONObject.parseObject(content);
|
||||
DBGroup.onGetGroupMembers(o);
|
||||
DBUser.onGetGroupMembers(o);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.tianrun.sipcall.db;
|
||||
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -18,12 +19,16 @@ public class DBUser {
|
||||
public String name = "";
|
||||
public String phone = "";
|
||||
public String status = "";
|
||||
public int groupOrder = 0;
|
||||
public int priority = 0;
|
||||
public boolean isManager = true;
|
||||
public boolean isAddFlag = false;
|
||||
|
||||
public boolean isMute = false;
|
||||
public boolean isVMute = false;
|
||||
public boolean isLayout = false;
|
||||
public boolean isEmpty = false;
|
||||
private static final String TAG = "DBUser";
|
||||
|
||||
public DBUser(String name, String phone, String status) {
|
||||
this.name = name;
|
||||
@@ -31,20 +36,34 @@ public class DBUser {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public DBUser () {
|
||||
}
|
||||
|
||||
public DBUser(JSONObject d) {
|
||||
this.name = d.getString("name");
|
||||
this.phone = d.getString("extn");
|
||||
this.status = d.getString("sip_state");
|
||||
String weight = d.getString("weight");
|
||||
if (weight != null) {
|
||||
this.isManager = weight.equals("1") ? true : false;
|
||||
} else {
|
||||
this.isManager = false;
|
||||
try {
|
||||
this.name = d.getString("name");
|
||||
this.phone = d.getString("extn");
|
||||
this.status = d.getString("sip_state");
|
||||
status = status == null ? "" : status;
|
||||
String weight = d.getString("weight");
|
||||
if (weight != null) {
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
public boolean isBusy() {
|
||||
@@ -62,8 +81,23 @@ public class DBUser {
|
||||
public static void onGetUsers(JSONArray array) {
|
||||
allUser.clear();
|
||||
DBUser u;
|
||||
int cellSize = 5;
|
||||
int oldGroupOrder = -1;
|
||||
for (Object o : array) {
|
||||
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);
|
||||
mapUsers.put(u.phone, u);
|
||||
if (mySelf != null && u.phone.equals(mySelf.phone)) {
|
||||
@@ -72,6 +106,29 @@ public class DBUser {
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
return mapUsers.get(phoneNo);
|
||||
}
|
||||
|
||||
@@ -108,6 +108,10 @@ public class LoginActivity extends TrBaseActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if(dialogLoading != null) {
|
||||
dialogLoading.dismiss();
|
||||
dialogLoading = null;
|
||||
}
|
||||
if (InCallActivity.handler_CallActivity != null) {
|
||||
startActivity(InCallActivity.incallIntent);
|
||||
return;
|
||||
@@ -206,6 +210,10 @@ public class LoginActivity extends TrBaseActivity {
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if(dialogLoading != null) {
|
||||
dialogLoading.dismiss();
|
||||
dialogLoading = null;
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@@ -219,17 +227,19 @@ public class LoginActivity extends TrBaseActivity {
|
||||
case CONS.LOGINFAILED:
|
||||
if(dialogLoading != null) {
|
||||
dialogLoading.dismiss();
|
||||
dialogLoading = null;
|
||||
}
|
||||
break;
|
||||
case CONS.LOGIN:
|
||||
if(dialogLoading != null) {
|
||||
dialogLoading.dismiss();
|
||||
dialogLoading = null;
|
||||
}
|
||||
if (isEnable()) {
|
||||
saveUserInfor(this.name, this.pw, this.ip, this.port);
|
||||
}
|
||||
startActivity(new Intent(this, MainActivity.class));
|
||||
DBUser.mySelf = new DBUser("", this.name, "true");
|
||||
startActivity(new Intent(this, MainActivity.class));
|
||||
finish();
|
||||
break;
|
||||
}
|
||||
@@ -369,17 +379,17 @@ public class LoginActivity extends TrBaseActivity {
|
||||
}
|
||||
|
||||
public void exit2(View view) {
|
||||
// Net.login(this.name, this.pw, new HttpUtl.CallBack() {
|
||||
// @Override
|
||||
// public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||
// ActivityMgr.sendMsg(CONS.LOGIN, null);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onRequestError(int cmd, String result, Object orgs) {
|
||||
// UIUtl.toastI("取得token失败");
|
||||
// }
|
||||
// }, null);
|
||||
Net.login("5503", "!@#123Qw", new HttpUtl.CallBack() {
|
||||
@Override
|
||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||
ActivityMgr.sendMsg(CONS.LOGIN, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestError(int cmd, String result, Object orgs) {
|
||||
UIUtl.toastI("取得token失败");
|
||||
}
|
||||
}, null);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,13 @@ import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.ParcelUuid;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
@@ -19,6 +21,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
@@ -72,7 +75,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
AudioManager audioManager;
|
||||
ImageView buttonAddVol;
|
||||
ImageView buttonDelVol;
|
||||
DBHead currSelectData;
|
||||
public static DBHead currSelectData;
|
||||
ImageView imageViewSelfStatus;
|
||||
TextView textViewSelfStatus;
|
||||
|
||||
@@ -168,6 +171,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
|
||||
// 处理当前分机号可能有需要加入的会议
|
||||
private void checkBeforeMeetingState() {
|
||||
if(DBUser.mySelf == null) return;
|
||||
Net.getUserInfor(DBUser.mySelf.phone, new HttpUtl.CallBack() {
|
||||
@Override
|
||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||
@@ -213,6 +217,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
mTabSegment.notifyDataChanged();
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private void initTabAndPager() {
|
||||
mContentViewPager.setAdapter(mPagerAdapter);
|
||||
// mContentViewPager.setCurrentItem(mDestPage.getPosition(), false);
|
||||
@@ -220,7 +225,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
for (int i = 0; i < headers.size(); i++) {
|
||||
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(
|
||||
QMUIDisplayHelper.dp2px(this, 2), false, true));
|
||||
mTabSegment.setMode(QMUITabSegment.MODE_SCROLLABLE);
|
||||
@@ -238,7 +243,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
} else {
|
||||
StartMeetingVoice.setVisibility(View.VISIBLE);
|
||||
StartMeetingVideo.setVisibility(View.VISIBLE);
|
||||
if (DBUser.mySelf.isManager) {
|
||||
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||
ButtonDelGroup.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
ButtonDelGroup.setVisibility(View.INVISIBLE);
|
||||
@@ -257,7 +262,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
allUsers.addAll(group.users);
|
||||
}
|
||||
//根据权限来处理
|
||||
if (DBUser.mySelf.isManager) {
|
||||
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||
DBUser u = new DBUser("", "添加分机", "false");
|
||||
u.isAddFlag = true;
|
||||
allUsers.add(u);
|
||||
@@ -299,10 +304,10 @@ public class MainActivity extends TrBaseActivity {
|
||||
imageViewAddGroupIcon.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
if (DBUser.mySelf.isBusy()) {
|
||||
if (DBUser.mySelf != null && DBUser.mySelf.isBusy()) {
|
||||
imageViewSelfStatus.setColorFilter(Color.RED);
|
||||
textViewSelfStatus.setText("通话中");
|
||||
} else if (DBUser.mySelf.isOnline()) {
|
||||
} else if (DBUser.mySelf != null && DBUser.mySelf.isOnline()) {
|
||||
imageViewSelfStatus.setColorFilter(Color.GREEN);
|
||||
textViewSelfStatus.setText("在线");
|
||||
} else {
|
||||
@@ -342,7 +347,11 @@ public class MainActivity extends TrBaseActivity {
|
||||
}
|
||||
|
||||
public static void getUsersData() {
|
||||
Net.getUsers(null, null);
|
||||
if(currSelectData != null && !currSelectData.isAll()) {
|
||||
Net.getGroupMenbers(currSelectData.id, null, currSelectData.id);
|
||||
} else {
|
||||
Net.getUsers(null, null);
|
||||
}
|
||||
mainHandler.postDelayed(runGetUsers, 3000);
|
||||
}
|
||||
|
||||
@@ -417,7 +426,7 @@ 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(
|
||||
new QMUIQuickAction.OnClickListener() {
|
||||
@Override
|
||||
@@ -460,7 +469,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
for (DBUser u : DBUser.allUser) {
|
||||
if (!group.containsUser(u.phone)) {
|
||||
listPhone.add(u.phone);
|
||||
list.add(u.phone + " | " + u.name);
|
||||
list.add(u.phone + " " + u.name);
|
||||
}
|
||||
}
|
||||
if (list.size() == 0) {
|
||||
@@ -497,6 +506,9 @@ public class MainActivity extends TrBaseActivity {
|
||||
String phNum = listPhone.get(selectIndexs[i]);
|
||||
members = members + phNum + ",";
|
||||
}
|
||||
if(members.length() > 0) {
|
||||
members = members.substring(0, members.length() - 1);
|
||||
}
|
||||
|
||||
Net.addMember2Group(currSelectData.audio_code, members, new HttpUtl.CallBack() {
|
||||
@Override
|
||||
@@ -571,7 +583,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
allUsers.clear();
|
||||
allUsers.addAll(group.users);
|
||||
//根据权限来处理
|
||||
if (DBUser.mySelf.isManager) {
|
||||
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||
DBUser u = new DBUser("", "添加分机", "false");
|
||||
u.isAddFlag = true;
|
||||
allUsers.add(u);
|
||||
@@ -615,16 +627,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
}
|
||||
|
||||
public void logout(View v) {
|
||||
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);
|
||||
startActivity(intent);
|
||||
UIUtl.doLogout();
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
@@ -42,18 +42,22 @@ public class Net {
|
||||
Object[] _params = (Object[]) params;
|
||||
HttpUtl.CallBack callback = (HttpUtl.CallBack) (_params[0]);
|
||||
Object orgs = _params[1];
|
||||
if (ActivityMgr.topActivity != null && callback != null) {
|
||||
ActivityMgr.topActivity.handler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (callback != null) {
|
||||
callback.onRequestComplete(cmd, result, orgs);
|
||||
try {
|
||||
if (ActivityMgr.topActivity != null && callback != null) {
|
||||
ActivityMgr.topActivity.handler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
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
|
||||
@@ -72,7 +76,10 @@ public class Net {
|
||||
}
|
||||
});
|
||||
}
|
||||
UIUtl.toastI(result);
|
||||
// UIUtl.toastI(result);
|
||||
if(cmd == CMD_getUsers) {
|
||||
UIUtl.doLogout();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -11,26 +11,41 @@ import java.util.concurrent.ConcurrentSkipListSet;
|
||||
public class ActivityMgr {
|
||||
public static Map<Class, TrBaseActivity> actives = new ConcurrentHashMap<>();
|
||||
public static TrBaseActivity topActivity;
|
||||
public static TrBaseActivity getActivity(Class _class){
|
||||
|
||||
public static TrBaseActivity getActivity(Class _class) {
|
||||
return actives.get(_class);
|
||||
}
|
||||
|
||||
public static void onShowActivity(TrBaseActivity a) {
|
||||
topActivity = a;
|
||||
if(!actives.containsKey(a.getClass())) {
|
||||
if (!actives.containsKey(a.getClass())) {
|
||||
actives.put(a.getClass(), a);
|
||||
}
|
||||
}
|
||||
|
||||
public static void onHideActivity(TrBaseActivity a) {
|
||||
UIUtl.onHideActivity(a);
|
||||
actives.remove(a.getClass());
|
||||
if(a == topActivity) {
|
||||
if (a == topActivity) {
|
||||
topActivity = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendMsg(int menu, Object obj) {
|
||||
for(TrBaseActivity a : actives.values()) {
|
||||
CONS.SENDMESSAGETO( a.handler, menu, obj);
|
||||
}
|
||||
for (TrBaseActivity a : actives.values()) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ public class TrBaseActivity extends AppCompatActivity implements Handler.Callbac
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ActivityMgr.onShowActivity(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.tianrun.sipcall.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.GridView;
|
||||
@@ -9,13 +11,54 @@ import android.widget.Toast;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
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.QMUITipDialog;
|
||||
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.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
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) {
|
||||
if (ActivityMgr.topActivity == null) return;
|
||||
try {
|
||||
@@ -27,7 +70,7 @@ public class UIUtl {
|
||||
.setTipWord(tip)
|
||||
.create();
|
||||
tipDialog.show();
|
||||
hideToast(tipDialog);
|
||||
hideToast(ActivityMgr.topActivity, tipDialog);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
@@ -46,7 +89,7 @@ public class UIUtl {
|
||||
.setTipWord(tip)
|
||||
.create();
|
||||
tipDialog.show();
|
||||
hideToast(tipDialog);
|
||||
hideToast(ActivityMgr.topActivity, tipDialog);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
@@ -65,7 +108,7 @@ public class UIUtl {
|
||||
.setTipWord(tip)
|
||||
.create();
|
||||
tipDialog.show();
|
||||
hideToast(tipDialog);
|
||||
hideToast(ActivityMgr.topActivity, tipDialog);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
@@ -84,7 +127,7 @@ public class UIUtl {
|
||||
.setTipWord(tip)
|
||||
.create();
|
||||
tipDialog.show();
|
||||
hideToast(tipDialog);
|
||||
hideToast(ActivityMgr.topActivity, tipDialog);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
@@ -103,12 +146,16 @@ public class UIUtl {
|
||||
return tipDialog;
|
||||
}
|
||||
|
||||
private static void hideToast(QMUITipDialog tipDialog) {
|
||||
if (ActivityMgr.topActivity == null) return;
|
||||
ActivityMgr.topActivity.handler.postDelayed(new Runnable() {
|
||||
private static void hideToast(TrBaseActivity activity, QMUITipDialog tipDialog) {
|
||||
if (activity == null) return;
|
||||
activity.handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
ArrayList<QMUIBaseDialog> list = activesWithDialogs.get(activity.getClass());
|
||||
if(list != null && list.contains(tipDialog)) {
|
||||
list.remove(tipDialog);
|
||||
}
|
||||
tipDialog.dismiss();
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
@@ -168,4 +215,21 @@ public class UIUtl {
|
||||
}
|
||||
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 showpic = 209;
|
||||
public static final int LOGINFAILED = 210;
|
||||
public static final int ONGETCALLID = 211;
|
||||
|
||||
public static void SENDMESSAGETO(Handler handler, int menu, Object object) {
|
||||
if (handler != null) {
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.util.Map;
|
||||
* Http请求的工具类
|
||||
*
|
||||
* @author suming
|
||||
*
|
||||
*/
|
||||
public class HttpUtl {
|
||||
|
||||
@@ -40,11 +39,12 @@ public class HttpUtl {
|
||||
|
||||
public interface CallBack {
|
||||
void onRequestComplete(int cmd, String result, Object orgs);
|
||||
|
||||
void onRequestError(int cmd, String result, Object orgs);
|
||||
}
|
||||
|
||||
|
||||
public static String token;
|
||||
public static String token = null;
|
||||
|
||||
/**
|
||||
* 异步的Get请求
|
||||
@@ -67,7 +67,7 @@ public class HttpUtl {
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class HttpUtl {
|
||||
callBack.onRequestError(cmd, e.toString(), orgs);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}.start();
|
||||
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public class HttpUtl {
|
||||
conn.setRequestProperty("connection", "Keep-Alive");
|
||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
conn.setRequestProperty("charset", "utf-8");
|
||||
if(token != null) {
|
||||
if (token != null) {
|
||||
conn.setRequestProperty("X-Auth-Token", token);
|
||||
}
|
||||
int retCode = conn.getResponseCode();
|
||||
@@ -152,8 +152,12 @@ public class HttpUtl {
|
||||
Log.i("http", baos.toString());
|
||||
}
|
||||
return baos.toString();
|
||||
} else {
|
||||
} else if (retCode == 401) {
|
||||
checkTokenFailed(retCode);
|
||||
return "";
|
||||
} else {
|
||||
UIUtl.toastI("内部错误");
|
||||
Log.e("http", urlStr);
|
||||
throw new RuntimeException(" responseCode :" + retCode);
|
||||
}
|
||||
|
||||
@@ -177,35 +181,20 @@ public class HttpUtl {
|
||||
}
|
||||
|
||||
static void checkTokenFailed(int code) {
|
||||
if(code == 401) {
|
||||
UIUtl.toastI("Token 失效");
|
||||
|
||||
if(ActivityMgr.topActivity != null) {
|
||||
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);
|
||||
}
|
||||
if (code == 401) {
|
||||
UIUtl.doLogout();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向指定 URL 发送POST方法的请求
|
||||
*
|
||||
* @param url
|
||||
* 发送请求的 URL
|
||||
* @param param
|
||||
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
|
||||
* @param url 发送请求的 URL
|
||||
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
|
||||
* @return 所代表远程资源的响应结果
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String doPost(String url, String param) {
|
||||
public static String doPost(String url, String param) throws Exception {
|
||||
PrintWriter out = null;
|
||||
BufferedReader in = null;
|
||||
String result = "";
|
||||
@@ -219,7 +208,7 @@ public class HttpUtl {
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
conn.setRequestProperty("charset", "utf-8");
|
||||
if(token != null) {
|
||||
if (token != null) {
|
||||
conn.setRequestProperty("X-Auth-Token", token);
|
||||
}
|
||||
conn.setUseCaches(false);
|
||||
@@ -243,12 +232,19 @@ public class HttpUtl {
|
||||
while ((line = in.readLine()) != null) {
|
||||
result += line;
|
||||
}
|
||||
if (result .equals("{}")){
|
||||
result = conn.getResponseCode()+"";
|
||||
if (result.equals("{}")) {
|
||||
result = conn.getResponseCode() + "";
|
||||
}
|
||||
|
||||
int retCode = conn.getResponseCode();
|
||||
checkTokenFailed(retCode);
|
||||
|
||||
if (retCode == 200) {
|
||||
} else if(retCode == 401) {
|
||||
checkTokenFailed(retCode);
|
||||
} else {
|
||||
UIUtl.toastI("内部错误");
|
||||
throw new RuntimeException(" responseCode :" + retCode);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.i("http", e.toString());
|
||||
@@ -266,7 +262,7 @@ public class HttpUtl {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (result==null&&result.equals("")) {
|
||||
if (result == null && result.equals("")) {
|
||||
Log.i("http", "result为空");
|
||||
} else {
|
||||
Log.i("http", result);
|
||||
@@ -301,7 +297,7 @@ public class HttpUtl {
|
||||
conn.setRequestProperty("connection", "keep-alive");
|
||||
conn.setRequestProperty("Charsert", "UTF-8");
|
||||
conn.setRequestProperty("Content-Type", MULTIPART_FROM_DATA + ";boundary=" + BOUNDARY);
|
||||
if(token != null) {
|
||||
if (token != null) {
|
||||
conn.setRequestProperty("X-Auth-Token", token);
|
||||
}
|
||||
// 首先组拼文本类型的参数
|
||||
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 27 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 |
|
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 |
@@ -178,6 +178,7 @@
|
||||
android:textColor="#CCCCCC"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
android:clickable="false">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:id="@+id/videobutton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:onClick="doMeetingVideo4Group"
|
||||
@@ -272,7 +272,7 @@
|
||||
android:textAlignment="viewEnd" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:id="@+id/imageView22"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentStart="true"
|
||||
@@ -291,7 +291,7 @@
|
||||
android:focusableInTouchMode="false">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:id="@+id/delGroupbutton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:onClick="deleteGroup"
|
||||
@@ -300,7 +300,7 @@
|
||||
android:textColor="#F44336" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:id="@+id/imageView3"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentStart="true"
|
||||
@@ -328,7 +328,7 @@
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:id="@+id/imageView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
@@ -336,7 +336,7 @@
|
||||
app:tint="#5EE463" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:id="@+id/textView5"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
@@ -354,7 +354,7 @@
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:id="@+id/imageView6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
@@ -362,7 +362,7 @@
|
||||
app:tint="#F44336" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:id="@+id/textView7"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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_height="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/callbackground" >
|
||||
|
||||
<blue.view.SMPercentFrameLayout
|
||||
@@ -35,7 +36,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible" />
|
||||
</blue.view.SMPercentFrameLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="60dp"
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/IncallMeetingRoot"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/callbackground"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView3"
|
||||
@@ -56,7 +58,7 @@
|
||||
android:id="@+id/remote_video_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible">
|
||||
android:visibility="invisible">
|
||||
|
||||
<blue.view.SMSurfaceViewRenderer
|
||||
android:id="@+id/remote_video_view"
|
||||
@@ -69,7 +71,7 @@
|
||||
android:id="@+id/local_video_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible">
|
||||
android:visibility="invisible">
|
||||
|
||||
<blue.view.SMSurfaceViewRenderer
|
||||
android:id="@+id/local_video_view"
|
||||
|
||||
@@ -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>
|
||||
<string name="app_name">SIP电话</string>
|
||||
<string name="app_name">视频对讲指挥系统</string>
|
||||
<string name="title_activity_scrolling">ScrollingActivity</string>
|
||||
<string name="large_text">
|
||||
"Material is the metaphor.\n\n"
|
||||
|
||||
@@ -5,11 +5,10 @@ buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
||||
|
||||
}
|
||||
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
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
@@ -19,7 +18,6 @@ allprojects {
|
||||
repositories {
|
||||
google()
|
||||
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
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
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
|
||||
|
||||