package com.adealink.weparty.commonui.widget.floatview

import com.adealink.weparty.commonui.widget.floatview.data.FloatWindowType
import com.adealink.weparty.commonui.widget.floatview.data.IFloatData
import com.adealink.weparty.commonui.widget.floatview.data.IFloatViewFactory
import com.adealink.weparty.commonui.widget.floatview.view.BaseFloatView
import com.adealink.weparty.debug.SysMemoryUsageFloatData
import com.adealink.weparty.debug.SysMemoryUsageFloatView

class FloatViewFactory : IFloatViewFactory {

    override fun <V : BaseFloatView<out IFloatData>> createFloatView(data: IFloatData): V? {
        val floatView = when (data.windowType()) {
            FloatWindowType.NETWORK_DISCONNECT_TIP -> null//NetworkReconnectFloatView(data as NetworkReconnectFloatData)
            FloatWindowType.MEMORY_USAGE -> SysMemoryUsageFloatView(data as SysMemoryUsageFloatData)
        }
        return floatView as? V
    }

}