package com.yyxx.commsdk.demo

import android.app.Activity
import android.content.Intent
import android.os.Bundle

import android.view.View
import cn.yyxx.commsdk.base.YYXXCommSdk
import cn.yyxx.commsdk.base.internal.ICallback


import cn.yyxx.commsdk.base.internal.IRequestCallback


import cn.yyxx.commsdk.core.network.SdkRequest
import cn.yyxx.support.hawkeye.ToastUtils
import kotlinx.android.synthetic.main.activity_login.*


/**
 * @author #Suyghur.
 * Created on 2021/12/26
 */
class DemoActivity : Activity(), View.OnClickListener {

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
    }

    override fun onNewIntent(intent: Intent?) {
        super.onNewIntent(intent)
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_login)

        login.setOnClickListener(this@DemoActivity)

        YYXXCommSdk.getInstance().initialize(this,true,object: ICallback{
            override fun onResult(code: Int, result: String?) {

                ToastUtils.toastInfo(this@DemoActivity,"code:\$code   msg:$result")
            }
        })

    }



    override fun onClick(v: View?) {
        v?.apply{
            SdkRequest.getInstance().initAgreement(this@DemoActivity, IRequestCallback {
            })
        }
    }
}