upgrade
This commit is contained in:
@@ -161,7 +161,7 @@ public class CreateGroupActivity extends TrBaseActivity {
|
|||||||
for (DBUser u : DBUser.allUser) {
|
for (DBUser u : DBUser.allUser) {
|
||||||
if (mapUsers.get(u.phone) == null) {
|
if (mapUsers.get(u.phone) == null) {
|
||||||
listPhone.add(u.phone);
|
listPhone.add(u.phone);
|
||||||
list.add(u.phone + "|" + u.name);
|
list.add(u.phone + " | " + u.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(list.size() == 0) {
|
if(list.size() == 0) {
|
||||||
@@ -224,7 +224,21 @@ public class CreateGroupActivity extends TrBaseActivity {
|
|||||||
UIUtl.toastI("请添加要加入会议的分机号");
|
UIUtl.toastI("请添加要加入会议的分机号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//TODO:
|
QMUITipDialog dialog = UIUtl.toastLoading("");
|
||||||
|
Net.createGroup(meetingTopic.getText().toString(), "", getSelectedUsers(), new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
UIUtl.toastS("创建成功");
|
||||||
|
dialog.dismiss();
|
||||||
|
finish();
|
||||||
|
Net.getGroups(null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void exit(View view) {
|
public void exit(View view) {
|
||||||
|
|||||||
@@ -13,12 +13,24 @@ import android.os.PowerManager;
|
|||||||
import android.os.PowerManager.WakeLock;
|
import android.os.PowerManager.WakeLock;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.viewpager.widget.PagerAdapter;
|
||||||
|
import androidx.viewpager.widget.ViewPager;
|
||||||
|
|
||||||
|
import com.qmuiteam.qmui.util.QMUIDisplayHelper;
|
||||||
|
import com.qmuiteam.qmui.widget.tab.QMUITabBuilder;
|
||||||
|
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator;
|
||||||
|
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.net.Net;
|
||||||
import com.tianrun.sipcall.ui.TrBaseActivity;
|
import com.tianrun.sipcall.ui.TrBaseActivity;
|
||||||
import com.tianrun.sipcall.utils.CONS;
|
import com.tianrun.sipcall.utils.CONS;
|
||||||
import com.tianrun.sipcall.utils.logmy;
|
import com.tianrun.sipcall.utils.logmy;
|
||||||
@@ -31,7 +43,6 @@ import blue.view.SMSurfaceViewRenderer;
|
|||||||
public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
||||||
public static Handler handler_CallActivity;
|
public static Handler handler_CallActivity;
|
||||||
public static String TAG = "CallActivity";
|
public static String TAG = "CallActivity";
|
||||||
private Handler handler = new Handler(this);
|
|
||||||
private PowerManager powerManager = null;
|
private PowerManager powerManager = null;
|
||||||
private WakeLock wakeLock = null;
|
private WakeLock wakeLock = null;
|
||||||
private SMSurfaceViewRenderer localRender;
|
private SMSurfaceViewRenderer localRender;
|
||||||
@@ -40,7 +51,8 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
private SMPercentFrameLayout remoteRenderLayout;
|
private SMPercentFrameLayout remoteRenderLayout;
|
||||||
private ImageButton incall_answer, incall_hangup;
|
private ImageButton incall_answer, incall_hangup;
|
||||||
private TextView show;
|
private TextView show;
|
||||||
// private Button meetingbutton;
|
QMUITabSegment mTabSegment;
|
||||||
|
ViewPager mContentViewPager;
|
||||||
|
|
||||||
private EngineServer engineServer;
|
private EngineServer engineServer;
|
||||||
|
|
||||||
@@ -51,6 +63,42 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
private boolean VIDEOSTATE = false;
|
private boolean VIDEOSTATE = false;
|
||||||
public static Intent incallIntent;
|
public static Intent incallIntent;
|
||||||
|
|
||||||
|
public String[] screenTyps = {"经典模式", "均分模式", "远程全屏", "本地全屏"};
|
||||||
|
|
||||||
|
private PagerAdapter mPagerAdapter = new PagerAdapter() {
|
||||||
|
@Override
|
||||||
|
public boolean isViewFromObject(View view, Object object) {
|
||||||
|
return view == object;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return screenTyps.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object instantiateItem(final ViewGroup container, int position) {
|
||||||
|
// ContentPage page = ContentPage.getPage(position);
|
||||||
|
View view = remoteRender;
|
||||||
|
// view.setTag(page);
|
||||||
|
// ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
|
||||||
|
// ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
|
// container.addView(view, params);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroyItem(ViewGroup container, int position, Object object) {
|
||||||
|
container.removeView((View) object);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemPosition(@NonNull Object object) {
|
||||||
|
View view = (View) object;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@SuppressLint("InvalidWakeLockTag")
|
@SuppressLint("InvalidWakeLockTag")
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -70,6 +118,7 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
initview();
|
initview();
|
||||||
incallIntent = getIntent();
|
incallIntent = getIntent();
|
||||||
setDate(this.getIntent());
|
setDate(this.getIntent());
|
||||||
|
initTabAndPager();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initview() {
|
private void initview() {
|
||||||
@@ -85,6 +134,42 @@ public class InCallActivity extends TrBaseActivity implements OnClickListener {
|
|||||||
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);
|
||||||
|
|
||||||
|
mTabSegment = findViewById(R.id.ScreenType);
|
||||||
|
mContentViewPager = findViewById(R.id.contentViewPager);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initTabAndPager() {
|
||||||
|
mContentViewPager.setAdapter(mPagerAdapter);
|
||||||
|
mContentViewPager.setCurrentItem(0, false);
|
||||||
|
QMUITabBuilder tabBuilder = mTabSegment.tabBuilder();
|
||||||
|
for (int i = 0; i < screenTyps.length; i++) {
|
||||||
|
mTabSegment.addTab(tabBuilder.setText(screenTyps[i]).build(this));
|
||||||
|
}
|
||||||
|
int space = QMUIDisplayHelper.dp2px(this, 16);
|
||||||
|
mTabSegment.setIndicator(new QMUITabIndicator(
|
||||||
|
QMUIDisplayHelper.dp2px(this, 2), false, true));
|
||||||
|
mTabSegment.setMode(QMUITabSegment.MODE_SCROLLABLE);
|
||||||
|
mTabSegment.setItemSpaceInScrollMode(space);
|
||||||
|
mTabSegment.setupWithViewPager(mContentViewPager, false);
|
||||||
|
mTabSegment.setPadding(space, 0, space, 0);
|
||||||
|
mTabSegment.addOnTabSelectedListener(new QMUITabSegment.OnTabSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onTabSelected(int index) {
|
||||||
|
engineServer.adjustVideoView(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabUnselected(int index) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabReselected(int index) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDoubleTap(int index) {
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.app.Activity;
|
|||||||
import android.app.KeyguardManager;
|
import android.app.KeyguardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
@@ -13,15 +14,41 @@ import android.os.PowerManager;
|
|||||||
import android.os.PowerManager.WakeLock;
|
import android.os.PowerManager.WakeLock;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.GridView;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.viewpager.widget.PagerAdapter;
|
||||||
|
import androidx.viewpager.widget.ViewPager;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.qmuiteam.qmui.skin.QMUISkinManager;
|
||||||
|
import com.qmuiteam.qmui.util.QMUIDisplayHelper;
|
||||||
|
import com.qmuiteam.qmui.widget.dialog.QMUITipDialog;
|
||||||
|
import com.qmuiteam.qmui.widget.popup.QMUIPopups;
|
||||||
|
import com.qmuiteam.qmui.widget.popup.QMUIQuickAction;
|
||||||
|
import com.qmuiteam.qmui.widget.tab.QMUITabBuilder;
|
||||||
|
import com.qmuiteam.qmui.widget.tab.QMUITabIndicator;
|
||||||
|
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.DBUser;
|
||||||
|
import com.tianrun.sipcall.db.UserViews;
|
||||||
|
import com.tianrun.sipcall.net.Net;
|
||||||
|
import com.tianrun.sipcall.ui.TrAdapter;
|
||||||
import com.tianrun.sipcall.ui.TrBaseActivity;
|
import com.tianrun.sipcall.ui.TrBaseActivity;
|
||||||
|
import com.tianrun.sipcall.ui.UIUtl;
|
||||||
import com.tianrun.sipcall.utils.CONS;
|
import com.tianrun.sipcall.utils.CONS;
|
||||||
|
import com.tianrun.sipcall.utils.HttpUtl;
|
||||||
import com.tianrun.sipcall.utils.logmy;
|
import com.tianrun.sipcall.utils.logmy;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import blue.view.EngineServer;
|
import blue.view.EngineServer;
|
||||||
import blue.view.SMPercentFrameLayout;
|
import blue.view.SMPercentFrameLayout;
|
||||||
import blue.view.SMSurfaceViewRenderer;
|
import blue.view.SMSurfaceViewRenderer;
|
||||||
@@ -30,7 +57,6 @@ import blue.view.SMSurfaceViewRenderer;
|
|||||||
public class InCallMeetingActivity extends TrBaseActivity implements OnClickListener {
|
public class InCallMeetingActivity extends TrBaseActivity implements OnClickListener {
|
||||||
public static Handler handler_CallActivity;
|
public static Handler handler_CallActivity;
|
||||||
public static String TAG = "CallMeetingActivity";
|
public static String TAG = "CallMeetingActivity";
|
||||||
private Handler handler = new Handler(this);
|
|
||||||
private PowerManager powerManager = null;
|
private PowerManager powerManager = null;
|
||||||
private WakeLock wakeLock = null;
|
private WakeLock wakeLock = null;
|
||||||
private SMSurfaceViewRenderer localRender;
|
private SMSurfaceViewRenderer localRender;
|
||||||
@@ -39,6 +65,9 @@ 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 TextView show;
|
private TextView show;
|
||||||
|
GridView gridUser;
|
||||||
|
QMUITabSegment mTabSegment;
|
||||||
|
ViewPager mContentViewPager;
|
||||||
|
|
||||||
private EngineServer engineServer;
|
private EngineServer engineServer;
|
||||||
|
|
||||||
@@ -48,6 +77,45 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
private int calltype = 0; //0音频1视频
|
private int calltype = 0; //0音频1视频
|
||||||
private boolean VIDEOSTATE = false;
|
private boolean VIDEOSTATE = false;
|
||||||
public static Intent incallIntent;
|
public static Intent incallIntent;
|
||||||
|
TrAdapter adapterUser;
|
||||||
|
|
||||||
|
List<DBUser> allUsers = new ArrayList<>();
|
||||||
|
|
||||||
|
public String[] screenTyps = {"经典模式", "均分模式", "远程全屏", "本地全屏"};
|
||||||
|
|
||||||
|
private PagerAdapter mPagerAdapter = new PagerAdapter() {
|
||||||
|
@Override
|
||||||
|
public boolean isViewFromObject(View view, Object object) {
|
||||||
|
return view == object;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return screenTyps.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object instantiateItem(final ViewGroup container, int position) {
|
||||||
|
// ContentPage page = ContentPage.getPage(position);
|
||||||
|
View view = remoteRender;
|
||||||
|
// view.setTag(page);
|
||||||
|
// ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
|
||||||
|
// ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
|
// container.addView(view, params);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroyItem(ViewGroup container, int position, Object object) {
|
||||||
|
container.removeView((View) object);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemPosition(@NonNull Object object) {
|
||||||
|
View view = (View) object;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@SuppressLint("InvalidWakeLockTag")
|
@SuppressLint("InvalidWakeLockTag")
|
||||||
@Override
|
@Override
|
||||||
@@ -68,9 +136,16 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
initview();
|
initview();
|
||||||
incallIntent = getIntent();
|
incallIntent = getIntent();
|
||||||
setDate(this.getIntent());
|
setDate(this.getIntent());
|
||||||
|
|
||||||
|
allUsers.clear();
|
||||||
|
setUsers();
|
||||||
|
getMembers();
|
||||||
|
initTabAndPager();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initview() {
|
private void initview() {
|
||||||
|
View view = findViewById(R.id.IncallMeetingRoot);
|
||||||
|
gridUser = view.findViewById(R.id.GridUser);
|
||||||
show = (TextView) findViewById(R.id.show);
|
show = (TextView) findViewById(R.id.show);
|
||||||
incall_answer = (ImageButton) findViewById(R.id.incall_answer);
|
incall_answer = (ImageButton) findViewById(R.id.incall_answer);
|
||||||
incall_hangup = (ImageButton) findViewById(R.id.incall_hangup);
|
incall_hangup = (ImageButton) findViewById(R.id.incall_hangup);
|
||||||
@@ -83,6 +158,142 @@ 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);
|
||||||
|
|
||||||
|
mTabSegment = findViewById(R.id.ScreenType);
|
||||||
|
mContentViewPager = findViewById(R.id.contentViewPager);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initTabAndPager() {
|
||||||
|
mContentViewPager.setAdapter(mPagerAdapter);
|
||||||
|
mContentViewPager.setCurrentItem(0, false);
|
||||||
|
QMUITabBuilder tabBuilder = mTabSegment.tabBuilder();
|
||||||
|
for (int i = 0; i < screenTyps.length; i++) {
|
||||||
|
mTabSegment.addTab(tabBuilder.setText(screenTyps[i]).build(this));
|
||||||
|
}
|
||||||
|
int space = QMUIDisplayHelper.dp2px(this, 16);
|
||||||
|
mTabSegment.setIndicator(new QMUITabIndicator(
|
||||||
|
QMUIDisplayHelper.dp2px(this, 2), false, true));
|
||||||
|
mTabSegment.setMode(QMUITabSegment.MODE_SCROLLABLE);
|
||||||
|
mTabSegment.setItemSpaceInScrollMode(space);
|
||||||
|
mTabSegment.setupWithViewPager(mContentViewPager, false);
|
||||||
|
mTabSegment.setPadding(space, 0, space, 0);
|
||||||
|
mTabSegment.addOnTabSelectedListener(new QMUITabSegment.OnTabSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onTabSelected(int index) {
|
||||||
|
engineServer.adjustVideoView(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabUnselected(int index) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabReselected(int index) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDoubleTap(int index) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public void getMembers()
|
||||||
|
{
|
||||||
|
Net.getGroupMenbers(callnumber, new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
JSONObject jo = JSONObject.parseObject(result);
|
||||||
|
JSONArray array = jo.getJSONArray("members_msg");
|
||||||
|
allUsers.clear();
|
||||||
|
for(Object o:array) {
|
||||||
|
allUsers.add(new DBUser((JSONObject)o));
|
||||||
|
}
|
||||||
|
setUsers();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsers() {
|
||||||
|
if (adapterUser == null) {
|
||||||
|
adapterUser = UIUtl.setList(this, gridUser, R.layout.list_item_user, allUsers, new TrAdapter.Callback() {
|
||||||
|
@Override
|
||||||
|
public void initCallback(Object data, int position, View prefabView, ViewGroup parent) {
|
||||||
|
UserViews views = null;
|
||||||
|
if (prefabView.getTag() == null) {
|
||||||
|
views = new UserViews();
|
||||||
|
views.textViewName = prefabView.findViewById(R.id.textViewName);
|
||||||
|
views.textViewNum = prefabView.findViewById(R.id.textViewNum);
|
||||||
|
views.imageViewStatus = prefabView.findViewById(R.id.imageViewStatus);
|
||||||
|
views.imageViewAddflag = prefabView.findViewById(R.id.imageViewAddflag);
|
||||||
|
views.imageViewPhoneIcon = prefabView.findViewById(R.id.imageView3PhoneIcon);
|
||||||
|
prefabView.setTag(views);
|
||||||
|
} else {
|
||||||
|
views = (UserViews) (prefabView.getTag());
|
||||||
|
}
|
||||||
|
DBUser d = (DBUser) data;
|
||||||
|
views.textViewName.setText(d.name);
|
||||||
|
views.textViewNum.setText(d.phone);
|
||||||
|
if (d.isOffline()) {
|
||||||
|
views.imageViewStatus.setColorFilter(Color.GRAY);
|
||||||
|
} else if (d.isOnline()) {
|
||||||
|
views.imageViewStatus.setColorFilter(Color.GREEN);
|
||||||
|
} else if (d.isBusy()) {
|
||||||
|
views.imageViewStatus.setColorFilter(Color.RED);
|
||||||
|
} else {
|
||||||
|
views.imageViewStatus.setColorFilter(Color.GRAY);
|
||||||
|
}
|
||||||
|
if (d.isAddFlag) {
|
||||||
|
views.imageViewPhoneIcon.setVisibility(View.INVISIBLE);
|
||||||
|
views.imageViewAddflag.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
views.imageViewPhoneIcon.setVisibility(View.VISIBLE);
|
||||||
|
views.imageViewAddflag.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clickCallback(Object data, AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
DBUser d = (DBUser) data;
|
||||||
|
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));
|
||||||
|
if (DBUser.mySelf.isManager) {
|
||||||
|
qa.addAction(new QMUIQuickAction.Action().icon(android.R.drawable.ic_delete).text("移除").onClick(
|
||||||
|
new QMUIQuickAction.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
|
quickAction.dismiss();
|
||||||
|
QMUITipDialog dialog = UIUtl.toastLoading("");
|
||||||
|
Net.kickMember4Group(callnumber, d.phone, new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
UIUtl.toastS("移除分机成功");
|
||||||
|
getMembers();
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
qa.show(view);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
adapterUser.notifyDataSetChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -181,6 +392,9 @@ public class InCallMeetingActivity extends TrBaseActivity implements OnClickList
|
|||||||
stopVideoStream(true);
|
stopVideoStream(true);
|
||||||
finish();
|
finish();
|
||||||
break;
|
break;
|
||||||
|
case Net
|
||||||
|
.CMD_getGroupMenbers:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
36
app/src/main/java/com/tianrun/sipcall/db/DBGroup.java
Normal file
36
app/src/main/java/com/tianrun/sipcall/db/DBGroup.java
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
package com.tianrun.sipcall.db;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DBGroup {
|
||||||
|
public DBHead head;
|
||||||
|
public List<DBUser> users = new ArrayList<>();
|
||||||
|
|
||||||
|
public boolean containsUser(String phone) {
|
||||||
|
for (DBUser u : users) {
|
||||||
|
if (u.phone.equals(phone)) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HashMap<String, DBGroup> mapGroups = new HashMap<>();
|
||||||
|
|
||||||
|
public static void onGetGroupMembers(JSONObject content) {
|
||||||
|
DBGroup group = new DBGroup();
|
||||||
|
group.head = new DBHead(content);
|
||||||
|
JSONArray array = content.getJSONArray("members_msg");
|
||||||
|
for (Object o : array) {
|
||||||
|
group.users.add(new DBUser((JSONObject) o));
|
||||||
|
}
|
||||||
|
mapGroups.put(group.head.id, group);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DBGroup getGroup(String uuid) {
|
||||||
|
return mapGroups.get(uuid);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@ public class DBHead {
|
|||||||
public String id;
|
public String id;
|
||||||
public boolean isSelected = false;
|
public boolean isSelected = false;
|
||||||
|
|
||||||
public static List<DBHead> allGroups = new ArrayList<>();
|
public static List<DBHead> allHeads = new ArrayList<>();
|
||||||
|
|
||||||
public DBHead(String id, String name) {
|
public DBHead(String id, String name) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@@ -42,14 +42,14 @@ public class DBHead {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void onGetGroups(JSONArray list) {
|
public static void onGetGroups(JSONArray list) {
|
||||||
allGroups.clear();
|
allHeads.clear();
|
||||||
for (Object o : list) {
|
for (Object o : list) {
|
||||||
allGroups.add(new DBHead((JSONObject) o));
|
allHeads.add(new DBHead((JSONObject) o));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DBHead getByUUID(String uuid) {
|
public static DBHead getByUUID(String uuid) {
|
||||||
for (DBHead d : allGroups) {
|
for (DBHead d : allHeads) {
|
||||||
if (d.id.equals(uuid)){
|
if (d.id.equals(uuid)){
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ public class DBHead {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static DBHead getByCode(String code) {
|
public static DBHead getByCode(String code) {
|
||||||
for (DBHead d : allGroups) {
|
for (DBHead d : allHeads) {
|
||||||
if (d.audio_code.equals(code) || d.video_code.equals(code)) {
|
if (d.audio_code.equals(code) || d.video_code.equals(code)) {
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ public class DBRoot {
|
|||||||
JSONArray list = JSONArray.parseArray(content);
|
JSONArray list = JSONArray.parseArray(content);
|
||||||
DBHead.onGetGroups(list);
|
DBHead.onGetGroups(list);
|
||||||
break;
|
break;
|
||||||
|
case Net.CMD_getGroupMenbers:
|
||||||
|
JSONObject o = JSONObject.parseObject(content);
|
||||||
|
DBGroup.onGetGroupMembers(o);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.tianrun.sipcall.db;
|
package com.tianrun.sipcall.db;
|
||||||
|
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.alibaba.fastjson.serializer.FloatCodec;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -27,7 +31,12 @@ public class DBUser {
|
|||||||
this.name = d.getString("name");
|
this.name = d.getString("name");
|
||||||
this.phone = d.getString("extn");
|
this.phone = d.getString("extn");
|
||||||
this.status = d.getString("sip_state");
|
this.status = d.getString("sip_state");
|
||||||
this.isManager = d.getString("weight").equals("1");
|
String weight = d.getString("weight");
|
||||||
|
if(weight != null) {
|
||||||
|
this.isManager = weight.equals("1");
|
||||||
|
} else {
|
||||||
|
this.isManager = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBusy() {
|
public boolean isBusy() {
|
||||||
|
|||||||
12
app/src/main/java/com/tianrun/sipcall/db/UserViews.java
Normal file
12
app/src/main/java/com/tianrun/sipcall/db/UserViews.java
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package com.tianrun.sipcall.db;
|
||||||
|
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
public class UserViews {
|
||||||
|
public TextView textViewName;
|
||||||
|
public TextView textViewNum;
|
||||||
|
public ImageView imageViewStatus;
|
||||||
|
public ImageView imageViewPhoneIcon;
|
||||||
|
public ImageView imageViewAddflag;
|
||||||
|
}
|
||||||
@@ -195,6 +195,7 @@ public class LoginActivity extends TrBaseActivity {
|
|||||||
if(dialogLoading != null) {
|
if(dialogLoading != null) {
|
||||||
dialogLoading.dismiss();
|
dialogLoading.dismiss();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case CONS.LOGIN:
|
case CONS.LOGIN:
|
||||||
if(dialogLoading != null) {
|
if(dialogLoading != null) {
|
||||||
dialogLoading.dismiss();
|
dialogLoading.dismiss();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.tianrun.sipcall.login;
|
package com.tianrun.sipcall.login;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
@@ -39,11 +40,12 @@ import com.tianrun.sipcall.SipEngine;
|
|||||||
import com.tianrun.sipcall.call.CallActivity;
|
import com.tianrun.sipcall.call.CallActivity;
|
||||||
import com.tianrun.sipcall.call.CreateGroupActivity;
|
import com.tianrun.sipcall.call.CreateGroupActivity;
|
||||||
import com.tianrun.sipcall.call.CreateMeetingActivity;
|
import com.tianrun.sipcall.call.CreateMeetingActivity;
|
||||||
|
import com.tianrun.sipcall.db.DBGroup;
|
||||||
import com.tianrun.sipcall.db.DBHead;
|
import com.tianrun.sipcall.db.DBHead;
|
||||||
import com.tianrun.sipcall.db.DBUser;
|
import com.tianrun.sipcall.db.DBUser;
|
||||||
|
import com.tianrun.sipcall.db.UserViews;
|
||||||
import com.tianrun.sipcall.net.Net;
|
import com.tianrun.sipcall.net.Net;
|
||||||
import com.tianrun.sipcall.net.NetPkg;
|
import com.tianrun.sipcall.net.NetPkg;
|
||||||
import com.tianrun.sipcall.ui.ActivityMgr;
|
|
||||||
import com.tianrun.sipcall.ui.TrAdapter;
|
import com.tianrun.sipcall.ui.TrAdapter;
|
||||||
import com.tianrun.sipcall.ui.TrBaseActivity;
|
import com.tianrun.sipcall.ui.TrBaseActivity;
|
||||||
import com.tianrun.sipcall.ui.UIUtl;
|
import com.tianrun.sipcall.ui.UIUtl;
|
||||||
@@ -193,7 +195,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
DBHead h = headers.get(0);
|
DBHead h = headers.get(0);
|
||||||
headers.clear();
|
headers.clear();
|
||||||
headers.add(h);
|
headers.add(h);
|
||||||
headers.addAll(DBHead.allGroups);
|
headers.addAll(DBHead.allHeads);
|
||||||
|
|
||||||
mPagerAdapter.notifyDataSetChanged();
|
mPagerAdapter.notifyDataSetChanged();
|
||||||
mTabSegment.reset();
|
mTabSegment.reset();
|
||||||
@@ -238,10 +240,20 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
|
|
||||||
//显示分机
|
//显示分机
|
||||||
allUsers.clear();
|
allUsers.clear();
|
||||||
if(currSelectData.isAll()) {
|
if (currSelectData.isAll()) {
|
||||||
allUsers.addAll(DBUser.allUser);
|
allUsers.addAll(DBUser.allUser);
|
||||||
setUsers();
|
setUsers();
|
||||||
} else {
|
} else {
|
||||||
|
DBGroup group = DBGroup.getGroup(currSelectData.id);
|
||||||
|
if (group != null) {
|
||||||
|
allUsers.addAll(group.users);
|
||||||
|
}
|
||||||
|
//根据权限来处理
|
||||||
|
if (DBUser.mySelf.isManager) {
|
||||||
|
DBUser u = new DBUser("", "添加分机", "false");
|
||||||
|
u.isAddFlag = true;
|
||||||
|
allUsers.add(u);
|
||||||
|
}
|
||||||
setUsers();
|
setUsers();
|
||||||
//取得数据
|
//取得数据
|
||||||
Net.getGroupMenbers(currSelectData.id, null, currSelectData.id);
|
Net.getGroupMenbers(currSelectData.id, null, currSelectData.id);
|
||||||
@@ -264,7 +276,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
|
|
||||||
|
|
||||||
public void refreshView() {
|
public void refreshView() {
|
||||||
//通话音量
|
//通话音量
|
||||||
int max = audioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
|
int max = audioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
|
||||||
int current = audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL);
|
int current = audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL);
|
||||||
textVolum.setText("音量:" + current);
|
textVolum.setText("音量:" + current);
|
||||||
@@ -314,14 +326,6 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
handler.postDelayed(runGetUsers, 3000);
|
handler.postDelayed(runGetUsers, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UserViews {
|
|
||||||
public TextView textViewName;
|
|
||||||
public TextView textViewNum;
|
|
||||||
public ImageView imageViewStatus;
|
|
||||||
public ImageView imageViewPhoneIcon;
|
|
||||||
public ImageView imageViewAddflag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUsers() {
|
public void setUsers() {
|
||||||
if (DBUser.allUser == null) return;
|
if (DBUser.allUser == null) return;
|
||||||
if (adapterUser == null) {
|
if (adapterUser == null) {
|
||||||
@@ -365,7 +369,7 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
public void clickCallback(Object data, AdapterView<?> parent, View view, int position, long id) {
|
public void clickCallback(Object data, AdapterView<?> parent, View view, int position, long id) {
|
||||||
DBUser d = (DBUser) data;
|
DBUser d = (DBUser) data;
|
||||||
if (d.isAddFlag) {
|
if (d.isAddFlag) {
|
||||||
//TODO:
|
showUsersMultiChoiceDialog();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QMUIQuickAction qa = QMUIPopups.quickAction(MainActivity.this,
|
QMUIQuickAction qa = QMUIPopups.quickAction(MainActivity.this,
|
||||||
@@ -399,7 +403,21 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||||
quickAction.dismiss();
|
quickAction.dismiss();
|
||||||
//TODO:移除分机
|
QMUITipDialog dialog = UIUtl.toastLoading("");
|
||||||
|
Net.kickMember4Group(currSelectData.id, d.phone, new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
UIUtl.toastS("移除分机成功");
|
||||||
|
//取得数据
|
||||||
|
Net.getGroupMenbers(currSelectData.id, null, currSelectData.id);
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@@ -412,9 +430,74 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void refreshHeadList() {
|
private void showUsersMultiChoiceDialog() {
|
||||||
// adapter.notifyDataSetChanged();
|
List<String> list = new ArrayList<>();
|
||||||
// }
|
List<String> listPhone = new ArrayList<>();
|
||||||
|
DBGroup group = DBGroup.getGroup(currSelectData.id);
|
||||||
|
if (group == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (DBUser u : DBUser.allUser) {
|
||||||
|
if (!group.containsUser(u.phone)) {
|
||||||
|
listPhone.add(u.phone);
|
||||||
|
list.add(u.phone + " | " + u.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (list.size() == 0) {
|
||||||
|
UIUtl.toastI("所有分机已经添加");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String[] items = new String[list.size()];
|
||||||
|
list.toArray(items);
|
||||||
|
final QMUIDialog.MultiCheckableDialogBuilder builder = new QMUIDialog.MultiCheckableDialogBuilder(this)
|
||||||
|
.setTitle("选择要加入的分机号")
|
||||||
|
// .setCheckedItems(new int[]{1, 3})
|
||||||
|
.setSkinManager(QMUISkinManager.defaultInstance(this))
|
||||||
|
.addItems(items, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.addAction("取消", new QMUIDialogAction.ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(QMUIDialog dialog, int index) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.addAction("确定", new QMUIDialogAction.ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(QMUIDialog dialog, int index) {
|
||||||
|
int[] selectIndexs = builder.getCheckedItemIndexes();
|
||||||
|
if (selectIndexs.length > 0) {
|
||||||
|
List<DBUser> list = new ArrayList<>();
|
||||||
|
String members = "";
|
||||||
|
for (int i = 0; i < selectIndexs.length; i++) {
|
||||||
|
String phNum = listPhone.get(selectIndexs[i]);
|
||||||
|
members = members + phNum + ",";
|
||||||
|
}
|
||||||
|
|
||||||
|
Net.addUser2Group(currSelectData.id, members, new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
Net.getGroupMenbers(currSelectData.id, null, currSelectData.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
int mCurrentDialogStyle = com.qmuiteam.qmui.R.style.QMUI_Dialog;
|
||||||
|
builder.create(mCurrentDialogStyle).show();
|
||||||
|
}
|
||||||
|
|
||||||
public void call(View view) {
|
public void call(View view) {
|
||||||
startActivity(new Intent(MainActivity.this, CallActivity.class));
|
startActivity(new Intent(MainActivity.this, CallActivity.class));
|
||||||
@@ -460,10 +543,12 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Net.CMD_getGroupMenbers:
|
case Net.CMD_getGroupMenbers:
|
||||||
NetPkg pkg = (NetPkg)(m.obj);
|
NetPkg pkg = (NetPkg) (m.obj);
|
||||||
String oldUUID = pkg.orgs.toString();
|
String oldUUID = pkg.orgs != null ? pkg.orgs.toString() : "";
|
||||||
if (!currSelectData.isAll() && oldUUID.equals(currSelectData.id)) {
|
if (!currSelectData.isAll() && oldUUID.equals(currSelectData.id)) {
|
||||||
//TODO:解析数据
|
DBGroup group = DBGroup.getGroup(currSelectData.id);
|
||||||
|
allUsers.clear();
|
||||||
|
allUsers.addAll(group.users);
|
||||||
//根据权限来处理
|
//根据权限来处理
|
||||||
if (DBUser.mySelf.isManager) {
|
if (DBUser.mySelf.isManager) {
|
||||||
DBUser u = new DBUser("", "添加分机", "false");
|
DBUser u = new DBUser("", "添加分机", "false");
|
||||||
@@ -554,8 +639,20 @@ public class MainActivity extends TrBaseActivity {
|
|||||||
.addAction(0, "删除", QMUIDialogAction.ACTION_PROP_NEGATIVE, new QMUIDialogAction.ActionListener() {
|
.addAction(0, "删除", QMUIDialogAction.ACTION_PROP_NEGATIVE, new QMUIDialogAction.ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(QMUIDialog dialog, int index) {
|
public void onClick(QMUIDialog dialog, int index) {
|
||||||
//TODO:
|
Net.deleteGroup(currSelectData.id, new HttpUtl.CallBack() {
|
||||||
|
@Override
|
||||||
|
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||||
|
UIUtl.toastS("分组删除成功");
|
||||||
|
Net.getGroups(null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestError(int cmd, String result, Object orgs) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.create(mCurrentDialogStyle).show();
|
.create(mCurrentDialogStyle).show();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.util.Log;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.tianrun.sipcall.App;
|
import com.tianrun.sipcall.App;
|
||||||
import com.tianrun.sipcall.db.DBRoot;
|
import com.tianrun.sipcall.db.DBRoot;
|
||||||
|
import com.tianrun.sipcall.db.DBUser;
|
||||||
import com.tianrun.sipcall.ui.ActivityMgr;
|
import com.tianrun.sipcall.ui.ActivityMgr;
|
||||||
import com.tianrun.sipcall.ui.UIUtl;
|
import com.tianrun.sipcall.ui.UIUtl;
|
||||||
import com.tianrun.sipcall.utils.HttpUtl;
|
import com.tianrun.sipcall.utils.HttpUtl;
|
||||||
@@ -21,16 +22,20 @@ public class Net {
|
|||||||
public static final int CMD_getUserInfor = 7003;
|
public static final int CMD_getUserInfor = 7003;
|
||||||
public static final int CMD_getGroups = 7004;
|
public static final int CMD_getGroups = 7004;
|
||||||
public static final int CMD_getGroupMenbers = 7005;
|
public static final int CMD_getGroupMenbers = 7005;
|
||||||
|
public static final int CMD_createGroup = 7006;
|
||||||
|
public static final int CMD_deleteGroup = 7007;
|
||||||
|
public static final int CMD_addUser2Group = 7008;
|
||||||
|
public static final int CMD_kickMember4Group = 7009;
|
||||||
|
|
||||||
static HttpUtl.CallBack _callback = new HttpUtl.CallBack() {
|
static HttpUtl.CallBack _callback = new HttpUtl.CallBack() {
|
||||||
@Override
|
@Override
|
||||||
public void onRequestComplete(int cmd, String result, Object params) {
|
public void onRequestComplete(int cmd, String result, Object params) {
|
||||||
Log.i(TAG, "onRequestComplete: " + result);
|
Log.i(TAG, "onRequestComplete: " + result);
|
||||||
DBRoot.onGetData(cmd, result);
|
DBRoot.onGetData(cmd, result);
|
||||||
Object[] _params = (Object[])params;
|
Object[] _params = (Object[]) params;
|
||||||
HttpUtl.CallBack callback = (HttpUtl.CallBack)(_params[0]);
|
HttpUtl.CallBack callback = (HttpUtl.CallBack) (_params[0]);
|
||||||
Object orgs = _params[1];
|
Object orgs = _params[1];
|
||||||
if(ActivityMgr.topActivity != null && callback != null) {
|
if (ActivityMgr.topActivity != null && callback != null) {
|
||||||
ActivityMgr.topActivity.handler.post(new Runnable() {
|
ActivityMgr.topActivity.handler.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -45,10 +50,20 @@ public class Net {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRequestError(int cmd, String result, Object orgs) {
|
public void onRequestError(int cmd, String result, Object params) {
|
||||||
Log.e(TAG, "onRequestError: " + result);
|
Log.e(TAG, "onRequestError: " + result);
|
||||||
if (orgs != null) {
|
Object[] _params = (Object[]) params;
|
||||||
((HttpUtl.CallBack) orgs).onRequestError(cmd, result, orgs);
|
HttpUtl.CallBack callback = (HttpUtl.CallBack) (_params[0]);
|
||||||
|
Object orgs = _params[1];
|
||||||
|
if (ActivityMgr.topActivity != null && callback != null) {
|
||||||
|
ActivityMgr.topActivity.handler.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onRequestError(cmd, result, orgs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
UIUtl.toastI(result);
|
UIUtl.toastI(result);
|
||||||
}
|
}
|
||||||
@@ -76,11 +91,18 @@ 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;
|
String _params = "topic=" + topic + "&description=" + description + "&members=" + members + "&typ=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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void createGroup(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;
|
||||||
|
Object[] params = {callBack, orgs};
|
||||||
|
HttpUtl.doPostAsyn(url, _params, _callback, CMD_createGroup, params);
|
||||||
|
}
|
||||||
|
|
||||||
public static void getGroups(HttpUtl.CallBack callBack, Object orgs) {
|
public static void getGroups(HttpUtl.CallBack callBack, Object orgs) {
|
||||||
String url = "http://" + ip + ":" + port + "/api/conferences/conference/list";
|
String url = "http://" + ip + ":" + port + "/api/conferences/conference/list";
|
||||||
Object[] params = {callBack, orgs};
|
Object[] params = {callBack, orgs};
|
||||||
@@ -88,8 +110,38 @@ public class Net {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void getGroupMenbers(String task_uuid, HttpUtl.CallBack callBack, Object orgs) {
|
public static void getGroupMenbers(String task_uuid, HttpUtl.CallBack callBack, Object orgs) {
|
||||||
String url = "http://" + ip + ":" + port + "/api/conferences/conference/"+task_uuid;
|
String url = "http://" + ip + ":" + port + "/api/conferences/conference/" + task_uuid;
|
||||||
Object[] params = {callBack, orgs};
|
Object[] params = {callBack, orgs};
|
||||||
HttpUtl.doGetAsyn(url, _callback, CMD_getGroupMenbers, params);
|
HttpUtl.doGetAsyn(url, _callback, CMD_getGroupMenbers, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void deleteGroup(String task_uuid, HttpUtl.CallBack callBack, Object orgs) {
|
||||||
|
String url = "http://" + ip + ":" + port + "/api/conferences/conference/delete";
|
||||||
|
String _params = "task_uuid=" + task_uuid;
|
||||||
|
Object[] params = {callBack, orgs};
|
||||||
|
HttpUtl.doPostAsyn(url, _params, _callback, CMD_deleteGroup, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO:确认下参数
|
||||||
|
public static void addUser2Group(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;
|
||||||
|
Object[] params = {callBack, orgs};
|
||||||
|
HttpUtl.doPostAsyn(url, _params, _callback, CMD_addUser2Group, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO:确认下参数
|
||||||
|
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";
|
||||||
|
Object[] params = {callBack, orgs};
|
||||||
|
HttpUtl.doPostAsyn(url, _params, _callback, CMD_kickMember4Group, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
// public static void updateGroup(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;
|
||||||
|
// Object[] params = {callBack, orgs};
|
||||||
|
// HttpUtl.doPostAsyn(url, _params, _callback, CMD_updateGroup, params);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,9 +142,12 @@ public class UIUtl {
|
|||||||
List<String> items,
|
List<String> items,
|
||||||
boolean allowDragDismiss,
|
boolean allowDragDismiss,
|
||||||
boolean withMark, QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener onClick) {
|
boolean withMark, QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener onClick) {
|
||||||
QMUIBottomSheet.BottomListSheetBuilder builder = new QMUIBottomSheet.BottomListSheetBuilder(App.getContext());
|
if(ActivityMgr.topActivity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QMUIBottomSheet.BottomListSheetBuilder builder = new QMUIBottomSheet.BottomListSheetBuilder(ActivityMgr.topActivity);
|
||||||
builder.setGravityCenter(gravityCenter)
|
builder.setGravityCenter(gravityCenter)
|
||||||
.setSkinManager(QMUISkinManager.defaultInstance(App.getContext()))
|
.setSkinManager(QMUISkinManager.defaultInstance(ActivityMgr.topActivity))
|
||||||
.setTitle(title)
|
.setTitle(title)
|
||||||
.setAddCancelBtn(addCancelBtn)
|
.setAddCancelBtn(addCancelBtn)
|
||||||
.setAllowDrag(allowDragDismiss)
|
.setAllowDrag(allowDragDismiss)
|
||||||
@@ -160,7 +163,7 @@ public class UIUtl {
|
|||||||
if (withMark) {
|
if (withMark) {
|
||||||
builder.setCheckedIndex(40);
|
builder.setCheckedIndex(40);
|
||||||
}
|
}
|
||||||
for (int i = 1; i <= items.size(); i++) {
|
for (int i = 0; i < items.size(); i++) {
|
||||||
builder.addItem(items.get(i));
|
builder.addItem(items.get(i));
|
||||||
}
|
}
|
||||||
builder.build().show();
|
builder.build().show();
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class CONS {
|
|||||||
public static final int SETTEXT = 207;
|
public static final int SETTEXT = 207;
|
||||||
public static final int INCOMINGMESSAGE = 208;//来短信了
|
public static final int INCOMINGMESSAGE = 208;//来短信了
|
||||||
public static final int showpic = 209;
|
public static final int showpic = 209;
|
||||||
public static final int LOGINFAILED = 230;
|
public static final int LOGINFAILED = 210;
|
||||||
|
|
||||||
public static void SENDMESSAGETO(Handler handler, int menu, Object object) {
|
public static void SENDMESSAGETO(Handler handler, int menu, Object object) {
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
|
|||||||
@@ -74,4 +74,18 @@
|
|||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="20sp" />
|
android:textSize="20sp" />
|
||||||
|
|
||||||
|
<com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
||||||
|
android:id="@+id/ScreenType"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:orientation="horizontal" />
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
android:id="@+id/contentViewPager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:fitsSystemWindows="true" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|||||||
@@ -2,19 +2,20 @@
|
|||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/IncallMeetingRoot"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:background="@drawable/callbackground" >
|
android:background="@drawable/callbackground">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView3"
|
android:id="@+id/imageView3"
|
||||||
android:layout_width="130dp"
|
android:layout_width="160dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#15516C" />
|
android:background="#15516C" />
|
||||||
|
|
||||||
<GridView
|
<GridView
|
||||||
android:id="@+id/GridUser"
|
android:id="@+id/GridUser"
|
||||||
android:layout_width="130dp"
|
android:layout_width="160dp"
|
||||||
android:layout_height="292dp"
|
android:layout_height="292dp"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginStart="130dp"
|
android:layout_marginStart="160dp"
|
||||||
android:layout_marginTop="0dp"
|
android:layout_marginTop="0dp"
|
||||||
android:layout_marginEnd="0dp"
|
android:layout_marginEnd="0dp"
|
||||||
android:layout_marginBottom="50dp"
|
android:layout_marginBottom="50dp"
|
||||||
@@ -72,7 +73,7 @@
|
|||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginStart="130dp"
|
android:layout_marginStart="160dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
@@ -104,4 +105,19 @@
|
|||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="20sp" />
|
android:textSize="20sp" />
|
||||||
|
|
||||||
|
<com.qmuiteam.qmui.widget.tab.QMUITabSegment
|
||||||
|
android:id="@+id/ScreenType"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_marginStart="170dp"
|
||||||
|
android:orientation="horizontal" />
|
||||||
|
|
||||||
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
android:id="@+id/contentViewPager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:fitsSystemWindows="true" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user