| | |
| | | import android.content.Intent; |
| | | import android.os.Bundle; |
| | | import android.text.TextUtils; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | viewBinding.fragmentMeLineDeviceDebugIl.fragmentMeLineRightIconClickIv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | UserConfigManage.getInstance().setUniBottomSafeDistanceBackgroundColor(2); |
| | | //设备调试 |
| | | String path = HDLUniMP.UNI_EVENT_OPEN_MINE_DEVICEDEBUG; |
| | | HdlUniLogic.getInstance().openUniMP(path, null); |
| | | } |
| | | }); |
| | | //员工管理(主账号才显示) |
| | | viewBinding.fragmentMeLineUserManagementIl.fragmentMeLineRightIconClickIv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | String path = HDLUniMP.UNI_EVENT_OPEN_MINE_MINESTAFFMANAGER; |
| | | HdlUniLogic.getInstance().openUniMP(path, null); |
| | | } |
| | | }); |
| | | // //员工管理(主账号才显示) |
| | | // viewBinding.fragmentMeLineUserManagementIl.fragmentMeLineRightIconClickIv.setOnClickListener(new View.OnClickListener() { |
| | | // @Override |
| | | // public void onClick(View v) { |
| | | // String path = HDLUniMP.UNI_EVENT_OPEN_MINE_MINESTAFFMANAGER; |
| | | // HdlUniLogic.getInstance().openUniMP(path, null); |
| | | // } |
| | | // }); |
| | | //设置 |
| | | viewBinding.fragmentMeLineSetIl.fragmentMeLineRightIconClickIv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | |
| | | startActivity(AsRegardsActivity.class); |
| | | } |
| | | }); |
| | | final int[] count = {0}; |
| | | viewBinding.meTitleTv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | count[0] = count[0] + 1; |
| | | if (count[0] > 3) { |
| | | count[0] = 0; |
| | | startActivity(TestMainActivity.class); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | |
| | | //设备调试 |
| | | viewBinding.fragmentMeLineDeviceDebugIl.fragmentMeLineLeftIconIv.setImageResource(R.drawable.device_debug); |
| | | viewBinding.fragmentMeLineDeviceDebugIl.fragmentMeLineTitleIv.setText(R.string.device_debugging); |
| | | //员工管理 |
| | | viewBinding.fragmentMeLineUserManagementIl.fragmentMeLineLeftIconIv.setImageResource(R.drawable.user_management); |
| | | viewBinding.fragmentMeLineUserManagementIl.fragmentMeLineTitleIv.setText(R.string.staff_management); |
| | | viewBinding.fragmentMeLineUserManagementIl.getRoot().setVisibility(View.GONE);//先隐藏,读取到有限权在显示 |
| | | viewBinding.fragmentMeLineDeviceDebugIl.fragmentMeLineV.setVisibility(View.VISIBLE); |
| | | // //员工管理 |
| | | // viewBinding.fragmentMeLineUserManagementIl.fragmentMeLineLeftIconIv.setImageResource(R.drawable.user_management); |
| | | // viewBinding.fragmentMeLineUserManagementIl.fragmentMeLineTitleIv.setText(R.string.staff_management); |
| | | // viewBinding.fragmentMeLineUserManagementIl.getRoot().setVisibility(View.GONE);//先隐藏,读取到有限权在显示 |
| | | // viewBinding.fragmentMeLineUserManagementIl.fragmentMeLineV.setVisibility(View.VISIBLE); |
| | | //设备 |
| | | viewBinding.fragmentMeLineSetIl.fragmentMeLineLeftIconIv.setImageResource(R.drawable.set); |
| | | viewBinding.fragmentMeLineSetIl.fragmentMeLineTitleIv.setText(R.string.me_set); |
| | | viewBinding.fragmentMeLineSetIl.fragmentMeLineV.setVisibility(View.VISIBLE); |
| | | //关于 |
| | | viewBinding.fragmentMeLineAsregardsIl.fragmentMeLineLeftIconIv.setImageResource(R.drawable.asregards); |
| | | viewBinding.fragmentMeLineAsregardsIl.fragmentMeLineTitleIv.setText(R.string.me_regard); |
| | |
| | | */ |
| | | private void setMemberName(String userName) { |
| | | if (TextUtils.isEmpty(userName)) { |
| | | viewBinding.fragmentMeUserNameTv.setVisibility(View.GONE); |
| | | viewBinding.fragmentMeUserNameNextIv.setVisibility(View.GONE); |
| | | viewBinding.userNameLl.setVisibility(View.GONE); |
| | | } else { |
| | | viewBinding.fragmentMeUserNameTv.setVisibility(View.VISIBLE); |
| | | viewBinding.fragmentMeUserNameNextIv.setVisibility(View.VISIBLE); |
| | | viewBinding.userNameLl.setVisibility(View.VISIBLE); |
| | | viewBinding.fragmentMeUserNameTv.setText(userName); |
| | | } |
| | | |
| | |
| | | * 显示账号 |
| | | */ |
| | | private void setMemberAccount(String userAccount) { |
| | | if (viewBinding.fragmentMeUserNameTv.getVisibility() == View.VISIBLE) { |
| | | if (viewBinding.userNameLl.getVisibility() == View.VISIBLE) { |
| | | viewBinding.fragmentMeUserRoleNextIv.setVisibility(View.GONE); |
| | | } else { |
| | | viewBinding.fragmentMeUserRoleNextIv.setVisibility(View.VISIBLE); |
| | | } |
| | | |
| | | if (TextUtils.isEmpty(userAccount)) { |
| | | userAccount = "--"; |
| | | } |
| | | viewBinding.fragmentMeUserRoleTv.setText(userAccount); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } else { |
| | | this.getCMemberInfo(); |
| | | } |
| | | getUserRightType(); |
| | | // getUserRightType(); |
| | | |
| | | } |
| | | |
| | |
| | | HdlMemberLogic.getInstance().getUserRightType(new CloudCallBeak<UserRightTypeBean>() { |
| | | @Override |
| | | public void onSuccess(UserRightTypeBean obj) { |
| | | if (obj.getUserRightType().equals(UserRightType.MANAGER)) { |
| | | viewBinding.fragmentMeLineUserManagementIl.getRoot().setVisibility(View.VISIBLE); |
| | | } else { |
| | | viewBinding.fragmentMeLineUserManagementIl.getRoot().setVisibility(View.GONE); |
| | | } |
| | | // if (obj.getUserRightType().equals(UserRightType.MANAGER)) { |
| | | // viewBinding.fragmentMeLineUserManagementIl.getRoot().setVisibility(View.VISIBLE); |
| | | // } else { |
| | | // viewBinding.fragmentMeLineUserManagementIl.getRoot().setVisibility(View.GONE); |
| | | // } |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | HdlLogLogic.print("获取用户自定义配置温度单位详情--->" + e.getMsg() + "(" + e.getCode() + ")", true); |
| | | HdlLogLogic.print("获取用户自定义配置温度单位详情---" + e.getMsg() + "(" + e.getCode() + ")", true); |
| | | // HdlThreadLogic.toast(_mActivity, e); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |