package com.remax.visualnovel.ui.main.book

import android.os.Bundle
import androidx.fragment.app.viewModels
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.dylanc.loadingstateview.BgColorType
import com.remax.visualnovel.app.base.BaseBindingFragment
import com.remax.visualnovel.databinding.FragmentMainBookBinding
import com.remax.visualnovel.utils.Routers
import com.remax.visualnovel.utils.StatusBarUtil3
import dagger.hilt.android.AndroidEntryPoint
import kotlin.getValue



@AndroidEntryPoint
@Route(path = Routers.ROUTE_FRAG_BOOKLIST)
class BookListFragment : BaseBindingFragment<FragmentMainBookBinding>() {

    private val contactViewModel by viewModels<BookListViewModel>()

    override fun onCreated(bundle: Bundle?) {
        setUI()
    }

    override fun backgroundColorType(): BgColorType {
        return BgColorType.TRANSPARENT
    }

    private fun setUI() {
        with(binding.root) {
            setPadding(
                paddingLeft,
                paddingTop + StatusBarUtil3.getStatusBarHeight(context),
                paddingRight,
                paddingBottom
            )
        }
    }

    companion object {
        fun newInstance(): BookListFragment {
            return ARouter.getInstance().build(Routers.ROUTE_FRAG_BOOKLIST)
                .navigation() as BookListFragment
        }
    }

}