package com.cheng.blzb.ui.fragment.mine.about

import android.annotation.SuppressLint
import com.cheng.blzb.databinding.FragmentAboutBinding
import com.cheng.blzb.ui.dialog.PopupDialog
import com.cheng.blzb.utils.UrlHelper
import com.example.base.extensions.onClick
import com.example.base.ui.BaseFragment
import com.example.base.utils.AppUtils
import org.jetbrains.anko.sdk27.listeners.onLongClick

class AboutFragment : BaseFragment<FragmentAboutBinding, AboutViewModel>() {
    @SuppressLint("SetTextI18n")
    override fun initView() {
        super.initView()
        mTitleBar?.background = null

        binding.tvVersionName.text = "版本号：${AppUtils.getAppVersionName()}"
    }

    override fun initListener() {
        super.initListener()
        binding.ivIco.onLongClick {
            PopupDialog.showAboutTip(requireContext(),binding.ivIco)
            false
        }
        binding.tvAgreement.onClick {
            UrlHelper.startUserAgreement(requireContext())
        }
        binding.tvPolicy.onClick {
            UrlHelper.startPrivacyPolicy(requireContext())
        }
        binding.tvPermissionList.onClick {
            UrlHelper.startPermissionList(requireContext())
        }
        binding.tvShareList.onClick {
            UrlHelper.startShareList(requireContext())
        }
        binding.tvSdkList.onClick {
            UrlHelper.startSDKList(requireContext())
        }
    }
}