PhoneCallImp.kt 1.02 KB
Newer Older
洪国微 committed
1 2 3 4 5
package com.ydl.confide.router

import android.app.Activity
import android.content.Context
import android.content.Intent
洪国微 committed
6
import android.support.v4.app.DialogFragment
洪国微 committed
7
import com.ydl.confide.home.ConfideHomeActivity
洪国微 committed
8
import com.yidianling.router.phoneCall.IPhoneCallRouter
洪国微 committed
9 10

class PhoneCallImp : IPhoneCallRouter {
洪国微 committed
11 12 13 14 15 16 17 18 19 20
    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
    }
洪国微 committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

    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() {
//        if (MyPlayer.isStart()) {
//            MyPlayer.getInstance().releaseMedia()
//        }
    }
}