package com.ama.core.architecture.appBase

import android.view.ViewGroup
import androidx.viewbinding.ViewBinding
import com.ama.core.architecture.base.BaseViewModel
import com.ama.core.architecture.base.views.BaseViewsDialogFragment
import com.ama.core.architecture.util.state.createAppStateView


abstract class AppViewsDialogFragment<Binding : ViewBinding, UiState : Any, ViewModel : BaseViewModel<UiState>> :
    BaseViewsDialogFragment<Binding, UiState, ViewModel>() {
    // 全部使用反射来实现
    //    override val viewModel: ViewModel by reflectViewModels()

    override fun createStateView(stateViewParent: ViewGroup) = createAppStateView(stateViewParent)

    // 消息的收集者，默认为Toast，子类可覆写为Snakbar等。
    //    override val messageCollector: MessageCollector by lazy { ToastMessageCollector(requireContext()) }
    //    override val messageCollector: MessageCollector by lazy { SnakbarViewMessageCollector(requireView())}

    // 全部使用反射来实现
    //    override fun inflateViewBinding(inflater: LayoutInflater, container: ViewGroup?) =
    //    reflectInflateViewBinding(inflater, container)
}