HomeImpl.kt 1.61 KB
Newer Older
徐健 committed
1 2 3 4 5 6 7
package com.yidianling.home.event

import android.content.Context
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.Utils
8 9
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.constants.HomeBIConstants
徐健 committed
10 11 12 13 14 15 16 17 18
import com.yidianling.home.constract.IHomeContract

/**
 * @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
 * @描述: 首页点击事件实现类
 * @Copyright Copyright (c) 2019
 * @Company 壹点灵
 * @date 2019/02/13
 */
konghaorui committed
19
open class HomeImpl(context: Context, homeView: IHomeContract.View) : HomeBaseImpl(context, homeView), IHomeEvent {
徐健 committed
20 21 22 23 24
    override fun museMoreClick(dataJson: String) {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
25
        ActionCountUtils.count(HomeBIConstants.YDL_HOME_ZHUMIANMINGXIANG)
26 27 28 29
        YDLRouterManager.router(
            IYDLRouterConstant.ROUTER_MUSE,
            YDLRouterParams().putExtra(IYDLRouterConstant.MUSIC_URL, "")
                .putExtra(IYDLRouterConstant.DATA_JSON, dataJson))
徐健 committed
30 31
    }

32
    override fun museClick(musicUrl: String, dataJson: String,iconName:String) {
徐健 committed
33 34 35 36
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
霍志良 committed
37
        ActionCountUtils.count(HomeBIConstants.YDL_HOME_ZHUMIANICON,iconName)
38 39 40 41
        YDLRouterManager.router(
            IYDLRouterConstant.ROUTER_MUSE,
            YDLRouterParams().putExtra(IYDLRouterConstant.MUSIC_URL, musicUrl)
                .putExtra(IYDLRouterConstant.DATA_JSON, dataJson))
徐健 committed
42 43 44
    }

}