package com.yidianling.user.modular_service

import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.yidianling.user.api.service.IAppService


@Route(path = "/user/AppService")
class AppServiceImpl: IAppService {

    override fun mainIntent(activity: Activity) {
        ARouter.getInstance().build("/main/main").navigation()
    }

    override fun mainIntent(context: Context, selectTab: Int, animation: Boolean) {
        val bundle = Bundle()
        bundle.putInt("selectTab", selectTab)
        bundle.putBoolean("animation", animation)

        ARouter.getInstance().build("/main/main")
            .withFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
            .withBundle("bundle",bundle)
            .navigation()
    }

    override fun myRedPockIntent(activity: Activity) {
        ARouter.getInstance().build("/mine/redpacket").navigation()
    }

    override fun receiverRedPacketIntent(activity: Activity, param: String) {
        ARouter.getInstance().build("/main/receiveRedPacket").withString("paramStr",param).navigation()
    }

    override fun personalInfoIntent(activity: Activity) {
        ARouter.getInstance().build("/main/personInfo").navigation()
    }

    override fun rechargeIntent(activity: Activity) {
        ARouter.getInstance().build("/main/recharge").navigation()
    }

    override fun splashIntent(activity: Activity) {
        ARouter.getInstance().build("/main/splash").navigation()
    }

    override fun feedBackIntent(activity: Activity) {
        ARouter.getInstance().build("/mine/FeedBackActivity").navigation()
    }

    override fun sendRedPacketIntent(activity: Activity, toUid: String) {
        ARouter.getInstance().build("/main/sendRedPacket").withString("to_uid",toUid).navigation()
    }

    override fun notificationSettingIntent(activity: Activity) {
        ARouter.getInstance().build("/main/notifysetting").navigation()
    }

    override fun privacyIntent(activity: Activity) {
        ARouter.getInstance().build("/user/privacy").navigation()
    }

    override fun init(context: Context?) {

    }

}