Compare commits

...

2 Commits

Author SHA1 Message Date
2ce5beace4 upgrade 2020-09-15 17:57:15 +08:00
ad03559dac modify 2020-09-14 16:43:36 +08:00
20 changed files with 610 additions and 155 deletions

View File

@@ -117,6 +117,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 +133,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 +152,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) {

View File

@@ -56,6 +56,7 @@ public class CreateGroupActivity extends TrBaseActivity {
DBUser u = new DBUser("", "添加分机号", ""); DBUser u = new DBUser("", "添加分机号", "");
u.isAddFlag = true; u.isAddFlag = true;
users.add(u); users.add(u);
users.add(DBUser.mySelf);
setList(null); setList(null);
} }
@@ -219,6 +220,11 @@ public class CreateGroupActivity extends TrBaseActivity {
} }
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("请添加要加入会议的分机号");

View File

@@ -174,7 +174,7 @@ 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.isBusy())) { // 只有空间的才加入
listPhone.add(u.phone); listPhone.add(u.phone);
list.add(u.phone + " | " + u.name); list.add(u.phone + " | " + u.name);
} }
@@ -256,16 +256,17 @@ public class CreateMeetingActivity extends TrBaseActivity {
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();
} }

View File

@@ -2,7 +2,6 @@ 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;
@@ -39,10 +38,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 +67,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;
@@ -148,9 +147,21 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
allUsers.clear(); allUsers.clear();
setUsers(); setUsers();
getMembers(); getMembers();
getMemberTimer();
initTabAndPager(); initTabAndPager();
} }
static void getMemberTimer() {
CONS.SENDMESSAGETO(handler_CallActivity, -1, null);
handler_CallActivity.postDelayed(getMemberRunner, 2000);
}
static Runnable getMemberRunner = new Runnable() {
@Override
public void run() {
getMemberTimer();
}
};
private void initview() { private void initview() {
View view = findViewById(R.id.IncallMeetingRoot); View view = findViewById(R.id.IncallMeetingRoot);
gridUser = view.findViewById(R.id.GridUser); gridUser = view.findViewById(R.id.GridUser);
@@ -166,6 +177,13 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
remoteRenderLayout = (SMPercentFrameLayout) findViewById(R.id.remote_video_layout); remoteRenderLayout = (SMPercentFrameLayout) findViewById(R.id.remote_video_layout);
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);
@@ -253,6 +271,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,6 +292,22 @@ 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
@@ -289,7 +325,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
.edgeProtection(QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 20)); .edgeProtection(QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 20));
if (DBUser.mySelf.isManager) { if (DBUser.mySelf.isManager) {
if (d.isMute) { if (d.isMute) {
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("取消禁言").onClick( qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.unmute).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) {
@@ -308,7 +344,7 @@ 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) {
@@ -330,7 +366,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
if (VIDEOSTATE) { if (VIDEOSTATE) {
if (d.isVMute) { if (d.isVMute) {
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("复视频").onClick( qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.video).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) {
@@ -349,7 +385,7 @@ 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.unvideo).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) {
@@ -369,27 +405,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
)); ));
} }
if (d.isLayout) { qa.addAction(new QMUIQuickAction.Action().icon(R.drawable.fullscreen).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.vidlayoutMember4Group(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() { 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,7 +424,6 @@ 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() {
@@ -454,8 +469,18 @@ 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);
} else { } else {
incall_answer.setVisibility(View.GONE); incall_answer.setVisibility(View.GONE);
if (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);
//控件显示号码,来电,去电,通话中... //控件显示号码,来电,去电,通话中...
@@ -477,11 +502,13 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
stopVideoStream(true); stopVideoStream(true);
super.onDestroy(); super.onDestroy();
SipEngine.getInstance().hangup(callid); SipEngine.getInstance().hangup(callid);
handler_CallActivity.removeCallbacks(getMemberRunner);
handler_CallActivity = null; handler_CallActivity = null;
if (wakeLock != null) { if (wakeLock != null) {
wakeLock.release(); wakeLock.release();
wakeLock = null; wakeLock = null;
} }
} }
/** /**
@@ -540,6 +567,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
case Net case Net
.CMD_getGroupMenbers: .CMD_getGroupMenbers:
break; break;
case -1:
getMembers();
break;
} }
return true; return true;
} }
@@ -585,6 +615,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.isManager) {
incall_mute.setVisibility(View.VISIBLE);
incall_muteVideo.setVisibility(View.VISIBLE);
}
} }
} }
@@ -600,11 +635,113 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
break; break;
case R.id.incall_answer: case R.id.incall_answer:
incall_answer.setVisibility(View.GONE); incall_answer.setVisibility(View.GONE);
if (DBUser.mySelf.isManager) {
incall_mute.setVisibility(View.VISIBLE);
}
SipEngine.getInstance().answer(callid); SipEngine.getInstance().answer(callid);
break; break;
case R.id.incall_mute:
muteAll(v);
break;
case R.id.incall_muteVideo:
videomuteAll(v);
break;
} }
} }
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) {

View File

@@ -18,7 +18,7 @@ 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 boolean isManager = true;
public boolean isAddFlag = false; public boolean isAddFlag = false;
public boolean isMute = false; public boolean isMute = false;
@@ -36,11 +36,15 @@ public class DBUser {
this.phone = d.getString("extn"); this.phone = d.getString("extn");
this.status = d.getString("sip_state"); this.status = d.getString("sip_state");
String weight = d.getString("weight"); String weight = d.getString("weight");
if(weight != null) { if (weight != null) {
this.isManager = weight.equals("1"); this.isManager = weight.equals("1") ? true : false;
} else { } else {
this.isManager = false; 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;
} }
public boolean isBusy() { public boolean isBusy() {
@@ -62,7 +66,7 @@ public class DBUser {
u = new DBUser((JSONObject) o); u = new DBUser((JSONObject) o);
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;
} }
} }

View File

@@ -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
@@ -122,9 +130,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 +155,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 +174,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,6 +198,8 @@ 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();
} }
@@ -344,17 +369,17 @@ 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(this.name, this.pw, 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);
} // }
//
@Override // @Override
public void onRequestError(int cmd, String result, Object orgs) { // public void onRequestError(int cmd, String result, Object orgs) {
UIUtl.toastI("取得token失败"); // UIUtl.toastI("取得token失败");
} // }
}, null); // }, null);
} }
} }

View File

@@ -7,6 +7,7 @@ import android.graphics.Color;
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.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -56,6 +57,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;
@@ -71,6 +73,8 @@ public class MainActivity extends TrBaseActivity {
ImageView buttonAddVol; ImageView buttonAddVol;
ImageView buttonDelVol; ImageView buttonDelVol;
DBHead currSelectData; DBHead currSelectData;
ImageView imageViewSelfStatus;
TextView textViewSelfStatus;
GridView gridUser; GridView gridUser;
List<Object> allUsers = new ArrayList<>(); List<Object> allUsers = new ArrayList<>();
@@ -119,6 +123,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 +150,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,7 +162,7 @@ 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();
} }
@@ -243,6 +250,7 @@ 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) {
@@ -290,6 +298,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.isBusy()) {
imageViewSelfStatus.setColorFilter(Color.RED);
textViewSelfStatus.setText("通话中");
} else if (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 +333,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 +341,9 @@ public class MainActivity extends TrBaseActivity {
return gridUser; return gridUser;
} }
public void getUsersData() { public static void getUsersData() {
handler.postDelayed(runGetUsers, 3000); Net.getUsers(null, null);
mainHandler.postDelayed(runGetUsers, 3000);
} }
public void setUsers() { public void setUsers() {
@@ -404,7 +424,7 @@ public class MainActivity extends TrBaseActivity {
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("移除分机成功");
@@ -478,7 +498,7 @@ public class MainActivity extends TrBaseActivity {
members = members + phNum + ","; members = members + phNum + ",";
} }
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 +546,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 +556,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);
@@ -555,8 +576,8 @@ public class MainActivity extends TrBaseActivity {
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 +589,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) {

View File

@@ -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
@@ -97,7 +98,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 +129,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 +136,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";

View File

@@ -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,18 @@ 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);
} }
@Override
protected void onStop() {
super.onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
ActivityMgr.onHideActivity(this);
}
} }

View File

@@ -114,7 +114,7 @@ public class UIUtl {
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) {

View File

@@ -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;
@@ -137,13 +146,14 @@ 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 { } else {
checkTokenFailed(retCode);
throw new RuntimeException(" responseCode :" + retCode); throw new RuntimeException(" responseCode :" + retCode);
} }
@@ -166,6 +176,25 @@ public class HttpUtl {
// return null; // return null;
} }
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);
}
}
}
/** /**
* 向指定 URL 发送POST方法的请求 * 向指定 URL 发送POST方法的请求
* *
@@ -217,6 +246,9 @@ public class HttpUtl {
if (result .equals("{}")){ if (result .equals("{}")){
result = conn.getResponseCode()+""; result = conn.getResponseCode()+"";
} }
int retCode = conn.getResponseCode();
checkTokenFailed(retCode);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
Log.i("http", e.toString()); Log.i("http", e.toString());

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -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,229 @@
<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" <TextView
android:padding="10dp"> android:id="@+id/textView3"
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="SIP设置"
android:textColor="#CCCCCC"
android:textSize="18sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="50dp"
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 <EditText
android:id="@+id/username" android:id="@+id/username"
android:layout_width="fill_parent" android:layout_width="0dp"
android:layout_height="50sp" android:layout_height="fill_parent"
android:layout_marginTop="10dp" android:layout_weight="1.5"
android:background="@drawable/corners_black" android:hint="请输入"
android:hint="账号" android:singleLine="true"
android:padding="5dp" android:textColor="#000000"
android:text="5503" android:textSize="16sp" />
android:textColor="@color/blackcolor"
android:textColorHint="@color/gray" </LinearLayout>
android:textSize="15sp" />
<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 <EditText
android:id="@+id/userpw" android:id="@+id/userpw"
android:layout_width="fill_parent" android:layout_width="0dp"
android:layout_height="50sp" android:layout_height="fill_parent"
android:layout_marginTop="10dp" android:layout_weight="1.5"
android:background="@drawable/corners_black" android:hint="请输入"
android:hint="密码" android:singleLine="true"
android:padding="5dp" android:textColor="#000000"
android:text="!@#123Qw" android:textSize="16sp" />
android:textColor="@color/blackcolor"
android:textColorHint="@color/gray" </LinearLayout>
android:textSize="15sp" />
<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 <EditText
android:id="@+id/userip" android:id="@+id/userip"
android:layout_width="fill_parent" android:layout_width="0dp"
android:layout_height="50sp" android:layout_height="fill_parent"
android:layout_marginTop="10dp" android:layout_weight="1.5"
android:background="@drawable/corners_black" android:hint="请输入"
android:hint="服务器地址" android:singleLine="true"
android:padding="5dp" android:textColor="#000000"
android:text="47.111.20.34" android:textSize="16sp" />
android:textColor="@color/blackcolor"
android:textColorHint="@color/gray" </LinearLayout>
android:textSize="15sp" />
<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 <EditText
android:id="@+id/userport" 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 +254,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 +269,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>

View File

@@ -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" />

View File

@@ -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>

View File

@@ -4,8 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
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">
<ImageView <ImageView
android:id="@+id/imageView3" android:id="@+id/imageView3"
@@ -89,6 +88,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 +122,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