|
|
@ -15,6 +15,7 @@ import androidx.core.content.ContextCompat
|
|
|
|
import androidx.core.view.isVisible
|
|
|
|
import androidx.core.view.isVisible
|
|
|
|
import androidx.lifecycle.MutableLiveData
|
|
|
|
import androidx.lifecycle.MutableLiveData
|
|
|
|
import cn.jpush.android.api.JPushInterface
|
|
|
|
import cn.jpush.android.api.JPushInterface
|
|
|
|
|
|
|
|
import com.hjq.toast.ToastUtils
|
|
|
|
import com.tamsiree.rxkit.RxTimeTool
|
|
|
|
import com.tamsiree.rxkit.RxTimeTool
|
|
|
|
import com.xty.base.fragment.BaseVmFrag
|
|
|
|
import com.xty.base.fragment.BaseVmFrag
|
|
|
|
import com.xty.base.utils.UserInfoDefin
|
|
|
|
import com.xty.base.utils.UserInfoDefin
|
|
|
@ -467,10 +468,18 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
|
|
|
|
// 刷新注册
|
|
|
|
// 刷新注册
|
|
|
|
private fun refresh() {
|
|
|
|
private fun refresh() {
|
|
|
|
refresh.setRefresh(binding.mRefresh) {
|
|
|
|
refresh.setRefresh(binding.mRefresh) {
|
|
|
|
isJob = false
|
|
|
|
if(!TextUtils.isEmpty(showIdInfo)){
|
|
|
|
|
|
|
|
isJob = false
|
|
|
|
|
|
|
|
request()
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
ToastUtils.show(R.string.again_login)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// getXtInfo(showIdInfo)
|
|
|
|
// getXtInfo(showIdInfo)
|
|
|
|
// get24HourReportInfo(showIdInfo)
|
|
|
|
// get24HourReportInfo(showIdInfo)
|
|
|
|
request()
|
|
|
|
|
|
|
|
|
|
|
|
// request()
|
|
|
|
// uploadWhatchData()
|
|
|
|
// uploadWhatchData()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -486,47 +495,43 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
|
|
|
|
if(MMkvHelper.contains(Const.LATITUDE) && MMkvHelper.contains(Const.LONGITUDE)){
|
|
|
|
if(MMkvHelper.contains(Const.LATITUDE) && MMkvHelper.contains(Const.LONGITUDE)){
|
|
|
|
mViewModel.getWeather()
|
|
|
|
mViewModel.getWeather()
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
if (showIdInfo == ""){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
if(EasyPermissions.hasPermissions(requireContext(), Manifest.permission.ACCESS_COARSE_LOCATION,
|
|
|
|
|
|
|
|
Manifest.permission.ACCESS_FINE_LOCATION)){
|
|
|
|
|
|
|
|
AmapInit.startLocation(requireContext()) {
|
|
|
|
|
|
|
|
LogUtils.e("DynamicManagementFrag","${it.city}")
|
|
|
|
|
|
|
|
MMkvHelper.put(Const.LONGITUDE,it.longitude)
|
|
|
|
|
|
|
|
MMkvHelper.put(Const.LATITUDE,it.latitude)
|
|
|
|
|
|
|
|
MMkvHelper.put(Const.PROVINCE,it.province)
|
|
|
|
|
|
|
|
MMkvHelper.put(Const.CITY,it.city)
|
|
|
|
|
|
|
|
MMkvHelper.put(Const.DISTRICT,it.district)
|
|
|
|
|
|
|
|
mViewModel.getWeather()
|
|
|
|
|
|
|
|
|
|
|
|
if(EasyPermissions.hasPermissions(requireContext(), Manifest.permission.ACCESS_COARSE_LOCATION,
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
if (EasyPermissions.somePermissionDenied(requireActivity(), Manifest.permission.ACCESS_COARSE_LOCATION,
|
|
|
|
Manifest.permission.ACCESS_FINE_LOCATION)){
|
|
|
|
Manifest.permission.ACCESS_FINE_LOCATION)){
|
|
|
|
AmapInit.startLocation(requireContext()) {
|
|
|
|
DialogTip(
|
|
|
|
LogUtils.e("DynamicManagementFrag","${it.city}")
|
|
|
|
requireContext(),
|
|
|
|
MMkvHelper.put(Const.LONGITUDE,it.longitude)
|
|
|
|
"中健365需要定位权限,需要打开设置页面么?"
|
|
|
|
MMkvHelper.put(Const.LATITUDE,it.latitude)
|
|
|
|
) {
|
|
|
|
MMkvHelper.put(Const.PROVINCE,it.province)
|
|
|
|
JumpPermissionManagement.GoToSetting(requireActivity())
|
|
|
|
MMkvHelper.put(Const.CITY,it.city)
|
|
|
|
}.show()
|
|
|
|
MMkvHelper.put(Const.DISTRICT,it.district)
|
|
|
|
|
|
|
|
mViewModel.getWeather()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
if (EasyPermissions.somePermissionDenied(requireActivity(), Manifest.permission.ACCESS_COARSE_LOCATION,
|
|
|
|
FactorySettingDialog(
|
|
|
|
Manifest.permission.ACCESS_FINE_LOCATION)){
|
|
|
|
requireContext(),
|
|
|
|
DialogTip(
|
|
|
|
"中健365需要定位权限,以便您获取天气信息"
|
|
|
|
requireContext(),
|
|
|
|
) {
|
|
|
|
"中健365需要定位权限,需要打开设置页面么?"
|
|
|
|
EasyPermissions.requestPermissions(this,"获取天气信息需要申请定位权限",
|
|
|
|
) {
|
|
|
|
0x00022,
|
|
|
|
JumpPermissionManagement.GoToSetting(requireActivity())
|
|
|
|
Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION);
|
|
|
|
}.show()
|
|
|
|
}.show()
|
|
|
|
}else{
|
|
|
|
|
|
|
|
FactorySettingDialog(
|
|
|
|
|
|
|
|
requireContext(),
|
|
|
|
|
|
|
|
"中健365需要定位权限,以便您获取天气信息"
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
EasyPermissions.requestPermissions(this,"获取天气信息需要申请定位权限",
|
|
|
|
|
|
|
|
0x00022,
|
|
|
|
|
|
|
|
Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION);
|
|
|
|
|
|
|
|
}.show()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -753,7 +758,6 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
|
|
|
|
functionList.addAll(it.data)
|
|
|
|
functionList.addAll(it.data)
|
|
|
|
if (showIdInfo ==MMkvHelper.getLong(Const.USER_ID).toString()) {
|
|
|
|
if (showIdInfo ==MMkvHelper.getLong(Const.USER_ID).toString()) {
|
|
|
|
Const.functionListDate.value = functionList
|
|
|
|
Const.functionListDate.value = functionList
|
|
|
|
startUpdateHealthInfoLive()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -826,6 +830,10 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
|
|
|
|
} else if (YCBBlueConnectHelper.getBleNowStatus() == YCBBlueConnectHelper.BLEConnectState.Connected) {
|
|
|
|
} else if (YCBBlueConnectHelper.getBleNowStatus() == YCBBlueConnectHelper.BLEConnectState.Connected) {
|
|
|
|
getConnectStatus()
|
|
|
|
getConnectStatus()
|
|
|
|
}*/
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(Const.watchType != -1 && !isDemonstrate){
|
|
|
|
|
|
|
|
startUpdateHealthInfoLive()
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1238,7 +1246,7 @@ class DynamicManagementFrag : BaseVmFrag<DynamicManagementVm>() , EasyPermission
|
|
|
|
|
|
|
|
|
|
|
|
private var mDisposable: Disposable? = null
|
|
|
|
private var mDisposable: Disposable? = null
|
|
|
|
fun startUpdateHealthInfoLive(){
|
|
|
|
fun startUpdateHealthInfoLive(){
|
|
|
|
LogUtils.e("DynamicManagementFrag","刷新数据 ${getHealthInfoJob} disposable:${mDisposable}")
|
|
|
|
LogUtils.e("DynamicManagementFrag","刷新数据 disposable:${mDisposable}")
|
|
|
|
|
|
|
|
|
|
|
|
if(mDisposable == null){
|
|
|
|
if(mDisposable == null){
|
|
|
|
Observable.interval(1000 * 60,60*1000,TimeUnit.MILLISECONDS)
|
|
|
|
Observable.interval(1000 * 60,60*1000,TimeUnit.MILLISECONDS)
|
|
|
|