package com.ama.core.architecture.interfaces

import android.content.Intent
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding


@Suppress("EmptyMethod")
interface ViewBindingActivity<Binding : ViewBinding, UiState> {
    val binding: Binding
    fun inflateViewBinding(inflater: LayoutInflater): Binding
    fun Binding.initWindowInsets() {}

    fun Binding.initViews()
    fun Binding.initListeners()
    fun Binding.initBaseObservers()
    fun Binding.initObservers()

    fun Binding.onUiStateCollect(uiState: UiState)

    fun readIntent(intent: Intent)
}

interface ViewBindingFragment<Binding : ViewBinding, UiState> {
    val binding: Binding?
    fun inflateViewBinding(inflater: LayoutInflater, container: ViewGroup?): Binding

    fun initOnViewCreated() {}
    fun Binding.initWindowInsets() {}

    fun Binding.initViews()
    fun Binding.initListeners()
    fun Binding.initBaseObservers()
    fun Binding.initObservers()

    fun Binding.onUiStateCollect(uiState: UiState)
}