all
This commit is contained in:
563
app/src/main/java/com/tianrun/sipcall/login/MainActivity.java
Normal file
563
app/src/main/java/com/tianrun/sipcall/login/MainActivity.java
Normal file
@@ -0,0 +1,563 @@
|
||||
package com.tianrun.sipcall.login;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Button;
|
||||
import android.widget.GridView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
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.QMUIBottomSheet;
|
||||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
|
||||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
|
||||
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.App;
|
||||
import com.tianrun.sipcall.R;
|
||||
import com.tianrun.sipcall.SipEngine;
|
||||
import com.tianrun.sipcall.call.CallActivity;
|
||||
import com.tianrun.sipcall.call.CreateGroupActivity;
|
||||
import com.tianrun.sipcall.call.CreateMeetingActivity;
|
||||
import com.tianrun.sipcall.db.DBHead;
|
||||
import com.tianrun.sipcall.db.DBUser;
|
||||
import com.tianrun.sipcall.net.Net;
|
||||
import com.tianrun.sipcall.net.NetPkg;
|
||||
import com.tianrun.sipcall.ui.ActivityMgr;
|
||||
import com.tianrun.sipcall.ui.TrAdapter;
|
||||
import com.tianrun.sipcall.ui.TrBaseActivity;
|
||||
import com.tianrun.sipcall.ui.UIUtl;
|
||||
import com.tianrun.sipcall.utils.CONS;
|
||||
import com.tianrun.sipcall.utils.HttpUtl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MainActivity extends TrBaseActivity {
|
||||
TextView textVolum;
|
||||
TextView textSelfNum;
|
||||
QMUITabSegment mTabSegment;
|
||||
ViewPager mContentViewPager;
|
||||
Button buttonAddGroup;
|
||||
ImageView imageViewAddGroupIcon;
|
||||
View StartMeetingVideo;
|
||||
View StartMeetingVoice;
|
||||
View ButtonDelGroup;
|
||||
// TrAdapter adapter;
|
||||
TrAdapter adapterUser;
|
||||
AudioManager audioManager;
|
||||
ImageView buttonAddVol;
|
||||
ImageView buttonDelVol;
|
||||
DBHead currSelectData;
|
||||
|
||||
GridView gridUser;
|
||||
List<Object> allUsers = new ArrayList<>();
|
||||
List<DBHead> headers = new ArrayList<>();
|
||||
private int mCurrentDialogStyle = com.qmuiteam.qmui.R.style.QMUI_Dialog;
|
||||
|
||||
|
||||
private PagerAdapter mPagerAdapter = new PagerAdapter() {
|
||||
@Override
|
||||
public boolean isViewFromObject(View view, Object object) {
|
||||
return view == object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return headers.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object instantiateItem(final ViewGroup container, int position) {
|
||||
// ContentPage page = ContentPage.getPage(position);
|
||||
View view = getPageView(position);
|
||||
// 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;
|
||||
}
|
||||
};
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
textVolum = findViewById(R.id.Volumne);
|
||||
textSelfNum = findViewById(R.id.textViewSelfNum);
|
||||
mTabSegment = findViewById(R.id.HeadList);
|
||||
gridUser = findViewById(R.id.GridUser);
|
||||
mContentViewPager = findViewById(R.id.contentViewPager);
|
||||
buttonAddGroup = findViewById(R.id.buttonAddGroup);
|
||||
imageViewAddGroupIcon = findViewById(R.id.imageViewAddGroupIcon);
|
||||
audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
||||
StartMeetingVoice = findViewById(R.id.StartMeetingVoice);
|
||||
StartMeetingVideo = findViewById(R.id.StartMeetingVideo);
|
||||
ButtonDelGroup = findViewById(R.id.ButtonDelGroup);
|
||||
buttonAddVol = findViewById(R.id.imageViewAddVoice);
|
||||
buttonAddVol.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
chgVolum(v, true);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
buttonDelVol = findViewById(R.id.imageViewDelVoice);
|
||||
buttonDelVol.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
chgVolum(v, false);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
ButtonDelGroup.setVisibility(View.INVISIBLE);
|
||||
StartMeetingVoice.setVisibility(View.INVISIBLE);
|
||||
StartMeetingVideo.setVisibility(View.INVISIBLE);
|
||||
refreshView();
|
||||
|
||||
currSelectData = DBHead.newHead4Total();
|
||||
currSelectData.isSelected = true;
|
||||
headers.add(currSelectData);
|
||||
initTabAndPager();
|
||||
Net.getGroups(null, null);
|
||||
Net.getUsers(null, null);
|
||||
checkBeforeMeetingState();
|
||||
}
|
||||
|
||||
// 处理当前分机号可能有需要加入的会议
|
||||
private void checkBeforeMeetingState() {
|
||||
Net.getUserInfor(DBUser.mySelf.phone, new HttpUtl.CallBack() {
|
||||
@Override
|
||||
public void onRequestComplete(int cmd, String result, Object orgs) {
|
||||
JSONArray array = JSONObject.parseObject(result).getJSONArray("agents");
|
||||
JSONObject jo = array.getJSONObject(0);
|
||||
JSONArray comment = jo.getJSONArray("comment");
|
||||
if (comment != null && comment.size() > 0) {
|
||||
List<String> list = new ArrayList<>();
|
||||
for (Object o : comment) {
|
||||
JSONObject com = (JSONObject) o;
|
||||
String name = com.getString("topic") + "【" + ((com.getString("type").equals("video_profile")) ? "视频会议" : "语音会议") + "】";
|
||||
list.add(name);
|
||||
}
|
||||
|
||||
UIUtl.showBottomSheetList("您有会议需要加入", list, new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() {
|
||||
@Override
|
||||
public void onClick(QMUIBottomSheet dialog, View itemView, int position, String tag) {
|
||||
JSONObject o = comment.getJSONObject(position);
|
||||
SipEngine.getInstance().CallNumber(o.getString("nbr"), (o.getString("type").equals("video_profile")) ? true : false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestError(int cmd, String result, Object orgs) {
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
|
||||
void refreshHeaders() {
|
||||
DBHead h = headers.get(0);
|
||||
headers.clear();
|
||||
headers.add(h);
|
||||
headers.addAll(DBHead.allGroups);
|
||||
|
||||
mPagerAdapter.notifyDataSetChanged();
|
||||
mTabSegment.reset();
|
||||
QMUITabBuilder tabBuilder = mTabSegment.tabBuilder();
|
||||
for (int i = 0; i < headers.size(); i++) {
|
||||
mTabSegment.addTab(tabBuilder.setText(headers.get(i).name).build(this));
|
||||
}
|
||||
mTabSegment.notifyDataChanged();
|
||||
}
|
||||
|
||||
private void initTabAndPager() {
|
||||
mContentViewPager.setAdapter(mPagerAdapter);
|
||||
// mContentViewPager.setCurrentItem(mDestPage.getPosition(), false);
|
||||
QMUITabBuilder tabBuilder = mTabSegment.tabBuilder();
|
||||
for (int i = 0; i < headers.size(); i++) {
|
||||
mTabSegment.addTab(tabBuilder.setText(headers.get(i).name).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) {
|
||||
currSelectData = headers.get(index);
|
||||
if (currSelectData.isAll()) {
|
||||
ButtonDelGroup.setVisibility(View.INVISIBLE);
|
||||
StartMeetingVoice.setVisibility(View.INVISIBLE);
|
||||
StartMeetingVideo.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
StartMeetingVoice.setVisibility(View.VISIBLE);
|
||||
StartMeetingVideo.setVisibility(View.VISIBLE);
|
||||
if (DBUser.mySelf.isManager) {
|
||||
ButtonDelGroup.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
ButtonDelGroup.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
//显示分机
|
||||
allUsers.clear();
|
||||
if(currSelectData.isAll()) {
|
||||
allUsers.addAll(DBUser.allUser);
|
||||
setUsers();
|
||||
} else {
|
||||
setUsers();
|
||||
//取得数据
|
||||
Net.getGroupMenbers(currSelectData.id, null, currSelectData.id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(int index) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(int index) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDoubleTap(int index) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void refreshView() {
|
||||
//通话音量
|
||||
int max = audioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
|
||||
int current = audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL);
|
||||
textVolum.setText("音量:" + current);
|
||||
if (DBUser.mySelf != null && DBUser.mySelf.phone != null) {
|
||||
textSelfNum.setText("分机号:" + DBUser.mySelf.phone);
|
||||
}
|
||||
if (DBUser.mySelf != null && DBUser.mySelf.isManager) {
|
||||
buttonAddGroup.setVisibility(View.VISIBLE);
|
||||
imageViewAddGroupIcon.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
buttonAddGroup.setVisibility(View.INVISIBLE);
|
||||
imageViewAddGroupIcon.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
void chgVolum(View v, boolean isAdd) {
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!v.isPressed()) {
|
||||
return;
|
||||
}
|
||||
if (isAdd) {
|
||||
addVolume(v);
|
||||
} else {
|
||||
delVolume(v);
|
||||
}
|
||||
if (v.isPressed()) {
|
||||
chgVolum(v, isAdd);
|
||||
}
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
static Runnable runGetUsers = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Net.getUsers(null, null);
|
||||
}
|
||||
};
|
||||
|
||||
public View getPageView(int pos) {
|
||||
return gridUser;
|
||||
}
|
||||
|
||||
public void getUsersData() {
|
||||
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() {
|
||||
if (DBUser.allUser == null) return;
|
||||
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;
|
||||
if (d.isAddFlag) {
|
||||
//TODO:
|
||||
return;
|
||||
}
|
||||
QMUIQuickAction qa = QMUIPopups.quickAction(MainActivity.this,
|
||||
QMUIDisplayHelper.dp2px(MainActivity.this, 56),
|
||||
QMUIDisplayHelper.dp2px(MainActivity.this, 56))
|
||||
.shadow(true)
|
||||
.dimAmount(0.5f)
|
||||
.skinManager(QMUISkinManager.defaultInstance(MainActivity.this))
|
||||
.edgeProtection(QMUIDisplayHelper.dp2px(MainActivity.this, 20))
|
||||
.addAction(new QMUIQuickAction.Action().icon(R.drawable.voice2).text("语音").onClick(
|
||||
new QMUIQuickAction.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(QMUIQuickAction quickAction, QMUIQuickAction.Action action, int position) {
|
||||
quickAction.dismiss();
|
||||
SipEngine.getInstance().CallNumber(d.phone, false);
|
||||
}
|
||||
}
|
||||
))
|
||||
.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();
|
||||
SipEngine.getInstance().CallNumber(d.phone, true);
|
||||
}
|
||||
}
|
||||
));
|
||||
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();
|
||||
//TODO:移除分机
|
||||
}
|
||||
}
|
||||
));
|
||||
}
|
||||
qa.show(view);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
adapterUser.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
// public void refreshHeadList() {
|
||||
// adapter.notifyDataSetChanged();
|
||||
// }
|
||||
|
||||
public void call(View view) {
|
||||
startActivity(new Intent(MainActivity.this, CallActivity.class));
|
||||
}
|
||||
|
||||
public void meeting(View view) {
|
||||
}
|
||||
|
||||
public void message(View view) {
|
||||
}
|
||||
|
||||
public void report(View view) {
|
||||
}
|
||||
|
||||
// public void exit(View view) {
|
||||
// if (ActivityMgr.getActivity(LoginActivity.class) == null) {
|
||||
// Intent intent = new Intent(this, LoginActivity.class);
|
||||
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// startActivity(intent);
|
||||
// }
|
||||
// finish();
|
||||
// SipEngine.getInstance().Unregister();
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleMessage(Message m) {
|
||||
switch (m.what) {
|
||||
case CONS.FINISH:
|
||||
finish();
|
||||
break;
|
||||
case Net.CMD_getUsers:
|
||||
getUsersData();
|
||||
if (currSelectData.isAll()) {
|
||||
allUsers.clear();
|
||||
allUsers.addAll(DBUser.allUser);
|
||||
setUsers();
|
||||
}
|
||||
break;
|
||||
case Net.CMD_getGroupMenbers:
|
||||
NetPkg pkg = (NetPkg)(m.obj);
|
||||
String oldUUID = pkg.orgs.toString();
|
||||
if (!currSelectData.isAll() && oldUUID.equals(currSelectData.id)) {
|
||||
//TODO:解析数据
|
||||
//根据权限来处理
|
||||
if (DBUser.mySelf.isManager) {
|
||||
DBUser u = new DBUser("", "添加分机", "false");
|
||||
u.isAddFlag = true;
|
||||
allUsers.add(u);
|
||||
}
|
||||
setUsers();
|
||||
}
|
||||
break;
|
||||
case Net.CMD_getGroups:
|
||||
refreshHeaders();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
handler.removeCallbacks(runGetUsers);
|
||||
}
|
||||
|
||||
public void addVolume(View view) {
|
||||
// UIUtl.toast("音量加");
|
||||
// int max = audioManager.getStreamMaxVolume( AudioManager.STREAM_VOICE_CALL );
|
||||
audioManager.adjustStreamVolume(AudioManager.STREAM_VOICE_CALL, AudioManager.ADJUST_RAISE, 0);
|
||||
int current = audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL);
|
||||
textVolum.setText("音量:" + current);
|
||||
}
|
||||
|
||||
public void delVolume(View view) {
|
||||
// UIUtl.toastW("音量减");
|
||||
audioManager.adjustStreamVolume(AudioManager.STREAM_VOICE_CALL, AudioManager.ADJUST_LOWER, 0);
|
||||
int current = audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL);
|
||||
textVolum.setText("音量:" + current);
|
||||
}
|
||||
|
||||
public void addGroup(View view) {
|
||||
startActivity(new Intent(this, CreateGroupActivity.class));
|
||||
}
|
||||
|
||||
public void addTmpMeeting(View view) {
|
||||
startActivity(new Intent(this, CreateMeetingActivity.class));
|
||||
}
|
||||
|
||||
public void logout(View v) {
|
||||
SipEngine.getInstance().onLine = false;
|
||||
SipEngine.getInstance().isRelogin = true;
|
||||
// SipEngine.getInstance().Unregister();
|
||||
// SipEngine.getInstance().stop();
|
||||
Intent intent = new Intent(App.getContext(), LoginActivity.class);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean("donotAutoLogin", true);
|
||||
intent.putExtras(bundle);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
public void doMeetingVoice4Group(View v) {
|
||||
if (currSelectData.isAll()) {
|
||||
return;
|
||||
}
|
||||
SipEngine.getInstance().CallNumber(currSelectData.audio_code, false);
|
||||
}
|
||||
|
||||
public void doMeetingVideo4Group(View v) {
|
||||
if (currSelectData.isAll()) {
|
||||
return;
|
||||
}
|
||||
SipEngine.getInstance().CallNumber(currSelectData.video_code, true);
|
||||
}
|
||||
|
||||
public void deleteGroup(View v) {
|
||||
if (currSelectData.isAll()) {
|
||||
return;
|
||||
}
|
||||
new QMUIDialog.MessageDialogBuilder(this)
|
||||
.setTitle("提示")
|
||||
.setMessage("确定要删除分组吗?")
|
||||
.setSkinManager(QMUISkinManager.defaultInstance(this))
|
||||
.addAction("取消", new QMUIDialogAction.ActionListener() {
|
||||
@Override
|
||||
public void onClick(QMUIDialog dialog, int index) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
})
|
||||
.addAction(0, "删除", QMUIDialogAction.ACTION_PROP_NEGATIVE, new QMUIDialogAction.ActionListener() {
|
||||
@Override
|
||||
public void onClick(QMUIDialog dialog, int index) {
|
||||
//TODO:
|
||||
dialog.dismiss();
|
||||
}
|
||||
})
|
||||
.create(mCurrentDialogStyle).show();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user