| | |
| | | import androidx.annotation.Nullable; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.bumptech.glide.load.resource.bitmap.RoundedCorners; |
| | | import com.google.gson.Gson; |
| | | import com.hdl.linkpm.sdk.core.exception.HDLException; |
| | | import com.hdl.photovoltaic.R; |
| | |
| | | import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | import org.greenrobot.eventbus.Subscribe; |
| | | import org.greenrobot.eventbus.ThreadMode; |
| | | |
| | | /** |
| | | * 我的-界面 |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (UserConfigManage.getInstance().isBAccount()) { |
| | | //todo B端不支持更改昵称 |
| | | HdlThreadLogic.toast(_mActivity, R.string.loading_not_supported); |
| | | return; |
| | | Intent intent = new Intent(); |
| | | intent.setClass(_mActivity, BPersonalDataActivity.class); |
| | | startActivity(intent); |
| | | } else { |
| | | Intent intent = new Intent(); |
| | | intent.setClass(_mActivity, CPersonalDataActivity.class); |
| | | if (mC_UserInfo == null) { |
| | | mC_UserInfo = new CUserInfo(); |
| | | } |
| | | intent.putExtra("memberHeadIcon", mC_UserInfo.getMemberHeadIcon()); |
| | | startActivityForResult(intent, 10); |
| | | } |
| | | Intent intent = new Intent(); |
| | | intent.setClass(_mActivity, PersonalDataActivity.class); |
| | | if (mC_UserInfo == null) { |
| | | mC_UserInfo = new CUserInfo(); |
| | | } |
| | | intent.putExtra("memberHeadIcon", mC_UserInfo.getMemberHeadIcon()); |
| | | startActivityForResult(intent, 10); |
| | | } |
| | | }); |
| | | viewBinding.fragmentMeLineSetIl.fragmentMeLineRightIconClickIv.setOnClickListener(new View.OnClickListener() { |
| | |
| | | } |
| | | }); |
| | | final int[] count = {0}; |
| | | viewBinding.toolbarTopFragmentMeRl.topTitleTv.setOnClickListener(new View.OnClickListener() { |
| | | viewBinding.meTitleTv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | count[0] = count[0] + 1; |
| | |
| | | private void initView() { |
| | | |
| | | |
| | | viewBinding.toolbarTopFragmentMeRl.topTitleTv.setText(R.string.me); |
| | | // viewBinding.toolbarTopFragmentMeRl.topMoreIv.setVisibility(View.VISIBLE); |
| | | // viewBinding.toolbarTopFragmentMeRl.topMoreIv.setImageResource(R.drawable.message); |
| | | |
| | | |
| | | viewBinding.fragmentMeLineSetIl.fragmentMeLineLeftIconIv.setImageResource(R.drawable.set); |
| | | viewBinding.fragmentMeLineSetIl.fragmentMeLineTitleIv.setText(R.string.me_set); |
| | | viewBinding.fragmentMeLineSetIl.fragmentMeLineV.setVisibility(View.VISIBLE); |
| | |
| | | |
| | | public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { |
| | | super.onActivityResult(requestCode, resultCode, data); |
| | | if (UserConfigManage.getInstance().isBAccount()) { |
| | | //B端不需要更新 |
| | | return; |
| | | } |
| | | if (requestCode == 10 && resultCode == 10) { |
| | | if (data != null) { |
| | | String iconUrl = data.getStringExtra("memberHeadIcon"); |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) |
| | | public void onEventMessage(BaseEventBus eventBus) { |
| | | super.onEventMessage(eventBus); |
| | | if (eventBus == null) { |
| | |
| | | //接收外部点击事件 |
| | | if (eventBus.getTopic().equals(ConstantManage.homepage_title_tab_switch)) { |
| | | if (eventBus.getType().equals(HomepageTitleTabSwitch.me.toString())) { |
| | | // 取消粘性事件 |
| | | EventBus.getDefault().removeStickyEvent(eventBus); |
| | | //读取头像 |
| | | if (UserConfigManage.getInstance().isBAccount()) { |
| | | this.getBUserInfo(); |