package com.remax.visualnovel.utils

import com.alibaba.android.arouter.launcher.ARouter
import com.remax.visualnovel.BuildConfig

/**
 * 路由配置;
 * Created by Eric on 2020/9/1
 */
class Routers {

    companion object {

        private const val ROUTER = "/router/"

        //----------------- Pre ----------------
        const val CHAT_FLIRTING_LEVEL = "${ROUTER}chatFlirtingLevel"
        const val WALLET = "${ROUTER}wallet"
        const val INCOME = "${ROUTER}income"
        const val TRANSACTION = "${ROUTER}transaction"
        const val RECHARGE = "${ROUTER}recharge"




        //----------------- New ----------------
        const val SPLASH = "${ROUTER}splash"
        const val MAIN = "${ROUTER}main"
        const val ROUTE_FRAG_BOOKLIST = "${ROUTER}bookList"
        const val ROUTE_FRAG_MANGALIST = "${ROUTER}mangaList"
        const val ROUTE_FRAG_ACTORLIST = "${ROUTER}actorList"
        const val ROUTE_FRAG_HISTORY = "${ROUTER}history"
        const val LOGIN = "${ROUTER}login"
        const val REGISTER = "${ROUTER}register"
        const val BROWSER = "${ROUTER}browser"
        const val CHAT = "${ROUTER}chat"
        const val DISCUSSION = "${ROUTER}discussion"
        const val SEARCH = "${ROUTER}search"
        const val CHECK_IN = "${ROUTER}checkin"




        fun navigation(path: String) {
            ARouter.getInstance().build(path).navigation()
        }

        fun navigationToUA() {
            navigationToBrowser(url = BuildConfig.EPAL_TERMS_SERVICES)
        }

        fun navigationToRA() {
            navigationToBrowser(url = BuildConfig.RECHAEGE_SERVICES)
        }

        fun navigationToBrowser(title: String = "", url: String, needTitle: Boolean = true) {
            ARouter.getInstance()
                .build(BROWSER)
                .withString("title", title)
                .withBoolean("needTitle", needTitle)
                .withString("url", url)
                .navigation()
        }

    }
}