| | |
| | | package com.hdl.photovoltaic.ui; |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.appcompat.content.res.AppCompatResources; |
| | | import androidx.core.app.ActivityCompat; |
| | | |
| | | import android.Manifest; |
| | | import android.content.Intent; |
| | | import android.content.IntentFilter; |
| | | import android.content.UriPermission; |
| | | import android.content.pm.PackageManager; |
| | |
| | | import com.hdl.photovoltaic.other.HdlOtaLogic; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.other.HdlUniLogic; |
| | | import com.hdl.photovoltaic.ui.bean.BUserInfo; |
| | | import com.hdl.photovoltaic.ui.bean.DeviceRemoteInfo; |
| | | import com.hdl.photovoltaic.ui.bean.OidBean; |
| | | import com.hdl.photovoltaic.uni.HDLUniMP; |
| | | import com.hdl.photovoltaic.utils.AppManagerUtils; |
| | | import com.hdl.photovoltaic.utils.PermissionUtils; |
| | | import com.hdl.photovoltaic.widget.ConfirmationCancelDialog; |
| | | import com.hdl.sdk.link.HDLLinkLocalSdk; |
| | | import com.hdl.sdk.link.common.event.EventListener; |
| | | import com.hdl.sdk.link.core.bean.LinkResponse; |
| | |
| | | this.initMqttClient(); |
| | | //监听网络状态变化 |
| | | this.networkMonitoring(); |
| | | //点击极光通知栏消息进来 |
| | | this.clickJpushNotificationMessage(); |
| | | //通知限权 |
| | | this.notificationSet(); |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 开启通知权限 |
| | | */ |
| | | private void notificationSet() { |
| | | boolean isBoolean = PermissionUtils.isNotificationEnabled(_mActivity); |
| | | if (!isBoolean) { |
| | | ConfirmationCancelDialog confirmationCancelDialog = new ConfirmationCancelDialog(_mActivity); |
| | | confirmationCancelDialog.setTitle("提示"); |
| | | confirmationCancelDialog.setContent("通知权限没开启,将无法收到推送信息."); |
| | | confirmationCancelDialog.setConfirmation("前往设置"); |
| | | confirmationCancelDialog.show(); |
| | | confirmationCancelDialog.setYesOnclickListener(new ConfirmationCancelDialog.onYesOnclickListener() { |
| | | @Override |
| | | public void Confirm() { |
| | | confirmationCancelDialog.dismiss(); |
| | | PermissionUtils.openNotificationSettings(_mActivity); |
| | | |
| | | } |
| | | }); |
| | | confirmationCancelDialog.setNoOnclickListener(new ConfirmationCancelDialog.onNoOnclickListener() { |
| | | @Override |
| | | public void Cancel() { |
| | | confirmationCancelDialog.dismiss(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | currentFragmentIndex = 2; |
| | | bottomViewChangeOfStyle(); |
| | | postEventBus(HomepageTitleTabSwitch.message); |
| | | |
| | | } |
| | | }); |
| | | viewBinding.myMeBottomIl3.clickTv.setOnClickListener(new View.OnClickListener() { |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected void onDestroy() { |
| | |
| | | BaseEventBus baseEventBus = new BaseEventBus(); |
| | | baseEventBus.setTopic(ConstantManage.homepage_title_tab_switch); |
| | | baseEventBus.setType(tabSwitch.toString()); |
| | | EventBus.getDefault().post(baseEventBus); |
| | | EventBus.getDefault().postSticky(baseEventBus); |
| | | } |
| | | |
| | | public void requestPermissions() { |
| | |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> obj) { |
| | | // AppManagerUtils.getAppManager().hideLoading(); |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 点击极光通知栏消息进来 |
| | | */ |
| | | private void clickJpushNotificationMessage() { |
| | | Intent intent = getIntent(); |
| | | if (intent != null) { |
| | | String key = intent.getStringExtra("skip"); |
| | | if (key != null) { |
| | | //触发消息点击事件 |
| | | viewBinding.myMessageBottomIl2.clickTv.performClick(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 物理按键返回事件 |