Compare commits
2 Commits
56485ff0dd
...
2ce5beace4
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ce5beace4 | |||
| ad03559dac |
@@ -117,6 +117,7 @@ public class SipEngine implements BluetelInterface {
|
||||
this.ip = ip;
|
||||
this.port = port;
|
||||
myBluetelEngine.Register(name, pw, ip, port);
|
||||
isRelogin = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,6 +133,7 @@ public class SipEngine implements BluetelInterface {
|
||||
|
||||
@Override
|
||||
public void AccountState(String uri, boolean state) {
|
||||
if(isRelogin) return;
|
||||
logmy.e(uri + "-->" + state);
|
||||
if (state) {
|
||||
if (!onLine) {
|
||||
@@ -150,12 +152,11 @@ public class SipEngine implements BluetelInterface {
|
||||
}, null);
|
||||
}
|
||||
} else {
|
||||
if(!onLine && !isRelogin) {
|
||||
if(!onLine) {
|
||||
UIUtl.toastI("Sip登陆失败");
|
||||
ActivityMgr.sendMsg(CONS.LOGINFAILED, null);
|
||||
}
|
||||
}
|
||||
isRelogin = false;
|
||||
}
|
||||
|
||||
public boolean isMeetingCall(String phoneNo) {
|
||||
|
||||
@@ -56,6 +56,7 @@ public class CreateGroupActivity extends TrBaseActivity {
|
||||
DBUser u = new DBUser("", "添加分机号", "");
|
||||
u.isAddFlag = true;
|
||||
users.add(u);
|
||||
users.add(DBUser.mySelf);
|
||||
|
||||
setList(null);
|
||||
}
|
||||
@@ -219,6 +220,11 @@ public class CreateGroupActivity extends TrBaseActivity {
|
||||
}
|
||||
|
||||
public void createGroup(View view) {
|
||||
String name = meetingTopic.getText().toString();
|
||||
if(name == null || name.isEmpty()) {
|
||||
UIUtl.toastI("分组名不能为空");
|
||||
return;
|
||||
}
|
||||
String userStr = getSelectedUsers();
|
||||
if (userStr == null || userStr == "") {
|
||||
UIUtl.toastI("请添加要加入会议的分机号");
|
||||
|
||||
@@ -174,7 +174,7 @@ 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) {
|
||||
if (mapUsers.get(u.phone) == null && (!u.isBusy())) { // 只有空间的才加入
|
||||
listPhone.add(u.phone);
|
||||
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() {
|
||||
@Override
|
||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||
JSONObject jo = JSONObject.parseObject(result);
|
||||
if (jo != null) {
|
||||
String code = "";
|
||||
if(isVideo) {
|
||||
code = jo.getString("video_code");
|
||||
} else {
|
||||
code = jo.getString("audio_code");
|
||||
}
|
||||
SipEngine.getInstance().CallNumber(code, isVideo);
|
||||
}
|
||||
// JSONObject jo = JSONObject.parseObject(result);
|
||||
// if (jo != null) {
|
||||
// String code = "";
|
||||
// if(isVideo) {
|
||||
// code = jo.getString("video_code");
|
||||
// } else {
|
||||
// code = jo.getString("audio_code");
|
||||
// }
|
||||
// SipEngine.getInstance().CallNumber(code, isVideo);
|
||||
// }
|
||||
UIUtl.toastS("临时会议创建成功");
|
||||
dialog.dismiss();
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.tianrun.sipcall.call;
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.KeyguardManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
@@ -39,10 +38,8 @@ import com.qmuiteam.qmui.widget.tab.QMUITabIndicator;
|
||||
import com.qmuiteam.qmui.widget.tab.QMUITabSegment;
|
||||
import com.tianrun.sipcall.R;
|
||||
import com.tianrun.sipcall.SipEngine;
|
||||
import com.tianrun.sipcall.db.DBGroup;
|
||||
import com.tianrun.sipcall.db.DBUser;
|
||||
import com.tianrun.sipcall.db.UserMeetingViews;
|
||||
import com.tianrun.sipcall.db.UserViews;
|
||||
import com.tianrun.sipcall.net.Net;
|
||||
import com.tianrun.sipcall.ui.TrAdapter;
|
||||
import com.tianrun.sipcall.ui.TrBaseActivity;
|
||||
@@ -70,6 +67,8 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
private SMPercentFrameLayout remoteRenderLayout;
|
||||
private ImageButton incall_answer, incall_hangup;
|
||||
private View imageButtonAddUser;
|
||||
ImageButton incall_mute;
|
||||
ImageButton incall_muteVideo;
|
||||
private TextView show;
|
||||
GridView gridUser;
|
||||
QMUITabSegment mTabSegment;
|
||||
@@ -148,9 +147,21 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
allUsers.clear();
|
||||
setUsers();
|
||||
getMembers();
|
||||
getMemberTimer();
|
||||
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() {
|
||||
View view = findViewById(R.id.IncallMeetingRoot);
|
||||
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);
|
||||
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);
|
||||
mContentViewPager = findViewById(R.id.contentViewPager);
|
||||
imageButtonAddUser = findViewById(R.id.imageButtonAddUser);
|
||||
@@ -253,6 +271,8 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
} else {
|
||||
views = (UserMeetingViews) (prefabView.getTag());
|
||||
}
|
||||
|
||||
views.memberStatus3.setVisibility(View.GONE);
|
||||
DBUser d = (DBUser) data;
|
||||
views.textViewName.setText(d.name);
|
||||
views.textViewNum.setText(d.phone);
|
||||
@@ -272,6 +292,22 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
views.imageViewPhoneIcon.setVisibility(View.VISIBLE);
|
||||
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
|
||||
@@ -289,7 +325,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
.edgeProtection(QMUIDisplayHelper.dp2px(InCallMeetingActivity.this, 20));
|
||||
if (DBUser.mySelf.isManager) {
|
||||
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() {
|
||||
@Override
|
||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||
@@ -308,7 +344,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
}
|
||||
));
|
||||
} 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() {
|
||||
@Override
|
||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||
@@ -330,7 +366,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
|
||||
if (VIDEOSTATE) {
|
||||
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() {
|
||||
@Override
|
||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||
@@ -349,7 +385,7 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
}
|
||||
));
|
||||
} 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() {
|
||||
@Override
|
||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||
@@ -369,45 +405,24 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
));
|
||||
}
|
||||
|
||||
if (d.isLayout) {
|
||||
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();
|
||||
}
|
||||
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);
|
||||
}
|
||||
@Override
|
||||
public void onRequestError(int cmd, String result, Object orgs) {
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
));
|
||||
} else {
|
||||
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("切换布局").onClick(
|
||||
new QMUIQuickAction.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||
quickAction.dismiss();
|
||||
Net.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(
|
||||
@@ -454,8 +469,18 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
super.onResume();
|
||||
if (callstate.equals("来电")) {
|
||||
incall_answer.setVisibility(View.VISIBLE);
|
||||
incall_mute.setVisibility(View.GONE);
|
||||
incall_muteVideo.setVisibility(View.GONE);
|
||||
} else {
|
||||
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);
|
||||
//控件显示号码,来电,去电,通话中...
|
||||
@@ -477,11 +502,13 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
stopVideoStream(true);
|
||||
super.onDestroy();
|
||||
SipEngine.getInstance().hangup(callid);
|
||||
handler_CallActivity.removeCallbacks(getMemberRunner);
|
||||
handler_CallActivity = null;
|
||||
if (wakeLock != null) {
|
||||
wakeLock.release();
|
||||
wakeLock = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -540,6 +567,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
||||
case Net
|
||||
.CMD_getGroupMenbers:
|
||||
break;
|
||||
case -1:
|
||||
getMembers();
|
||||
break;
|
||||
}
|
||||
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);
|
||||
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;
|
||||
case R.id.incall_answer:
|
||||
incall_answer.setVisibility(View.GONE);
|
||||
if (DBUser.mySelf.isManager) {
|
||||
incall_mute.setVisibility(View.VISIBLE);
|
||||
}
|
||||
SipEngine.getInstance().answer(callid);
|
||||
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) {
|
||||
if (show) {
|
||||
|
||||
@@ -18,7 +18,7 @@ public class DBUser {
|
||||
public String name = "";
|
||||
public String phone = "";
|
||||
public String status = "";
|
||||
public boolean isManager = false;
|
||||
public boolean isManager = true;
|
||||
public boolean isAddFlag = false;
|
||||
|
||||
public boolean isMute = false;
|
||||
@@ -36,11 +36,15 @@ public class DBUser {
|
||||
this.phone = d.getString("extn");
|
||||
this.status = d.getString("sip_state");
|
||||
String weight = d.getString("weight");
|
||||
if(weight != null) {
|
||||
this.isManager = weight.equals("1");
|
||||
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;
|
||||
}
|
||||
|
||||
public boolean isBusy() {
|
||||
@@ -62,7 +66,7 @@ public class DBUser {
|
||||
u = new DBUser((JSONObject) o);
|
||||
allUser.add(u);
|
||||
mapUsers.put(u.phone, u);
|
||||
if (mySelf != null && u.phone == mySelf.phone) {
|
||||
if (mySelf != null && u.phone.equals(mySelf.phone)) {
|
||||
mySelf = u;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ import java.util.List;
|
||||
|
||||
public class LoginActivity extends TrBaseActivity {
|
||||
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 int port = 0;
|
||||
private String ip = "";
|
||||
private String http_ip = "";
|
||||
private int http_port = 0;
|
||||
QMUITipDialog dialogLoading;
|
||||
|
||||
@Override
|
||||
@@ -65,6 +67,8 @@ public class LoginActivity extends TrBaseActivity {
|
||||
userpw = findViewById(R.id.userpw);
|
||||
userip = findViewById(R.id.userip);
|
||||
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才用动态权限
|
||||
initPermission();
|
||||
}
|
||||
@@ -75,7 +79,11 @@ public class LoginActivity extends TrBaseActivity {
|
||||
username.setText(obj.getString("name"));
|
||||
userpw.setText(obj.getString("password"));
|
||||
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() {
|
||||
@Override
|
||||
@@ -122,9 +130,13 @@ public class LoginActivity extends TrBaseActivity {
|
||||
public void doLogin() {
|
||||
if (SipEngine.getInstance().isonLine())
|
||||
return;
|
||||
if (!isEnable())
|
||||
if (!isEnable()) {
|
||||
UIUtl.toastI("请填写完整的设置信息");
|
||||
return;
|
||||
}
|
||||
dialogLoading = UIUtl.toastLoading("");
|
||||
Net.ip = http_ip;
|
||||
Net.port = http_port;
|
||||
SipEngine.getInstance().init();//先初始化
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
@@ -143,6 +155,8 @@ public class LoginActivity extends TrBaseActivity {
|
||||
boolean b = false;
|
||||
boolean c = false;
|
||||
boolean d = false;
|
||||
boolean e = false;
|
||||
boolean f = false;
|
||||
if (username.getText().toString() != null && !username.getText().toString().equals("")) {
|
||||
name = username.getText().toString();
|
||||
a = true;
|
||||
@@ -160,7 +174,16 @@ public class LoginActivity extends TrBaseActivity {
|
||||
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("ip", ip);
|
||||
jo.put("port", port);
|
||||
jo.put("http_ip", http_ip);
|
||||
jo.put("http_port", http_port);
|
||||
SharedPreferences sp = getSharedPreferences("UserInfor", MODE_PRIVATE);
|
||||
sp.edit().putString("content", jo.toJSONString()).commit();
|
||||
}
|
||||
@@ -344,17 +369,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(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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.graphics.Color;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -56,6 +57,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MainActivity extends TrBaseActivity {
|
||||
public static Handler mainHandler;
|
||||
TextView textVolum;
|
||||
TextView textSelfNum;
|
||||
QMUITabSegment mTabSegment;
|
||||
@@ -71,6 +73,8 @@ public class MainActivity extends TrBaseActivity {
|
||||
ImageView buttonAddVol;
|
||||
ImageView buttonDelVol;
|
||||
DBHead currSelectData;
|
||||
ImageView imageViewSelfStatus;
|
||||
TextView textViewSelfStatus;
|
||||
|
||||
GridView gridUser;
|
||||
List<Object> allUsers = new ArrayList<>();
|
||||
@@ -119,6 +123,8 @@ public class MainActivity extends TrBaseActivity {
|
||||
setContentView(R.layout.activity_main);
|
||||
textVolum = findViewById(R.id.Volumne);
|
||||
textSelfNum = findViewById(R.id.textViewSelfNum);
|
||||
imageViewSelfStatus = findViewById(R.id.imageViewSelfStatus);
|
||||
textViewSelfStatus = findViewById(R.id.textViewSelfStatus);
|
||||
mTabSegment = findViewById(R.id.HeadList);
|
||||
gridUser = findViewById(R.id.GridUser);
|
||||
mContentViewPager = findViewById(R.id.contentViewPager);
|
||||
@@ -144,6 +150,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
mainHandler = this.handler;
|
||||
|
||||
ButtonDelGroup.setVisibility(View.INVISIBLE);
|
||||
StartMeetingVoice.setVisibility(View.INVISIBLE);
|
||||
@@ -155,7 +162,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
headers.add(currSelectData);
|
||||
initTabAndPager();
|
||||
Net.getGroups(null, null);
|
||||
Net.getUsers(null, null);
|
||||
getUsersData();
|
||||
checkBeforeMeetingState();
|
||||
}
|
||||
|
||||
@@ -243,6 +250,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
if (currSelectData.isAll()) {
|
||||
allUsers.addAll(DBUser.allUser);
|
||||
setUsers();
|
||||
Net.getUsers(null, null);
|
||||
} else {
|
||||
DBGroup group = DBGroup.getGroup(currSelectData.id);
|
||||
if (group != null) {
|
||||
@@ -290,6 +298,17 @@ public class MainActivity extends TrBaseActivity {
|
||||
buttonAddGroup.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) {
|
||||
@@ -314,7 +333,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
static Runnable runGetUsers = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Net.getUsers(null, null);
|
||||
getUsersData();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -322,8 +341,9 @@ public class MainActivity extends TrBaseActivity {
|
||||
return gridUser;
|
||||
}
|
||||
|
||||
public void getUsersData() {
|
||||
handler.postDelayed(runGetUsers, 3000);
|
||||
public static void getUsersData() {
|
||||
Net.getUsers(null, null);
|
||||
mainHandler.postDelayed(runGetUsers, 3000);
|
||||
}
|
||||
|
||||
public void setUsers() {
|
||||
@@ -404,7 +424,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||
quickAction.dismiss();
|
||||
QMUITipDialog dialog = UIUtl.toastLoading("");
|
||||
Net.kickMember4Group(currSelectData.id, d.phone, new HttpUtl.CallBack() {
|
||||
Net.deleteMember4Group(currSelectData.id, d.phone, new HttpUtl.CallBack() {
|
||||
@Override
|
||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||
UIUtl.toastS("移除分机成功");
|
||||
@@ -478,7 +498,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
members = members + phNum + ",";
|
||||
}
|
||||
|
||||
Net.addMember2Group(currSelectData.id, members, new HttpUtl.CallBack() {
|
||||
Net.addMember2Group(currSelectData.audio_code, members, new HttpUtl.CallBack() {
|
||||
@Override
|
||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||
Net.getGroupMenbers(currSelectData.id, null, currSelectData.id);
|
||||
@@ -526,6 +546,7 @@ public class MainActivity extends TrBaseActivity {
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mainHandler.removeCallbacks(runGetUsers);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -535,12 +556,12 @@ public class MainActivity extends TrBaseActivity {
|
||||
finish();
|
||||
break;
|
||||
case Net.CMD_getUsers:
|
||||
getUsersData();
|
||||
if (currSelectData.isAll()) {
|
||||
allUsers.clear();
|
||||
allUsers.addAll(DBUser.allUser);
|
||||
setUsers();
|
||||
}
|
||||
refreshView();
|
||||
break;
|
||||
case Net.CMD_getGroupMenbers:
|
||||
NetPkg pkg = (NetPkg) (m.obj);
|
||||
@@ -555,8 +576,8 @@ public class MainActivity extends TrBaseActivity {
|
||||
u.isAddFlag = true;
|
||||
allUsers.add(u);
|
||||
}
|
||||
setUsers();
|
||||
}
|
||||
setUsers();
|
||||
break;
|
||||
case Net.CMD_getGroups:
|
||||
refreshHeaders();
|
||||
@@ -568,7 +589,6 @@ public class MainActivity extends TrBaseActivity {
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
handler.removeCallbacks(runGetUsers);
|
||||
}
|
||||
|
||||
public void addVolume(View view) {
|
||||
|
||||
@@ -32,6 +32,7 @@ public class Net {
|
||||
public static final int CMD_unvmuteMember4Group = 7013;
|
||||
public static final int CMD_vidlayoutMember4Group = 7014;
|
||||
public static final int CMD_vidfloorMember4Group = 7015;
|
||||
public static final int CMD_deleteMember4Group = 7016;
|
||||
|
||||
static HttpUtl.CallBack _callback = new HttpUtl.CallBack() {
|
||||
@Override
|
||||
@@ -97,7 +98,7 @@ public class Net {
|
||||
|
||||
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 _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};
|
||||
HttpUtl.doPostAsyn(url, _params, _callback, CMD_createMeeting, params);
|
||||
}
|
||||
@@ -128,7 +129,6 @@ public class Net {
|
||||
HttpUtl.doPostAsyn(url, _params, _callback, CMD_deleteGroup, params);
|
||||
}
|
||||
|
||||
//TODO:确认下参数
|
||||
public static void addMember2Group(String task_uuid, String members, HttpUtl.CallBack callBack, Object orgs) {
|
||||
String url = "http://" + ip + ":" + port + "/api/conferences/conference/add";
|
||||
String _params = "opr_nbr=" + task_uuid + "&opr_member=" + members;
|
||||
@@ -136,7 +136,13 @@ public class Net {
|
||||
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) {
|
||||
String url = "http://" + ip + ":" + port + "/api/conferences/conference/update";
|
||||
String _params = "opr_nbr=" + task_uuid + "&opr_member=" + members + "&opr_action=kick";
|
||||
|
||||
@@ -18,6 +18,7 @@ public class TrBaseActivity extends AppCompatActivity implements Handler.Callbac
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
@@ -25,10 +26,18 @@ public class TrBaseActivity extends AppCompatActivity implements Handler.Callbac
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
ActivityMgr.onHideActivity(this);
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
ActivityMgr.onHideActivity(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class UIUtl {
|
||||
System.out.println(e);
|
||||
}
|
||||
}
|
||||
}, 1200);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
public static TrAdapter setList(Context context, GridView grid, int convertViewId, Object list, TrAdapter.Callback callback) {
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
package com.tianrun.sipcall.utils;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageItemInfo;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
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.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
@@ -137,13 +146,14 @@ public class HttpUtl {
|
||||
baos.write(buf, 0, len);
|
||||
}
|
||||
baos.flush();
|
||||
if (baos.toString()==null||baos.toString().equals("")) {
|
||||
if (baos.toString() == null || baos.toString().equals("")) {
|
||||
Log.i("http", "result为空");
|
||||
} else {
|
||||
Log.i("http", baos.toString());
|
||||
}
|
||||
return baos.toString();
|
||||
} else {
|
||||
checkTokenFailed(retCode);
|
||||
throw new RuntimeException(" responseCode :" + retCode);
|
||||
}
|
||||
|
||||
@@ -166,6 +176,25 @@ public class HttpUtl {
|
||||
// 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方法的请求
|
||||
*
|
||||
@@ -217,6 +246,9 @@ public class HttpUtl {
|
||||
if (result .equals("{}")){
|
||||
result = conn.getResponseCode()+"";
|
||||
}
|
||||
|
||||
int retCode = conn.getResponseCode();
|
||||
checkTokenFailed(retCode);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.i("http", e.toString());
|
||||
|
||||
BIN
app/src/main/res/drawable-hdpi/fullscreen.png
Normal file
BIN
app/src/main/res/drawable-hdpi/fullscreen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-hdpi/kick.png
Normal file
BIN
app/src/main/res/drawable-hdpi/kick.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/drawable-hdpi/mute.png
Normal file
BIN
app/src/main/res/drawable-hdpi/mute.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/drawable-hdpi/unmute.png
Normal file
BIN
app/src/main/res/drawable-hdpi/unmute.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-hdpi/unvideo.png
Normal file
BIN
app/src/main/res/drawable-hdpi/unvideo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -1,4 +1,5 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/whitesmoke"
|
||||
@@ -11,8 +12,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="null"
|
||||
android:textColor="#FFFFFF"
|
||||
android:text="设置"
|
||||
android:textColor="#363636"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
@@ -23,62 +24,229 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/username"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="50sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/corners_black"
|
||||
android:hint="账号"
|
||||
android:padding="5dp"
|
||||
android:text="5503"
|
||||
android:textColor="@color/blackcolor"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textSize="15sp" />
|
||||
<TextView
|
||||
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" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/userpw"
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="50sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/corners_black"
|
||||
android:hint="密码"
|
||||
android:padding="5dp"
|
||||
android:text="!@#123Qw"
|
||||
android:textColor="@color/blackcolor"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textSize="15sp" />
|
||||
android:layout_height="50dp"
|
||||
android:background="#FFFFFF"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/userip"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="50sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/corners_black"
|
||||
android:hint="服务器地址"
|
||||
android:padding="5dp"
|
||||
android:text="47.111.20.34"
|
||||
android:textColor="@color/blackcolor"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textSize="15sp" />
|
||||
<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/userport"
|
||||
<EditText
|
||||
android:id="@+id/username"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1.5"
|
||||
android:hint="请输入"
|
||||
android:singleLine="true"
|
||||
android:textColor="#000000"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="#FFFFFF"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="0.5"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:text="密码"
|
||||
android:textColor="#000000"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/userpw"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1.5"
|
||||
android:hint="请输入"
|
||||
android:singleLine="true"
|
||||
android:textColor="#000000"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="#FFFFFF"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="0.5"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:text="SIP服务器"
|
||||
android:textColor="#000000"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/userip"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1.5"
|
||||
android:hint="请输入"
|
||||
android:singleLine="true"
|
||||
android:textColor="#000000"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="#FFFFFF"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="0.5"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:text="SIP端口"
|
||||
android:textColor="#000000"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/userport"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1.5"
|
||||
android:hint="请输入"
|
||||
android:singleLine="true"
|
||||
android:textColor="#000000"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:text="服务器设置"
|
||||
android:textColor="#CCCCCC"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="#FFFFFF"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="0.5"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:text="服务器"
|
||||
android:textColor="#000000"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/http_host"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1.5"
|
||||
android:hint="请输入"
|
||||
android:singleLine="true"
|
||||
android:textColor="#000000"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="50sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/corners_black"
|
||||
android:hint="端口"
|
||||
android:padding="5dp"
|
||||
android:text="5060"
|
||||
android:textColor="@color/blackcolor"
|
||||
android:textColorHint="@color/gray"
|
||||
android:textSize="15sp" />
|
||||
android:layout_height="50dp"
|
||||
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_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
|
||||
android:layout_width="fill_parent"
|
||||
@@ -86,12 +254,12 @@
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/callpad_bg"
|
||||
android:onClick="login"
|
||||
android:text="登录"
|
||||
android:text="确定"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<Button
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
@@ -101,8 +269,9 @@
|
||||
android:text="退出"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp"
|
||||
android:visibility="visible" />
|
||||
android:visibility="invisible" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
@@ -94,9 +94,33 @@
|
||||
android:layout_marginBottom="50dp"
|
||||
android:background="@drawable/bt_bgd"
|
||||
android:onClick="logout"
|
||||
android:text="退出"
|
||||
android:text="设置"
|
||||
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
|
||||
android:id="@+id/textViewSelfNum"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -105,7 +129,7 @@
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="号码:xxxx"
|
||||
android:textAlignment="center"
|
||||
android:textSize="12sp" />
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/qmui_divider"
|
||||
android:onClick="exit"
|
||||
android:text="取消"
|
||||
android:textColor="@color/redcolor"
|
||||
@@ -88,8 +89,10 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/callpad_bg"
|
||||
android:onClick="createGroup"
|
||||
android:text="创建分组" />
|
||||
android:text="创建分组"
|
||||
android:textColor="#FFFFFF" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/IncallMeetingRoot"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/callbackground">
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView3"
|
||||
@@ -89,6 +88,24 @@
|
||||
android:layout_marginStart="160dp"
|
||||
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
|
||||
android:id="@+id/incall_answer"
|
||||
android:layout_width="0dp"
|
||||
@@ -105,6 +122,7 @@
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/call_hangup_background"
|
||||
android:src="@drawable/phone3" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
||||
|
||||
Reference in New Issue
Block a user