فهرست منبع

<重新修改科室主机列表及通话界面>

weizhengliang 5 سال پیش
والد
کامیت
0df6de42e7

+ 35 - 18
app/src/main/java/com/wdkl/callingmainnursemanager/adapter/NurseHostAdapter.java

@@ -2,6 +2,7 @@ package com.wdkl.callingmainnursemanager.adapter;
 
 import android.content.Context;
 import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -29,6 +30,7 @@ public class NurseHostAdapter extends RecyclerView.Adapter<NurseHostAdapter.MyVi
     private List<PartInfoEntity.PartInfo> list;
     private LayoutInflater inflater;
     private NurseHostItemOnclickListener itemOnclickListener;
+    private NurseHostCallOnClickListener callOnClickListener;
     private NurseHostListInfo nurseHostEntity = new NurseHostListInfo();
     private int selectedPosition = -1;
 
@@ -51,23 +53,27 @@ public class NurseHostAdapter extends RecyclerView.Adapter<NurseHostAdapter.MyVi
         this.itemOnclickListener = itemOnclickListener;
     }
 
+    public void setNurseHostCallOnClickListener(NurseHostCallOnClickListener callOnClickListener) {
+        this.callOnClickListener = callOnClickListener;
+    }
+
     @Override
     public NurseHostAdapter.MyViewHolder onCreateViewHolder(ViewGroup viewGroup, int position) {
-        View view = inflater.inflate(R.layout.fragment_nurse_host_adapter, viewGroup, false);
-        MyViewHolder holder = new MyViewHolder(view, itemOnclickListener);
+        View view = inflater.inflate(R.layout.fragment_nurse_host_item_layout, viewGroup, false);
+        MyViewHolder holder = new MyViewHolder(view, itemOnclickListener, callOnClickListener);
         return holder;
     }
 
     @Override
     public void onBindViewHolder(NurseHostAdapter.MyViewHolder holder, int position) {
         if (null == list.get(position)) return;
-        holder.tvNurseHostNo.setText(list.get(position).getPART_NAME());
-        holder.ivNurseHost.setTag(position);
+        holder.tvNurseHostName.setText(list.get(position).getPART_NAME());
+        /*holder.ivNurseHost.setTag(position);
         if (list.get(position).isChecked()) {
             holder.ivNurseHost.setImageResource(R.mipmap.ic_nurse_sel);
         } else {
             holder.ivNurseHost.setImageResource(R.mipmap.ic_nurse_standby);
-        }
+        }*/
     }
 
     @Override
@@ -79,28 +85,35 @@ public class NurseHostAdapter extends RecyclerView.Adapter<NurseHostAdapter.MyVi
     public class MyViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
 
         private NurseHostItemOnclickListener itemOnclickListener;
+        private NurseHostCallOnClickListener callOnClickListener;
 
-        //护士主机头像
-        @Bind(R.id.adapter_iv_nurse_host)
-        ImageView ivNurseHost;
+        @Bind(R.id.tv_nurse_host_name)
+        TextView tvNurseHostName;
+        @Bind(R.id.iv_nurse_host_call)
+        ImageView ivNurseCall;
 
