hxb
2022-11-22 b3513b1713bb979d0a69c5a8c4ddcd038f184e6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package com.mm.android.deviceaddmodule.p_ap;
 
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
 
import com.mm.android.deviceaddmodule.base.BaseTipFragment;
import com.mm.android.deviceaddmodule.helper.DeviceAddHelper;
import com.mm.android.deviceaddmodule.helper.DeviceAddImageLoaderHelper;
import com.mm.android.deviceaddmodule.helper.PageNavigationHelper;
import com.mm.android.deviceaddmodule.mobilecommon.entity.deviceadd.DeviceIntroductionInfo;
import com.mm.android.deviceaddmodule.model.DeviceAddModel;
import com.nostra13.universalimageloader.core.ImageLoader;
 
public class TipApLightFragment extends BaseTipFragment {
 
    public static TipApLightFragment newInstance() {
        TipApLightFragment fragment = new TipApLightFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }
 
    @Override
    protected void initView(View view) {
        super.initView(view);
        mConfirmCheck.setVisibility(View.VISIBLE);
        mNextBtn.setEnabled(mConfirmCheck.isChecked());
        mTipImg.setScaleType(ImageView.ScaleType.FIT_XY);
    }
 
    @Override
    protected void initData() {
        super.initData();
        DeviceIntroductionInfo deviceIntroductionInfo = DeviceAddModel.newInstance().getDeviceInfoCache().getDevIntroductionInfo();
        if (deviceIntroductionInfo != null) {
            String tipTxt = deviceIntroductionInfo.getStrInfos().get(DeviceAddHelper.OMSKey.ACCESSORY_MODE_PAIR_OPERATION_INTRODUCTION);
            String tipImg = deviceIntroductionInfo.getImageInfos().get(DeviceAddHelper.OMSKey.ACCESSORY_MODE_PAIR_STATUS_IMAGE);
            String helpTxt = deviceIntroductionInfo.getStrInfos().get(DeviceAddHelper.OMSKey.ACCESSORY_MODE_RESET_GUIDE_INTRODUCTION);
            String confirmTxt = deviceIntroductionInfo.getStrInfos().get(DeviceAddHelper.OMSKey.ACCESSORY_MODE_PAIR_CONFIRM_INTRODUCTION);
            if (!TextUtils.isEmpty(tipImg)) {
                ImageLoader.getInstance().displayImage(tipImg, mTipImg,
                        DeviceAddImageLoaderHelper.getCommonOptions());
            }
            if (!TextUtils.isEmpty(tipTxt)) {
                mTipTxt.setText(tipTxt);
            }
            if (!TextUtils.isEmpty(helpTxt)) {
                mHelpTxt.setVisibility(View.VISIBLE);
                mHelpTxt.setText(helpTxt);
            }
            if (!TextUtils.isEmpty(confirmTxt)) {
                mConfirmCheck.setText(confirmTxt);
            }
        }
    }
 
    @Override
    protected void nextAction() {
        PageNavigationHelper.gotoApPairPage(this);
    }
 
    @Override
    protected void helpAction() {
        PageNavigationHelper.gotoErrorTipPage(this, DeviceAddHelper.ErrorCode.COMMON_ERROR_NOT_SUPPORT_RESET);
    }
 
    @Override
    protected void init() {
        initView(mView);
        initData();
    }
}