| | |
| | | import android.app.Application |
| | | import android.content.Intent |
| | | import android.os.Bundle |
| | | import android.text.TextUtils |
| | | import android.util.Log |
| | | import androidx.appcompat.app.AppCompatActivity |
| | | import androidx.core.os.bundleOf |
| | |
| | | import cn.sinata.rxnetty.NettyClient |
| | | import cn.sinata.xldutils.activity.BaseActivity |
| | | import cn.sinata.xldutils.application.BaseApplication |
| | | import cn.sinata.xldutils.utils.LanguageUtil |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import com.google.android.gms.maps.MapsInitializer |
| | |
| | | import com.igo.user.interfaces.StringCallback |
| | | import com.igo.user.network.Apis |
| | | import com.igo.user.network.HttpManager |
| | | import com.igo.user.network.RRetrofit |
| | | import com.igo.user.network.entity.TrippingInfo |
| | | import com.igo.user.network.request |
| | | import com.igo.user.ui.MainActivity |
| | |
| | | appContext = this |
| | | // initializeRecaptchaClient() |
| | | registerActivityLifecycleCallbacks(this) |
| | | setDefaultLanguage() |
| | | LanguageUtil.setDefaultLanguage(Const.Language.DEFAULT_LANGUAGE) |
| | | DownloadLibrary.init( |
| | | this, |
| | | resources.getIdentifier("ic_launcher", "mipmap", packageName), |
| | |
| | | ) { renderer -> |
| | | Log.e(Const.GoogleTag, "LATEST renderer:${renderer.name}") |
| | | // initializeConsumerSdk() |
| | | } |
| | | } |
| | | |
| | | //设置默认语言 |
| | | private fun setDefaultLanguage() { |
| | | val language = SPUtils.instance().getString("language") |
| | | if (TextUtils.isEmpty(language)) { |
| | | SPUtils.instance().put("language", Const.Language.DEFAULT_LANGUAGE).apply() |
| | | } |
| | | } |
| | | |
| | |
| | | val userId = SPUtils.instance().getInt(Const.User.USER_ID) |
| | | val token = SPUtils.instance().getString(Const.User.TOKEN) |
| | | if (userId != -1) { |
| | | val language = SPUtils.instance().getString("language") |
| | | val l = when (language) { |
| | | Const.Language.CHINESE -> "1" |
| | | Const.Language.FRENCH -> "3" |
| | | else -> "2" |
| | | } |
| | | val language = LanguageUtil.getLanguage() |
| | | val l = RRetrofit.getLanguageType(language) |
| | | NettyClient.getInstance() |
| | | .sendMessage("{\"data\":{\"userId\":$userId,\"language\":$l,\"token\":\"$token\",\"type\":1},\"method\":\"PING\",\"code\":200,\"msg\":\"SUCCESS\"}") |
| | | } |