package com.base.locationsharewhite.ui.howuse

import android.content.Intent
import android.graphics.Color
import androidx.activity.addCallback
import androidx.core.view.updatePadding
import com.base.locationsharewhite.databinding.ActivityHowUseBinding
import com.base.locationsharewhite.helper.BaseActivity
import com.base.locationsharewhite.helper.MyApplication
import com.base.locationsharewhite.utils.BarUtils

class HowUseActivity : BaseActivity<ActivityHowUseBinding>() {

    private val TAG = "HowUseActivity"
    override val binding: ActivityHowUseBinding by lazy {
        ActivityHowUseBinding.inflate(layoutInflater)
    }


    override fun initView() {
        BarUtils.setStatusBarLightMode(this, true)
        BarUtils.setStatusBarColor(this, Color.WHITE)
        binding.root.updatePadding(top = BarUtils.getStatusBarHeight())

//        val isRecreate = isLanguageRecreate(MyApplication.mainLanguage)
//        if (isRecreate) return
    }

    override fun initListener() {
        super.initListener()
        onBackPressedDispatcher.addCallback {
            finishToMain()
        }
        binding.flFanhui.setOnClickListener {
            onBackPressedDispatcher.onBackPressed()
        }
        binding.flShareLocation.setOnClickListener {
            startActivity(Intent(this, HowUseShareActivity::class.java))
        }
        binding.flViewLocation.setOnClickListener {
            startActivity(Intent(this, HowViewOtherActivity::class.java))
        }
    }

    override fun onResume() {
        super.onResume()
//        val isRecreate = updateAppLanguage(MyApplication.howUseLanguage, TAG) {
//            MyApplication.howUseLanguage = it
//        }
//        if (isRecreate) {
//            return
//        }
    }

}