package com.zswc.creativity.utils

import android.app.Activity
import android.content.Context
import android.content.Intent
import com.zswc.creativity.activity.LoginActivity
import com.zswc.creativity.activity.OneLoginActivity
import com.zswc.creativity.activity.RegisterActivity
import com.ysnows.base.utils.UiSwitch

object MUiSwitch {

    fun single(context: Context, cls: Class<*>) {
        val intent = Intent(context, cls)
        context.startActivity(intent)
        if (context is Activity) {
            context.overridePendingTransition(UiSwitch.enterAnim, UiSwitch.exitAnim)
        }
    }


    fun toLogin(context: Context) {
        single(context, LoginActivity::class.java)
    }

    fun toRegister(context: Context) {
        single(context, RegisterActivity::class.java)
    }

    fun toOneLogin(context: Context){
        single(context,OneLoginActivity::class.java)
    }

}
