package com.yidian.subway.userinfo.ui

import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.os.bundleOf
import com.yidian.common.base.BaseFragment
import com.yidian.subway.userinfo.databinding.FragmentUserInfoBinding
import com.yidian.xpage.XPageManager

class UserInfoFragment:BaseFragment<FragmentUserInfoBinding>() {
    companion object{
        fun newInstance(): UserInfoFragment {
            val fragment = UserInfoFragment()
            val args = bundleOf()
            fragment.arguments = args
            return fragment
        }
    }
    override fun createViewBinding(
        inflater: LayoutInflater,
        container: ViewGroup?
    ): FragmentUserInfoBinding {
        return FragmentUserInfoBinding.inflate(inflater,container,false)
    }
    override fun init(savedInstanceState: Bundle?) {
        super.init(savedInstanceState)
        viewBinding.tvContent.text = "我的页面"
        setClickListener()
    }

    private fun setClickListener(){
        viewBinding.circleImage.setOnClickListener{
            imagePopupShow()
        }
        viewBinding.btnJump.setOnClickListener{
            XPageManager.push("/home", null)
        }
    }

    private fun imagePopupShow(){
//        val imagePopupWindow = activity?.let { ImagePopupWindow(it) }
//        val imageList = ArrayList<ImageItemBean>()
//        for (i in 1..5){
//            imageList.add(ImageItemBean(R.mipmap.head_icon))
//        }
//        imagePopupWindow?.updateImageList(imageList)
//        imagePopupWindow?.show(lly_root)
    }
}