package com.abbidot.tracker.ui.activity.help

import com.abbidot.tracker.R
import com.abbidot.tracker.adapter.HelpTextImageTypeAdapter
import com.abbidot.tracker.base.BaseActivity
import com.abbidot.tracker.bean.MenuTxtBean
import com.abbidot.tracker.constant.MultipleEntity
import com.abbidot.tracker.databinding.ActivityHelpTrackerBatteryBinding
import com.abbidot.tracker.util.ViewUtil

class HelpTrackerBatteryActivity :
    BaseActivity<ActivityHelpTrackerBatteryBinding>(ActivityHelpTrackerBatteryBinding::inflate) {


    override fun getTopBar() = mViewBinding.ilHelpTrackerBatteryBar.titleTopBar

    override fun initData() {
        super.initData()
        setTopBarTitle(R.string.txt_tracker_battery_life)
        setLeftBackImage(R.drawable.icon_white_back_svg)

        val menuList = mutableListOf<MenuTxtBean>()
        ViewUtil.instance.addMenuBean(menuList, getString(R.string.txt_tracker_sleeping_mode))
        ViewUtil.instance.addMenuBean(
            menuList,
            getString(R.string.txt_low_power),
            menuType = MultipleEntity.IMG_TEXT,
            colorRedId = R.color.help_color1
        )
        ViewUtil.instance.addMenuBean(
            menuList,
            getString(R.string.txt_tracker_battery_tip1),
            menuType = MultipleEntity.IMG_IMG
        )
//        ViewUtil.instance.addMenuBean(
//            menuList,
//            "",
//            imageResId = R.drawable.battery_life_help1,
//            menuType = MultipleEntity.IMG
//        )

        ViewUtil.instance.addMenuBean(menuList, getString(R.string.txt_in_wifi_zone))
        ViewUtil.instance.addMenuBean(
            menuList,
            getString(R.string.txt_low_power_usage),
            menuType = MultipleEntity.IMG_TEXT,
            colorRedId = R.color.help_color2
        )
        ViewUtil.instance.addMenuBean(
            menuList,
            getString(R.string.txt_tracker_battery_tip2),
            menuType = MultipleEntity.IMG_IMG
        )
        ViewUtil.instance.addMenuBean(
            menuList, "", imageResId = R.drawable.battery_life_help2, menuType = MultipleEntity.IMG
        )

        ViewUtil.instance.addMenuBean(menuList, getString(R.string.txt_outside_wifi_zone))
        ViewUtil.instance.addMenuBean(
            menuList,
            getString(R.string.txt_standard_power_usage),
            menuType = MultipleEntity.IMG_TEXT,
            colorRedId = R.color.help_color3
        )
        ViewUtil.instance.addMenuBean(
            menuList,
            getString(R.string.txt_tracker_battery_tip3),
            menuType = MultipleEntity.IMG_IMG
        )
        ViewUtil.instance.addMenuBean(
            menuList, "", imageResId = R.drawable.battery_life_help3, menuType = MultipleEntity.IMG
        )

        ViewUtil.instance.addMenuBean(menuList, getString(R.string.txt_gps_update_interval))
        ViewUtil.instance.addMenuBean(
            menuList,
            getString(R.string.txt_tracker_battery_tip4),
            menuType = MultipleEntity.IMG_IMG
        )
        ViewUtil.instance.addMenuBean(
            menuList,
            getString(R.string.txt_tracker_battery_tip5),
            menuType = MultipleEntity.IMG_TEXT_IMG
        )
        ViewUtil.instance.addMenuBean(
            menuList, "", imageResId = R.drawable.battery_life_help4, menuType = MultipleEntity.IMG
        )

        ViewUtil.instance.addMenuBean(menuList, getString(R.string.txt_in_live_mode))
        ViewUtil.instance.addMenuBean(
            menuList,
            getString(R.string.txt_highest_power_usage),
            menuType = MultipleEntity.IMG_TEXT,
            colorRedId = R.color.help_color4
        )
        ViewUtil.instance.addMenuBean(
            menuList,
            getString(R.string.txt_tracker_battery_tip6),
            menuType = MultipleEntity.IMG_IMG
        )
        ViewUtil.instance.addMenuBean(
            menuList, "", imageResId = R.drawable.battery_life_help5, menuType = MultipleEntity.IMG
        )

        val helpBatteryAdapter = HelpTextImageTypeAdapter(menuList)
        ViewUtil.instance.setRecyclerViewVerticalLinearLayout(
            mContext, mViewBinding.rvHelpTrackerBatteryContent, helpBatteryAdapter
        )
    }
}