package com.ydl.confide.home.modular.service

import android.app.Activity
import android.content.Context
import android.content.Intent
import android.support.v4.app.DialogFragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.confide.api.IConfideService
import com.ydl.confide.home.ConfideHomeActivity

/**
 * Created by haorui on 2019-12-11 .
 * Des:
 */
@Route(path = "/confide/ConfideService")
class ConfdieServiceImpl : IConfideService {

    override fun init(context: Context?) {

    }


    override fun phoneCallFragment(head: String, callId: String): DialogFragment {
        //废弃
        return DialogFragment()
    }

    override fun phoneCallIntent(activity: Activity): Intent {
        //废弃
        val intent = Intent(activity, ConfideHomeActivity::class.java)
        return intent
    }

    override fun openConfideHome(context: Context) {
        val intent = Intent(context, ConfideHomeActivity::class.java)
        if (context !is Activity) {
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
        }
        context.startActivity(intent)
    }

    override fun closePlayer() {

    }


}