package com.yidianling.fm.router

import android.app.Activity
import android.content.Intent
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.router.RouterManager
import com.yidianling.user.api.service.IUserService

/**
 * author : Zhangwenchao
 * e-mail : zhangwch@yidianling.com
 * time   : 2018/04/25
 */
object FMIn {

    fun isLogin(): Boolean {
        return ModularServiceManager.provide(IUserService::class.java).isLogin()
//        return RouterManager.getUserRouter()?.isLogin()?:false
    }

    fun mainIntent(activity: Activity): Intent? {
        //todo xujian 跳转到MainActivity 待修改
        return RouterManager.getAppRouter()?.mainIntent(activity)
    }

    fun loginWayIntent(activity: Activity): Intent? {
        return ModularServiceManager.provide(IUserService::class.java).loginWayIntent(activity)
    }

    /**
     * FM分享到心事动态
     */
    fun publisFmToTrend(activity: Activity, url: String, cover: String, title: String) : Intent?{
        //todo xujian 待修改
        return RouterManager.getDynamicRouter()?.publishFmToTrend(activity,url,cover,title)
    }


}