|
@@ -34,6 +34,7 @@ import android.widget.Button;
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.RelativeLayout;
|
|
|
|
+import android.widget.SeekBar;
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
@@ -43,10 +44,12 @@ import com.squareup.picasso.Picasso;
|
|
import com.squareup.picasso.Transformation;
|
|
import com.squareup.picasso.Transformation;
|
|
import com.vvsip.ansip.IVvsipServiceListener;
|
|
import com.vvsip.ansip.IVvsipServiceListener;
|
|
import com.vvsip.ansip.VvsipCall;
|
|
import com.vvsip.ansip.VvsipCall;
|
|
|
|
+import com.wdkl.callingbed2.BuildConfig;
|
|
import com.wdkl.callingbed2.MyApplication;
|
|
import com.wdkl.callingbed2.MyApplication;
|
|
import com.wdkl.callingbed2.R;
|
|
import com.wdkl.callingbed2.R;
|
|
import com.wdkl.callingbed2.adapter.CostAdapter;
|
|
import com.wdkl.callingbed2.adapter.CostAdapter;
|
|
import com.wdkl.callingbed2.adapter.DoctorAdapter;
|
|
import com.wdkl.callingbed2.adapter.DoctorAdapter;
|
|
|
|
+import com.wdkl.callingbed2.adapter.VersionInfoAdapter;
|
|
import com.wdkl.callingbed2.base.BaseActivity;
|
|
import com.wdkl.callingbed2.base.BaseActivity;
|
|
import com.wdkl.callingbed2.common.Constants;
|
|
import com.wdkl.callingbed2.common.Constants;
|
|
import com.wdkl.callingbed2.entity.BroadCastEntity;
|
|
import com.wdkl.callingbed2.entity.BroadCastEntity;
|
|
@@ -60,6 +63,7 @@ import com.wdkl.callingbed2.entity.MessageEvent;
|
|
import com.wdkl.callingbed2.entity.NoticeDataEntity;
|
|
import com.wdkl.callingbed2.entity.NoticeDataEntity;
|
|
import com.wdkl.callingbed2.entity.NoticeEntity;
|
|
import com.wdkl.callingbed2.entity.NoticeEntity;
|
|
import com.wdkl.callingbed2.entity.UdpEntity;
|
|
import com.wdkl.callingbed2.entity.UdpEntity;
|
|
|
|
+import com.wdkl.callingbed2.entity.VersionEntity;
|
|
import com.wdkl.callingbed2.receive.AlarmReceiver;
|
|
import com.wdkl.callingbed2.receive.AlarmReceiver;
|
|
import com.wdkl.callingbed2.receive.NetworkConnectChangedReceiver;
|
|
import com.wdkl.callingbed2.receive.NetworkConnectChangedReceiver;
|
|
import com.wdkl.callingbed2.util.BitmapUtils;
|
|
import com.wdkl.callingbed2.util.BitmapUtils;
|
|
@@ -147,6 +151,9 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
//通知界面的数据实体
|
|
//通知界面的数据实体
|
|
private NoticeDataEntity noticeDataEntity;
|
|
private NoticeDataEntity noticeDataEntity;
|
|
private List<NoticeDataEntity.NoticeArray> noticeArrayList;
|
|
private List<NoticeDataEntity.NoticeArray> noticeArrayList;
|
|
|
|
+ //设置界面版本信息
|
|
|
|
+ private List<VersionEntity> versionEntityList;
|
|
|
|
+ private VersionInfoAdapter versionAdapter;
|
|
//通话的状态
|
|
//通话的状态
|
|
private String CALL_STATUS = Constants.STANDBY;
|
|
private String CALL_STATUS = Constants.STANDBY;
|
|
//串口工具类
|
|
//串口工具类
|
|
@@ -232,6 +239,8 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
View vCall;
|
|
View vCall;
|
|
@Bind(R.id.activity_calling_bed_layout_nurse)
|
|
@Bind(R.id.activity_calling_bed_layout_nurse)
|
|
View vNurse;
|
|
View vNurse;
|
|
|
|
+ @Bind(R.id.activity_calling_bed_layout_settings)
|
|
|
|
+ View vSettings;
|
|
@Bind(R.id.activity_calling_bed_layout_welcome)
|
|
@Bind(R.id.activity_calling_bed_layout_welcome)
|
|
View vWelcome;
|
|
View vWelcome;
|
|
@Bind(R.id.activity_calling_bed_layout_main_big_left)
|
|
@Bind(R.id.activity_calling_bed_layout_main_big_left)
|
|
@@ -370,6 +379,20 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
@Bind(R.id.view_call_nurse_layout_tv_call_end)
|
|
@Bind(R.id.view_call_nurse_layout_tv_call_end)
|
|
TextView tvCallNurseEnd;
|
|
TextView tvCallNurseEnd;
|
|
|
|
|
|
|
|
+ //系统设置页面
|
|
|
|
+ @Bind(R.id.ll_view_settings_layout)
|
|
|
|
+ LinearLayout llSettings;
|
|
|
|
+ @Bind(R.id.sb_brightness)
|
|
|
|
+ SeekBar sbBrightness;
|
|
|
|
+ @Bind(R.id.tv_brightness_value)
|
|
|
|
+ TextView tvBrightness;
|
|
|
|
+ @Bind(R.id.sb_volume)
|
|
|
|
+ SeekBar sbVolume;
|
|
|
|
+ @Bind(R.id.tv_volume_value)
|
|
|
|
+ TextView tvVolume;
|
|
|
|
+ @Bind(R.id.rv_settings_version)
|
|
|
|
+ RecyclerView rvSettings;
|
|
|
|
+
|
|
private ImageView ivWelcome;
|
|
private ImageView ivWelcome;
|
|
private MyTextView tvMessage;
|
|
private MyTextView tvMessage;
|
|
// 语音播报
|
|
// 语音播报
|
|
@@ -554,7 +577,7 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
//初始化view
|
|
//初始化view
|
|
- allViews = new ArrayList<>(Arrays.asList(vMain, vDoctor, vCost, vSupport, vCall, vNurse));
|
|
|
|
|
|
+ allViews = new ArrayList<>(Arrays.asList(vMain, vDoctor, vCost, vSupport, vCall, vNurse, vSettings));
|
|
initReceive();
|
|
initReceive();
|
|
setListeners();
|
|
setListeners();
|
|
|
|
|
|
@@ -578,6 +601,54 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
tvSupportEnd.setOnClickListener(this);
|
|
tvSupportEnd.setOnClickListener(this);
|
|
tvCallCareEnd.setOnClickListener(this);
|
|
tvCallCareEnd.setOnClickListener(this);
|
|
tvCallNurseEnd.setOnClickListener(this);
|
|
tvCallNurseEnd.setOnClickListener(this);
|
|
|
|
+
|
|
|
|
+ llSettings.setOnClickListener(this);
|
|
|
|
+
|
|
|
|
+ sbBrightness.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
+ tvBrightness.setText(progress + "%");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStartTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ //重置回到主界面倒计时
|
|
|
|
+ timeOfBackMainPage = 0;
|
|
|
|
+ timeOut = callTimeOutBack;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStopTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ int progress = seekBar.getProgress();
|
|
|
|
+ if (progress >= 0 && progress <= 100) {
|
|
|
|
+ Constants.SCREENLIGHT = Integer.toString(progress);
|
|
|
|
+ setSYSBrightness(CallingBedActivity.this, progress);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ sbVolume.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
|
|
+ tvVolume.setText(progress + "%");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStartTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ //重置回到主界面倒计时
|
|
|
|
+ timeOfBackMainPage = 0;
|
|
|
|
+ timeOut = callTimeOutBack;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onStopTrackingTouch(SeekBar seekBar) {
|
|
|
|
+ int progress = seekBar.getProgress();
|
|
|
|
+ if (progress >= 0 && progress <= 100) {
|
|
|
|
+ Constants.SYSVOICE = Integer.toString(progress);
|
|
|
|
+ setSYSVoice(CallingBedActivity.this, progress);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -713,6 +784,47 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ versionEntityList = new ArrayList<>();
|
|
|
|
+ versionAdapter = new VersionInfoAdapter(versionEntityList);
|
|
|
|
+ rvSettings.setAdapter(versionAdapter);
|
|
|
|
+ rvSettings.setLayoutManager(new FullyLinearLayoutManager(this));
|
|
|
|
+ rvSettings.setOnTouchListener(new View.OnTouchListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public boolean onTouch(View v, MotionEvent event) {
|
|
|
|
+ //重置回到主界面倒计时
|
|
|
|
+ timeOfBackMainPage = 0;
|
|
|
|
+ timeOut = callTimeOutBack;
|
|
|
|
+ switch (event.getAction()) {
|
|
|
|
+ case MotionEvent.ACTION_DOWN:
|
|
|
|
+ //float DownX
|
|
|
|
+ downX = event.getX();
|
|
|
|
+ //float DownY
|
|
|
|
+ downY = event.getY();
|
|
|
|
+ moveX = 0;
|
|
|
|
+ moveY = 0;
|
|
|
|
+ //long currentMS 获取系统时间
|
|
|
|
+ currentMS = System.currentTimeMillis();
|
|
|
|
+ break;
|
|
|
|
+ case MotionEvent.ACTION_MOVE:
|
|
|
|
+ moveX += Math.abs(event.getX() - downX);//X轴距离
|
|
|
|
+ moveY += Math.abs(event.getY() - downY);//y轴距离
|
|
|
|
+ downX = event.getX();
|
|
|
|
+ downY = event.getY();
|
|
|
|
+ break;
|
|
|
|
+ case MotionEvent.ACTION_UP:
|
|
|
|
+ long moveTime = System.currentTimeMillis() - currentMS;//移动时间
|
|
|
|
+ //判断点击还是滑动
|
|
|
|
+ if (moveTime < 100 || (moveX < 30 && moveY < 30)) {
|
|
|
|
+ llSettings.performClick();
|
|
|
|
+ return true; //不再执行后面的事件
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
noticeArrayList = new ArrayList<>();
|
|
noticeArrayList = new ArrayList<>();
|
|
|
|
|
|
getMainData(0);
|
|
getMainData(0);
|
|
@@ -1923,6 +2035,23 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
}*/
|
|
}*/
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void clickSettings() {
|
|
|
|
+ vMain_big.setVisibility(View.GONE);//显示增长页面20191017
|
|
|
|
+ timeOfBackMainPage = 0;
|
|
|
|
+ timeOut = callTimeOutBack;
|
|
|
|
+ goneLlRightView(true);
|
|
|
|
+ if (!isVisible(vSettings)) {
|
|
|
|
+ showThisView(vSettings);
|
|
|
|
+ if (StringUtils.isInt(Constants.SCREENLIGHT)) {
|
|
|
|
+ sbBrightness.setProgress(StringUtils.parseInt(Constants.SCREENLIGHT));
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isInt(Constants.SYSVOICE)) {
|
|
|
|
+ sbVolume.setProgress(StringUtils.parseInt(Constants.SYSVOICE));
|
|
|
|
+ }
|
|
|
|
+ updateVersionInfo();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//请求增援页面
|
|
//请求增援页面
|
|
public void clickVSupport() {
|
|
public void clickVSupport() {
|
|
vMain_big.setVisibility(View.GONE);//显示增长页面20191017
|
|
vMain_big.setVisibility(View.GONE);//显示增长页面20191017
|
|
@@ -2160,6 +2289,9 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
}
|
|
}
|
|
|
|
|
|
private void showHideRightView() {
|
|
private void showHideRightView() {
|
|
|
|
+ //重置回到主界面倒计时
|
|
|
|
+ timeOfBackMainPage = 0;
|
|
|
|
+ timeOut = callTimeOutBack;
|
|
if (isVisible(llRight)) {
|
|
if (isVisible(llRight)) {
|
|
goneLlRightView(true);
|
|
goneLlRightView(true);
|
|
} else {
|
|
} else {
|
|
@@ -2167,6 +2299,31 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void updateVersionInfo() {
|
|
|
|
+ VersionEntity entity1 = new VersionEntity();
|
|
|
|
+ entity1.setTitle("本机IP地址");
|
|
|
|
+ entity1.setValue(NetUtil.getLocalIpAddress());
|
|
|
|
+ versionEntityList.add(entity1);
|
|
|
|
+ VersionEntity entity2 = new VersionEntity();
|
|
|
|
+ entity2.setTitle("本机MAC地址");
|
|
|
|
+ entity2.setValue(NetUtil.getMacAddress());
|
|
|
|
+ versionEntityList.add(entity2);
|
|
|
|
+ VersionEntity entity3 = new VersionEntity();
|
|
|
|
+ entity3.setTitle("APP版本");
|
|
|
|
+ entity3.setValue(BuildConfig.VERSION_NAME);
|
|
|
|
+ versionEntityList.add(entity3);
|
|
|
|
+ VersionEntity entity4 = new VersionEntity();
|
|
|
|
+ entity4.setTitle("MCU版本");
|
|
|
|
+ entity4.setValue(Constants.MCU_VERSION_NUMBER);
|
|
|
|
+ versionEntityList.add(entity4);
|
|
|
|
+ VersionEntity entity5 = new VersionEntity();
|
|
|
|
+ entity5.setTitle("Android系统");
|
|
|
|
+ entity5.setValue(Build.VERSION.RELEASE);
|
|
|
|
+ versionEntityList.add(entity5);
|
|
|
|
+
|
|
|
|
+ versionAdapter.upDateList(versionEntityList);
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
switch (v.getId()) {
|
|
switch (v.getId()) {
|
|
@@ -2186,10 +2343,12 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
clickVSupport();
|
|
clickVSupport();
|
|
break;
|
|
break;
|
|
case R.id.right_ll_settings_item:
|
|
case R.id.right_ll_settings_item:
|
|
|
|
+ clickSettings();
|
|
break;
|
|
break;
|
|
case R.id.activity_calling_bed_layout_ll_right:
|
|
case R.id.activity_calling_bed_layout_ll_right:
|
|
case R.id.rl_view_doctor_layout:
|
|
case R.id.rl_view_doctor_layout:
|
|
case R.id.rl_view_cost_layout:
|
|
case R.id.rl_view_cost_layout:
|
|
|
|
+ case R.id.ll_view_settings_layout:
|
|
showHideRightView();
|
|
showHideRightView();
|
|
break;
|
|
break;
|
|
case R.id.view_support_layout_tv_call_end:
|
|
case R.id.view_support_layout_tv_call_end:
|