-        //护士主机编号
-        @Bind(R.id.adapter_tv_nurse_host_no)
-        TextView tvNurseHostNo;
-
-        public MyViewHolder(View itemView, NurseHostAdapter.NurseHostItemOnclickListener itemOnclickListener) {
+        public MyViewHolder(View itemView, NurseHostAdapter.NurseHostItemOnclickListener itemOnclickListener, NurseHostCallOnClickListener callOnClickListener) {
             super(itemView);
             ButterKnife.bind(this, itemView);
             this.itemOnclickListener = itemOnclickListener;
-            ivNurseHost.setOnClickListener(this);
+            this.callOnClickListener = callOnClickListener;
+            tvNurseHostName.setOnClickListener(this);
+            ivNurseCall.setOnClickListener(this);
         }
 
         @Override
         public void onClick(View view) {
-            if (itemOnclickListener != null) {
-                itemOnclickListener.nurseHostItemOnclick(view, getLayoutPosition());
-                selectedPosition = getLayoutPosition(); //选择的position赋值给参数,
-                notifyDataSetChanged();
+            if (view.getId() == R.id.tv_nurse_host_name) {
+                if (itemOnclickListener != null) {
+                    itemOnclickListener.nurseHostItemOnclick(view, getLayoutPosition());
+                    selectedPosition = getLayoutPosition(); //选择的position赋值给参数,
+                    //notifyDataSetChanged();
+                }
+            } else if (view.getId() == R.id.iv_nurse_host_call) {
+                if (callOnClickListener != null) {
+                    callOnClickListener.nurseHostCallOnClick(view, getLayoutPosition());
+                    selectedPosition = getLayoutPosition();
+                }
             }
 
         }
@@ -109,4 +122,8 @@ public class NurseHostAdapter extends RecyclerView.Adapter<NurseHostAdapter.MyVi
     public interface NurseHostItemOnclickListener {
         void nurseHostItemOnclick(View view, int position);
     }
+
+    public interface NurseHostCallOnClickListener {
+        void nurseHostCallOnClick(View view, int position);
+    }
 }

+ 14 - 11
app/src/main/java/com/wdkl/callingmainnursemanager/adapter/SicknessRoomAdapter.java

@@ -10,6 +10,7 @@ import android.widget.ImageView;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import com.wdkl.callingmainnursemanager.MyApplication;
 import com.wdkl.callingmainnursemanager.R;
 import com.wdkl.callingmainnursemanager.common.Constants;
 import com.wdkl.callingmainnursemanager.entity.MessageEvent;
@@ -40,9 +41,11 @@ public class SicknessRoomAdapter extends RecyclerView.Adapter<SicknessRoomAdapte
     }
 
     public void updateList(ArrayList<RoomEntity.WardInformation> list) {
-        this.list = list;
-        selectedPosition = -1;
-        notifyDataSetChanged();
+        if (list != null) {
+            this.list = list;
+            selectedPosition = -1;
+            notifyDataSetChanged();
+        }
     }
 
     public void setSicknessRoomItemOnClickListener(CallingSicknessRoomItemOnclickListener itemOnclickListener) {
@@ -58,7 +61,7 @@ public class SicknessRoomAdapter extends RecyclerView.Adapter<SicknessRoomAdapte
 
     @Override
     public void onBindViewHolder(MyViewHolder holder, int position) {
-        if (position == 0) {
+        /*if (position == 0) {
             //设置第一个item的UI
             holder.standby_top_Img.setVisibility(View.GONE);
             holder.tvBedNum.setVisibility(View.GONE);
@@ -66,14 +69,14 @@ public class SicknessRoomAdapter extends RecyclerView.Adapter<SicknessRoomAdapte
             holder.tvTitle.setVisibility(View.VISIBLE);
 
             //获取全局的呼叫列表
-            /*if (((MyApplication) mcontext.getApplicationContext()).callEntityList.size() > 0) {
+            if (((MyApplication) mcontext.getApplicationContext()).callEntityList.size() > 0) {
                 holder.tvPoint.setText(((MyApplication) mcontext.getApplicationContext()).callEntityList.size() + "");
                 holder.tvPoint.setVisibility(View.VISIBLE);
             } else {
                 holder.tvPoint.setVisibility(View.GONE);
-            }*/
+            }
 
-        } else {
+        } else */{
             holder.tvTitle.setVisibility(View.GONE);
             //是否在护理中...改变UI
             if (list.get(position).isNursing()) {//在护理中...
@@ -111,16 +114,16 @@ public class SicknessRoomAdapter extends RecyclerView.Adapter<SicknessRoomAdapte
 
         //点中item 的逻辑
         //如果选中的是第一个
-        if (selectedPosition == 0) {
+        /*if (selectedPosition == 0) {
             if (selectedPosition == position) {
                 holder.rlCallMain.setBackgroundResource(R.mipmap.bg_part_item);
             } else {
                 holder.rlCallMain.setBackgroundResource(R.mipmap.bg_stanby_n);
             }
-        } else {
-            if (position == 0) {
+        } else */{
+            /*if (position == 0) {
                 holder.rlCallMain.setBackgroundResource(R.mipmap.bg_part_item);
-            } else {
+            } else*/ {
                 if (selectedPosition == position) {
                     if (list.get(position).isNursing()) {
                         holder.rlCallMain.setBackgroundResource(R.mipmap.bg_nursing_p);

+ 2 - 0
app/src/main/java/com/wdkl/callingmainnursemanager/common/Constants.java

@@ -125,6 +125,8 @@ public class Constants {
 
     public static final int EVENT_UDP2 = 0x20;
 
+    public static final int EVENT_CALL = 0x21;
+
     /**
      * APP更新flag值<br></>
      * false为无更新指令。

+ 4 - 9
app/src/main/java/com/wdkl/callingmainnursemanager/entity/RoomEntity.java

@@ -15,15 +15,10 @@ public class RoomEntity {
     }
 
     public ArrayList<WardInformation> getWardInformationList() {
-        WardInformation callEntity = new WardInformation();
-        if (null != wardInformationList) {
-            for (WardInformation wardInformation : wardInformationList) {
-                if (wardInformation.getSickbedInformationList() == null || wardInformation.getSickbedInformationList().isEmpty()) {
-                    wardInformationList.remove(wardInformation);
-                }
-            }
-            wardInformationList.add(0, callEntity);
-        }
+        //WardInformation callEntity = new WardInformation();
+        //if (null != wardInformationList) {
+        //    wardInformationList.add(0, callEntity);
+        //}
         return wardInformationList;
     }
 

+ 3 - 2
app/src/main/java/com/wdkl/callingmainnursemanager/ui/activity/MainFragmentActivity.java

@@ -551,6 +551,7 @@ public class MainFragmentActivity extends FragmentActivity implements IVvsipServ
                 } else {
                     // 如果MessageFragment不为空,则直接将它显示出来
                     transaction.show(callingSickBedFragment);
+                    callingSickBedFragment.updateBedInfo();
                 }
                 break;
             case 2:
@@ -639,11 +640,11 @@ public class MainFragmentActivity extends FragmentActivity implements IVvsipServ
     public boolean onTouchEvent(MotionEvent event) {
         switch (event.getAction()) {
             case MotionEvent.ACTION_DOWN:
-                UIUtils.rvSideslipShowPopu(MainFragmentActivity.this, event);
+                //UIUtils.rvSideslipShowPopu(MainFragmentActivity.this, event);
                 break;
             case MotionEvent.ACTION_UP:
                 if (isInitFloatViewLocation)
-                    UIUtils.rvSideslipShowPopu(MainFragmentActivity.this, event);
+                    //UIUtils.rvSideslipShowPopu(MainFragmentActivity.this, event);
                 break;
             default:
                 break;

+ 30 - 8
app/src/main/java/com/wdkl/callingmainnursemanager/ui/fragment/CallingBedFragment.java

@@ -63,6 +63,7 @@ import com.wdkl.callingmainnursemanager.util.PopupwindowVoiceNoticeUtil;
 import com.zhy.http.okhttp.OkHttpUtils;
 import com.zhy.http.okhttp.callback.StringCallback;
 
+import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 import org.greenrobot.eventbus.ThreadMode;
 import org.json.JSONException;
@@ -165,6 +166,9 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
     @Bind(R.id.tv_part_title)
     TextView tvPartTitle;
 
+    @Bind(R.id.right_patient_info_layout_tv_back)
+    TextView tvBackHost;
+
     /**
      * 病房适配器
      */
@@ -255,6 +259,9 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
     //拨号图片
     @Bind(R.id.fragment_calling_right_layout_ll_call)
     LinearLayout llCallPic;
+    //返回按钮
+    @Bind(R.id.right_in_call_list_layout_iv_back)
+    TextView tvBack;
 
     @Bind(R.id.fragment_calling_right_layout_ll_calls)
     LinearLayout llCallPics;
@@ -452,7 +459,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
         rvCallBed.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
             @Override
             public boolean onInterceptTouchEvent(RecyclerView recyclerView, MotionEvent motionEvent) {
-                UIUtils.rvSideslipShowPopu(getActivity(), motionEvent);
+                //UIUtils.rvSideslipShowPopu(getActivity(), motionEvent);
                 return false;
             }
 
@@ -467,7 +474,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
         rvCallRoom.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
             @Override
             public boolean onInterceptTouchEvent(RecyclerView recyclerView, MotionEvent motionEvent) {
-                UIUtils.rvSideslipShowPopu(getActivity(), motionEvent);
+                //UIUtils.rvSideslipShowPopu(getActivity(), motionEvent);
                 return false;
             }
 
@@ -482,7 +489,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
         rvCallList.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
             @Override
             public boolean onInterceptTouchEvent(RecyclerView recyclerView, MotionEvent motionEvent) {
-                UIUtils.rvSideslipShowPopu(getActivity(), motionEvent);
+                //UIUtils.rvSideslipShowPopu(getActivity(), motionEvent);
                 return false;
             }
 
@@ -532,7 +539,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
 
         initRecyclerManager();
 
-        setPartId();  //设置科室id
+        //setPartId();  //设置科室id
         updatePartName();  //更新科室名称
         resetData();
         getData();  //获取数据
@@ -999,12 +1006,17 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
     private void resetData() {
         wardInformationList.clear();
         sickbedInformationList.clear();
-        RoomEntity.WardInformation callEntity = new RoomEntity.WardInformation();
-        wardInformationList.add(callEntity);
         roomAdapter.updateList(wardInformationList);
         bedAdapter.listUpdate(sickbedInformationList);
     }
 
+    public void updateBedInfo() {
+        updatePartName();
+        resetData();
+        getData();
+        getHospitalData();
+    }
+
     /**
      * 获取系统设置信息
      */
@@ -1223,6 +1235,16 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
         }
     }
 
+    @OnClick(R.id.right_in_call_list_layout_iv_back)
+    public void back() {
+        EventBus.getDefault().post(new MessageEvent(0, Constants.EVENT_FRAGMENT));
+    }
+
+    @OnClick(R.id.right_patient_info_layout_tv_back)
+    public void backHost() {
+        EventBus.getDefault().post(new MessageEvent(0, Constants.EVENT_FRAGMENT));
+    }
+
     private void setHospitalView() {
         if (null != hospitalInfoEntity) {
             tvPatientNum.setText(hospitalInfoEntity.getPatientNum());
@@ -1255,7 +1277,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
             vRightCallListInfo.setVisibility(View.GONE);
         }
         //重置床位数据
-        if (position == 0) {
+        /*if (position == 0) {
             //sickbedInformationList = null;
             //callListAdapter.updateList(((MyApplication) getActivity().getApplication()).callEntityList);
             rvCallBed.setVisibility(View.GONE);
@@ -1264,7 +1286,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
             //tvTitle.setText("呼叫列表");
             //显示科室选择框
             showPartSelectDialog();
-        } else {
+        } else */{
             llBgList.setBackgroundResource(R.mipmap.bg_bed_list);
             tvTitle.setText("床位列表");
             rvCallList.setVisibility(View.GONE);

+ 109 - 36
app/src/main/java/com/wdkl/callingmainnursemanager/ui/fragment/CallingHostFragment.java

@@ -4,13 +4,19 @@ import android.os.Bundle;
 import android.os.Handler;
 import android.support.annotation.Nullable;
 import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.app.AlertDialog;
 import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
+import android.util.Log;
+import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
@@ -42,6 +48,7 @@ import com.wdkl.callingmainnursemanager.util.UdpSendUtil;
 import com.zhy.http.okhttp.OkHttpUtils;
 import com.zhy.http.okhttp.callback.StringCallback;
 
+import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 import org.greenrobot.eventbus.ThreadMode;
 import org.json.JSONArray;
@@ -65,7 +72,7 @@ import static com.wdkl.callingmainnursemanager.util.ToastUtil.showToast;
  */
 
 public class CallingHostFragment extends BaseFragment implements DoctorHostAdapter.DoctorHostItemOnclickListener,
-        NurseHostAdapter.NurseHostItemOnclickListener, View.OnClickListener,
+        NurseHostAdapter.NurseHostItemOnclickListener, NurseHostAdapter.NurseHostCallOnClickListener, View.OnClickListener,
         MedicalHostsCallingQueuingInfoAdapter.CallingQueuingBarItemOnClickListener, RecyclerView.OnItemTouchListener, SwipeRefreshLayout.OnRefreshListener {
 
     private View mView;
@@ -232,6 +239,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
         nurseHostAdapter = new NurseHostAdapter(getActivity(), MyApplication.partInfoList);
         rvNurse.setAdapter(nurseHostAdapter);
         nurseHostAdapter.setNurseHostItemOnclickListener(this);
+        nurseHostAdapter.setNurseHostCallOnClickListener(this);
 
         //责任医生列表
         GridLayoutManager layoutManager = new GridLayoutManager(getActivity(), 3);
@@ -543,6 +551,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
                         @Override
                         public void onError(Call call, Exception e, int id) {
                             LogUtil.d("getNurseHostInfo", "===error===");
+                            ToastUtil.showToast("网络错误!");
                         }
 
                         @Override
@@ -551,6 +560,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
                                 JSONObject jsonObj = new JSONObject(response);
                                 if (jsonObj.getString("Code").equals("ERROR!")) {
                                     LogUtil.d("getNurseHostInfo", "网络错误");
+                                    ToastUtil.showToast("网络错误!");
                                 } else {
                                     if (jsonObj.getString("Code").equals("OK!")) {
                                         String data = jsonObj.getString("hostList");
@@ -565,22 +575,11 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
                                         if (nurseHostList.size() > 0 && nurseHostList.get(0) != null) {
                                             NurseHostListInfo hostInfo = nurseHostList.get(0);
                                             final String hostId = hostInfo.getDeviceHostingID();
-                                            //final String sip = hostInfo.getDeviceSipIp();
-                                            //final String name = hostInfo.getDeviceName();
-                                            ivEndCalling.setOnClickListener(new View.OnClickListener() {
-                                                @Override
-                                                public void onClick(View v) {
-                                                    getActivity().runOnUiThread(new Runnable() {
-                                                        @Override
-                                                        public void run() {
-                                                            callClick(hostId);
-                                                        }
-                                                    });
-                                                }
-                                            });
+                                            EventBus.getDefault().post(new MessageEvent(hostId, Constants.EVENT_CALL));
                                         }
                                     } else {
                                         LogUtil.d("Code", "网络错误");
+                                        ToastUtil.showToast("网络错误!");
                                     }
                                 }
                             } catch (JSONException e) {
@@ -593,25 +592,22 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
         }
     }
 
-    private void callClick(String hostId) {
+    private void sendCall(String hostId) {
         if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
-            //呼叫中
-            ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_hang_up);
-            nurse_CallStaus.setText("正在呼叫...");
             UdpSendUtil.sendNurseHostCall(hostId);
             Constants.CALL_STATE = Constants.IN_CALL;
             Constants.CALLING_HOST_ID = hostId;
             Constants.CallType = Constants.MANAGER_CALL;
-        } else {
-            //主动挂断
-            if (Constants.CallType.equals(Constants.MANAGER_CALL)) {
-                ((MainFragmentActivity) getActivity()).endCalled();
-                ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_calling);
-                nurse_CallStaus.setText("");
-                UdpSendUtil.sendNurseHostHangUp(hostId);
-                Constants.CALL_STATE = Constants.STANDBY;
-                Constants.CALLING_HOST_ID = "";
-            }
+        }
+    }
+
+    private void endCall(String hostId) {
+        if (!Constants.CALL_STATE.equals(Constants.STANDBY) && Constants.CallType.equals(Constants.MANAGER_CALL)) {
+            ((MainFragmentActivity) getActivity()).endCalled();
+            callDialogDismiss();
+            UdpSendUtil.sendNurseHostHangUp(hostId);
+            Constants.CALL_STATE = Constants.STANDBY;
+            Constants.CALLING_HOST_ID = "";
         }
     }
 
@@ -661,7 +657,16 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
      */
     @Override
     public void nurseHostItemOnclick(View view, int position) {
-        if (!Constants.CALL_STATE.equals(Constants.STANDBY) && Constants.CallType.equals(Constants.MANAGER_CALL)) {
+        if (MyApplication.partInfoList.size() > 0 && position < MyApplication.partInfoList.size()) {
+            Constants.SelectedPartId = MyApplication.partInfoList.get(position).getID();
+            Constants.SelectedPartName = MyApplication.partInfoList.get(position).getPART_NAME();
+        } else {
+            ToastUtil.showToast("数据异常,请下拉刷新后重试!");
+            return;
+        }
+        EventBus.getDefault().post(new MessageEvent(1, Constants.EVENT_FRAGMENT));
+
+        /*if (!Constants.CALL_STATE.equals(Constants.STANDBY) && Constants.CallType.equals(Constants.MANAGER_CALL)) {
             ToastUtil.showToast("请先取消当前呼叫");
             return;
         }
@@ -687,9 +692,61 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
 
             getPartData(info.getID());
             getNurseHostInfo(info.getID());
+        }*/
+    }
+
+    @Override
+    public void nurseHostCallOnClick(View view, int position) {
+        String partId;
+        if (MyApplication.partInfoList.size() > 0 && position < MyApplication.partInfoList.size()) {
+            partName = MyApplication.partInfoList.get(position).getPART_NAME();
+            partId = MyApplication.partInfoList.get(position).getID();
+        } else {
+            ToastUtil.showToast("数据异常,请下拉刷新后重试!");
+            return;
         }
+
+        getNurseHostInfo(partId);
+    }
+
+    private String partName;
+    private AlertDialog callDialog;
+    private AlertDialog createCallDialog(String partName, final String hostId) {
+        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.CallingDialog);
+        final AlertDialog dialog = builder.create();
+        dialog.setCanceledOnTouchOutside(false);
+        View dialogView = View.inflate(getActivity(), R.layout.dialog_host_call_layout, null);
+        TextView tvCallStatus = dialogView.findViewById(R.id.tv_call_status);
+        tvCallStatus.setText("正在呼叫...");
+        TextView tvPartName = dialogView.findViewById(R.id.tv_call_part_name);
+        tvPartName.setText(partName);
+        Button button = dialogView.findViewById(R.id.btn_call);
+        button.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                endCall(hostId);
+                dialog.dismiss();
+            }
+        });
+        dialog.setView(dialogView);
+
+        return dialog;
     }
 
+    private void updateCallDialogStatus(String status) {
+        if (callDialog != null && callDialog.isShowing()) {
+            TextView textView = (TextView) callDialog.findViewById(R.id.tv_call_status);
+            textView.setText(status);
+        }
+    }
+
+    private void callDialogDismiss() {
+        if (callDialog != null && callDialog.isShowing()) {
+            callDialog.dismiss();
+        }
+    }
+
+
     /**
      * 呼叫排队信息栏适配器条目点击事件
      *
@@ -708,7 +765,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
 
     @Override
     public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
-        UIUtils.rvSideslipShowPopu(getActivity(), e);
+        //UIUtils.rvSideslipShowPopu(getActivity(), e);
         return false;
     }
 
@@ -730,26 +787,42 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
                 String nurseHostID = udpEntity.getNurseHostID();
                 if (Constants.CALLING_HOST_ID.equals(nurseHostID)) {
                     //对方挂断
-                    ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_calling);
-                    nurse_CallStaus.setText("");
+                    //ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_calling);
+                    //nurse_CallStaus.setText("");
                     Constants.CALL_STATE = Constants.STANDBY;
                     Constants.CALLING_HOST_ID = "";
+                    callDialogDismiss();
                 }
                 break;
             case Constants.EVENT_SIP:
-                LogUtil.d("CallingHost", "Constants.CallType == " + Constants.CallType);
+                //LogUtil.d("CallingHost", "Constants.CallType == " + Constants.CallType);
                 if (Constants.CallType.equals(Constants.MANAGER_CALL)) {
                     if (Constants.CALL_STATE.equals(Constants.IN_CALL)) {
                         ((MainFragmentActivity) getActivity()).autoCall();
                     } else if (Constants.CALL_STATE.equals(Constants.IN_CALLING)) {
-                        nurse_CallStaus.setText("正在通话中...");
+                        //nurse_CallStaus.setText("正在通话中...");
+                        updateCallDialogStatus("正在通话中...");
                     } else if (Constants.CALL_STATE.equals(Constants.STANDBY)) {
-                        ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_calling);
-                        nurse_CallStaus.setText("");
+                        //ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_calling);
+                        //nurse_CallStaus.setText("");
                         Constants.CALLING_HOST_ID = "";
+                        callDialogDismiss();
                     }
                 }
                 break;
+            case Constants.EVENT_CALL:
+                String hostId = (String) messageEvent.getMessage();
+                callDialog = createCallDialog(partName, hostId);
+                Window window = callDialog.getWindow();
+                callDialog.show();
+                if (window != null) {
+                    WindowManager.LayoutParams lp = window.getAttributes();
+                    lp.width = WindowManager.LayoutParams.MATCH_PARENT;
+                    lp.height = WindowManager.LayoutParams.MATCH_PARENT;
+                    window.setAttributes(lp);
+                }
+                sendCall(hostId);
+                break;
         }
     }
 

+ 4 - 0
app/src/main/res/drawable/dialog_transparent_bg.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/transparent_bg" />
+</shape>

+ 36 - 0
app/src/main/res/layout/dialog_host_call_layout.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:gravity="center"
+    android:orientation="vertical">
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:src="@mipmap/ic_request_host_agree"/>
+    <TextView
+        android:id="@+id/tv_call_status"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textColor="@color/white"
+        android:textSize="28dp"
+        android:text="正在呼叫"/>
+    <TextView
+        android:id="@+id/tv_call_part_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textColor="@color/white"
+        android:text="内科"
+        android:textSize="28dp"/>
+    <Button
+        android:id="@+id/btn_call"
+        android:layout_width="160dp"
+        android:layout_height="wrap_content"
+        android:background="@color/red_color"
+        android:layout_marginTop="20dp"
+        android:textColor="@color/white"
+        android:textSize="28dp"
+        android:text="挂断"/>
+
+</LinearLayout>

+ 3 - 2
app/src/main/res/layout/fragment_calling_doctor_medica_hosts.xml

@@ -9,7 +9,7 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_toLeftOf="@+id/fragment_calling_host_rl_right"
-        android:layout_marginTop="15dp"
+        android:layout_margin="20dp"
         android:orientation="vertical">
         <android.support.v4.widget.SwipeRefreshLayout
             android:id="@+id/fragment_calling_nurse_layout_sr_refresh"
@@ -51,7 +51,8 @@
         android:layout_height="match_parent"
         android:layout_alignParentTop="true"
         android:layout_alignParentRight="true"
-        android:layout_alignParentEnd="true">
+        android:layout_alignParentEnd="true"
+        android:visibility="gone">
 
         <include layout="@layout/fragment_medical_hosts_call_queuing_info_bar_layout" />
     </RelativeLayout>

+ 33 - 0
app/src/main/res/layout/fragment_nurse_host_item_layout.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="280dp"
+    android:layout_height="160dp"
+    android:layout_margin="20dp"
+    android:gravity="center"
+    android:background="@drawable/dialog_round_bg">
+
+    <ImageView
+        android:id="@+id/iv_nurse_host_call"
+        android:layout_width="80dp"
+        android:layout_height="80dp"
+        android:layout_centerVertical="true"
+        android:scaleType="centerInside"
+        android:src="@mipmap/ic_request_host_agree"
+        android:layout_alignParentRight="true"
+        android:layout_marginRight="20dp"/>
+
+    <TextView
+        android:id="@+id/tv_nurse_host_name"
+        android:layout_width="140dp"
+        android:layout_height="match_parent"
+        android:layout_alignParentLeft="true"
+        android:layout_marginLeft="20dp"
+        android:layout_marginRight="40dp"
+        android:gravity="left|center_vertical"
+        android:text="医生主机一"
+        android:maxLines="3"
+        android:ellipsize="end"
+        android:textColor="@color/call_sickbed_right_doctor_and_nurse_text_color"
+        android:textSize="30sp" />
+
+</RelativeLayout>

+ 3 - 3
app/src/main/res/layout/fragment_right_in_call_list_layout.xml

@@ -8,12 +8,13 @@
         android:id="@+id/fragment_calling_right_layout_ll_calls"
         android:layout_width="310dp"
         android:layout_height="80dp"
-        android:layout_alignParentBottom="true">
+        android:layout_alignParentBottom="true"
+        android:orientation="vertical">
 
         <ImageView
             android:id="@+id/right_in_call_list_layout_iv_call"
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
+            android:layout_height="80dp"
             android:scaleType="fitXY"
             android:src="@mipmap/ic_calling_sickbed_right_calling" />
     </LinearLayout>
@@ -24,7 +25,6 @@
         android:layout_height="match_parent"
         android:layout_above="@+id/fragment_calling_right_layout_ll_calls"
         android:layout_centerHorizontal="true"
-        android:background="@drawable/shape_call_alllinear_info_bar"
         android:orientation="vertical">
 
         <LinearLayout

+ 19 - 6
app/src/main/res/layout/fragment_right_in_calling_layout.xml

@@ -2,10 +2,11 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="wrap_content"
     android:layout_height="match_parent"
+    android:background="@drawable/shape_call_scroll_info_bar"
     android:orientation="vertical">
 
     <RelativeLayout
-        android:layout_width="300dp"
+        android:layout_width="310dp"
         android:layout_height="match_parent"
         android:layout_above="@+id/fragment_calling_right_layout_ll_bottom"
         android:layout_centerHorizontal="true"
@@ -54,7 +55,7 @@
 
     <LinearLayout
         android:id="@+id/fragment_calling_right_layout_ll_bottom"
-        android:layout_width="300dp"
+        android:layout_width="310dp"
         android:layout_height="match_parent"
         android:layout_above="@+id/fragment_calling_right_layout_ll_call"
         android:layout_centerHorizontal="true"
@@ -264,19 +265,31 @@
     <LinearLayout
         android:id="@+id/fragment_calling_right_layout_ll_call"
         android:layout_width="310dp"
-        android:layout_height="80dp"
+        android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         android:layout_alignParentLeft="true"
         android:layout_alignParentStart="true"
         android:layout_gravity="center"
         android:gravity="center"
-        android:orientation="horizontal">
+        android:orientation="vertical">
 
         <ImageView
             android:id="@+id/right_in_calling_layout_iv_call"
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:scaleType="fitXY"
+            android:layout_height="100dp"
+            android:scaleType="centerInside"
             android:src="@mipmap/ic_calling_sickbed_right_calling" />
+
+        <TextView
+            android:id="@+id/right_in_call_list_layout_iv_back"
+            android:layout_width="match_parent"
+            android:layout_height="80dp"
+            android:background="#257caa"
+            android:gravity="left|center"
+            android:drawableLeft="@mipmap/img_back"
+            android:paddingLeft="100dp"
+            android:textColor="@color/white"
+            android:textSize="28sp"
+            android:text="返回" />
     </LinearLayout>
 </RelativeLayout>

+ 16 - 6
app/src/main/res/layout/fragment_right_patient_info_layout.xml

@@ -2,13 +2,11 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="310dp"
     android:layout_height="match_parent"
-    android:paddingRight="5dp"
     android:orientation="vertical">
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_marginLeft="5dp"
         android:background="@drawable/fragment_call_sickbed_right_bg_shape"
         android:orientation="vertical">
 
@@ -365,7 +363,7 @@
                 android:id="@+id/fragment_rv_duty_doctor"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
-                android:overScrollMode="never"></android.support.v7.widget.RecyclerView>
+                android:overScrollMode="never" />
         </RelativeLayout>
 
         <TextView
@@ -392,7 +390,7 @@
                 android:overScrollMode="never"
                 android:layout_alignParentTop="true"
                 android:layout_alignParentLeft="true"
-                android:layout_alignParentStart="true"></android.support.v7.widget.RecyclerView>
+                android:layout_alignParentStart="true" />
         </RelativeLayout>
 
 
@@ -410,7 +408,19 @@
         <android.support.v7.widget.RecyclerView
             android:id="@+id/fragment_rv_important_message"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:overScrollMode="never"></android.support.v7.widget.RecyclerView>
+            android:layout_height="180dp"
+            android:overScrollMode="never"/>
+
+        <TextView
+            android:id="@+id/right_patient_info_layout_tv_back"
+            android:layout_width="match_parent"
+            android:layout_height="80dp"
+            android:background="#257caa"
+            android:gravity="left|center"
+            android:drawableLeft="@mipmap/img_back"
+            android:paddingLeft="100dp"
+            android:textColor="@color/white"
+            android:textSize="28sp"
+            android:text="返回" />
     </LinearLayout>
 </LinearLayout>

BIN
app/src/main/res/mipmap-mdpi/img_back.png


+ 1 - 0
app/src/main/res/values/colors.xml

@@ -6,6 +6,7 @@
         <color name="red">#FE0103</color>
         <color name="white">#ffffff</color>
         <color name="text_black">#808080</color>
+        <color name="transparent_bg">#D970c6f1</color>
 
         <color name="drawer_header_text">#2c2c2c</color>
         <color name="black">#000000</color>

+ 11 - 0
app/src/main/res/values/styles.xml

@@ -27,6 +27,17 @@
         <item name="android:windowNoTitle">false</item>
     </style>
 
+    <style name="CallingDialog" parent="@android:style/Theme.Dialog">
+        <item name="android:windowBackground">@color/transparent_bg</item>
+        <item name="android:backgroundDimEnabled">false</item>
+        <item name="android:windowNoTitle">true</item>
+        <item name="android:windowFullscreen">true</item>
+        <item name="android:layout_height">match_parent</item>
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:gravity">center</item>
+        <item name="android:layout_gravity">center</item>
+    </style>
+
     <style name="AnimationLeftFade">
         <item name="android:windowEnterAnimation">@anim/in_lefttoright</item>
         <item name="android:windowExitAnimation">@anim/out_righttoleft</item>