rc
This commit is contained in:
@@ -47,6 +47,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
crashSystem.setDebug(BuildConfig.DEBUG);
|
||||
Logger.init(BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF);
|
||||
|
||||
MogoModulePaths.addModule(new MogoModule(PATH_GUIDE_AGREEMENT_FRAGMENT, PATH_GUIDE_AGREEMENT_MODULE_NAME));
|
||||
//运营位卡片,需要默认显示,放在第一个加载
|
||||
MogoModulePaths.addModule(new MogoModule(AdCardConstants.TAG, AdCardConstants.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(MediaConstants.TAG, MediaConstants.MODULE_TYPE));
|
||||
@@ -58,7 +59,6 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.PATH_V2X_UI));
|
||||
MogoModulePaths.addModule(new MogoModule(PushUIConstants.TAG, PushUIConstants.TAG));
|
||||
MogoModulePaths.addModule(new MogoModule(BackToLauncherConst.MODULE_PATH, BackToLauncherConst.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule(PATH_GUIDE_AGREEMENT_FRAGMENT, PATH_GUIDE_AGREEMENT_MODULE_NAME));
|
||||
Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
}
|
||||
|
||||
|
||||
@@ -51,10 +51,9 @@ ext {
|
||||
// 公司服务 - 埋点
|
||||
analytics : "com.elegant.analytics:analytics:1.1.19",
|
||||
|
||||
// retrofit
|
||||
retrofit : "com.squareup.retrofit2:retrofit:2.3.0",
|
||||
retrofitadapter : "com.squareup.retrofit2:adapter-rxjava2:2.3.0",
|
||||
retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.3.0",
|
||||
retrofit : "com.squareup.retrofit2:retrofit:2.6.0",
|
||||
retrofitadapter : "com.squareup.retrofit2:adapter-rxjava2:2.6.0",
|
||||
retrofitconvertergson : "com.squareup.retrofit2:converter-gson:2.6.0",
|
||||
retrofitconverterscalars : "com.squareup.retrofit2:converter-scalars:2.1.0",
|
||||
|
||||
|
||||
|
||||
@@ -11,22 +11,36 @@ import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public final class RetrofitFactory {
|
||||
|
||||
private static final Map< String, Retrofit> sRpcServiceMap = new ArrayMap< String,Retrofit>();
|
||||
private static final Map<String, Retrofit> sRpcServiceMap = new ArrayMap<String, Retrofit>();
|
||||
private static final Map<String, Retrofit> sRpcNoAdapterServiceMap = new ArrayMap<String, Retrofit>();
|
||||
|
||||
private RetrofitFactory(){}
|
||||
private RetrofitFactory() {
|
||||
}
|
||||
|
||||
public static synchronized Retrofit getInstance( String baseUrl) {
|
||||
public static synchronized Retrofit getInstance(String baseUrl) {
|
||||
Retrofit target = sRpcServiceMap.get(baseUrl);
|
||||
if(target == null){
|
||||
if (target == null) {
|
||||
target = new Retrofit.Builder().
|
||||
client(OkHttpFactory.getInstance()).
|
||||
baseUrl(baseUrl).
|
||||
addCallAdapterFactory( RxJava2CallAdapterFactory.create()).
|
||||
addCallAdapterFactory(RxJava2CallAdapterFactory.create()).
|
||||
addConverterFactory(GsonConverterFactory.create()).
|
||||
build();
|
||||
sRpcServiceMap.put(baseUrl,target);
|
||||
sRpcServiceMap.put(baseUrl, target);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
public static synchronized Retrofit getInstanceNoCallAdapter(String baseUrl) {
|
||||
Retrofit target = sRpcNoAdapterServiceMap.get(baseUrl);
|
||||
if (target == null) {
|
||||
target = new Retrofit.Builder().
|
||||
client(OkHttpFactory.getInstance()).
|
||||
baseUrl(baseUrl).
|
||||
addConverterFactory(GsonConverterFactory.create()).
|
||||
build();
|
||||
sRpcNoAdapterServiceMap.put(baseUrl, target);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,30 +23,34 @@ open class IMogoAuthorizeController {
|
||||
Logger.d(TAG, "invokeAuthorizeContent ---checkAgreementType can not find tag :$tag")
|
||||
})
|
||||
}
|
||||
request<BaseResponse<UserAgreement>> {
|
||||
loader {
|
||||
authorizeModel.invokeAuthorizeContent(agreementType)
|
||||
}
|
||||
onSuccess {
|
||||
Logger.d(TAG, "invokeAuthorizeContent onSuccess data: ${it.result}")
|
||||
getAuthorizeContentListener(tag, { listener ->
|
||||
if (it.result != null) {
|
||||
listener.requestContentSuccess(it.result)
|
||||
} else {
|
||||
listener.requestContentFailed("request authorize content success ,but result data is :${it.result}")
|
||||
}
|
||||
}, {
|
||||
Logger.d(TAG, "invokeAuthorizeContent --- can not find listener by this tag :$tag")
|
||||
})
|
||||
}
|
||||
onError {
|
||||
getAuthorizeContentListener(tag, { listener ->
|
||||
listener.requestContentFailed(it.message
|
||||
?: "request authorize content failed,please check network")
|
||||
}, {
|
||||
Logger.d(TAG, "invokeAuthorizeContent --- can not find listener by this tag :$tag")
|
||||
})
|
||||
try {
|
||||
request<BaseResponse<UserAgreement>> {
|
||||
loader {
|
||||
authorizeModel.invokeAuthorizeContent(1)
|
||||
}
|
||||
onSuccess {
|
||||
Logger.d(TAG, "invokeAuthorizeContent onSuccess data: ${it.result}")
|
||||
getAuthorizeContentListener(tag, { listener ->
|
||||
if (it.result != null) {
|
||||
listener.requestContentSuccess(it.result)
|
||||
} else {
|
||||
listener.requestContentFailed("request authorize content success ,but result data is :${it.result}")
|
||||
}
|
||||
}, {
|
||||
Logger.d(TAG, "invokeAuthorizeContent --- can not find listener by this tag :$tag")
|
||||
})
|
||||
}
|
||||
onError {
|
||||
getAuthorizeContentListener(tag, { listener ->
|
||||
listener.requestContentFailed(it.message
|
||||
?: "request authorize content failed,please check network")
|
||||
}, {
|
||||
Logger.d(TAG, "invokeAuthorizeContent --- can not find listener by this tag :$tag")
|
||||
})
|
||||
}
|
||||
}
|
||||
}catch (e:Exception){
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,9 @@ open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
|
||||
|
||||
override fun invokeAuthorizeContent(tag: String) {
|
||||
//todo 后面动态代理统一处理校验问题
|
||||
Logger.d("invokeAuthorizeContent","tag:$tag")
|
||||
val agreementType = AuthorizeProxy.getAuthorizeType(tag)
|
||||
Logger.d("invokeAuthorizeContent","agreementType:$agreementType")
|
||||
baseController.invokeAuthorizeContent(tag, agreementType)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.mogo.commons.network.Utils.getSn
|
||||
import com.mogo.module.authorize.model.BaseResponse
|
||||
import com.mogo.module.authorize.model.IMogoAuthorizeModel
|
||||
import com.mogo.module.authorize.model.bean.UpdateAuthorize
|
||||
import com.mogo.module.authorize.util.ServiceUtil.getNetWorkApi
|
||||
|
||||
class MogoAuthorizeMainModel : IMogoAuthorizeModel() {
|
||||
|
||||
@@ -14,4 +13,5 @@ class MogoAuthorizeMainModel : IMogoAuthorizeModel() {
|
||||
val map = mapOf("sn" to getSn(), "data" to updateAuthorize)
|
||||
return apiCall { getNetWorkApi().updateAuthorize(map) }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import android.os.Looper
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
|
||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
|
||||
import com.mogo.module.authorize.fragment.AuthorizeFragment
|
||||
import com.mogo.module.authorize.util.ServiceUtil.getFragmentManagerApi
|
||||
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasAuth
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.MogoServicePaths
|
||||
@@ -39,7 +39,7 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
Logger.d(TAG, "User is operation authorization, do not repeat invoke")
|
||||
return
|
||||
}
|
||||
pushFragmentToMainView {
|
||||
pushFragmentToMainView(AUTHORIZE_TYPE_LAUNCHER_MAIN) {
|
||||
showAuthorizeView = true
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
Logger.d(TAG, "ready to forbidden voice")
|
||||
forbiddenVoice.invoke()
|
||||
Logger.d(TAG, "ready to push fragment")
|
||||
pushFragmentToMainView {
|
||||
pushFragmentToMainView(tag) {
|
||||
showAuthorizeView = true
|
||||
}
|
||||
}
|
||||
@@ -76,9 +76,9 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
}
|
||||
}
|
||||
|
||||
private inline fun pushFragmentToMainView(push: (() -> Unit)) {
|
||||
val builderWrapper = FragmentDescriptor.Builder().fragment(AuthorizeFragment()).build()
|
||||
Logger.d(TAG,"pushFragmentToMainView")
|
||||
private inline fun pushFragmentToMainView(tag: String, push: (() -> Unit)) {
|
||||
val builderWrapper = FragmentDescriptor.Builder().fragment(AuthorizeFragment(tag)).build()
|
||||
Logger.d(TAG, "pushFragmentToMainView")
|
||||
val mogoService = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation()
|
||||
if (mogoService is IMogoServiceApis) {
|
||||
mogoService.fragmentManagerApi.push(builderWrapper)
|
||||
@@ -87,8 +87,27 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
}
|
||||
|
||||
private inline fun popFragmentFromMainView(pop: (() -> Unit)) {
|
||||
getFragmentManagerApi().pop()
|
||||
val mogoService = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation()
|
||||
if (mogoService is IMogoServiceApis) {
|
||||
mogoService.fragmentManagerApi.pop()
|
||||
}
|
||||
pop.invoke()
|
||||
}
|
||||
|
||||
fun authorizeSuccess(tag: String) {
|
||||
val listener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag)
|
||||
if (listener == null) {
|
||||
Logger.d(TAG, "authorizeSuccess,but listener is null ")
|
||||
}
|
||||
listener!!.authorizeSuccess()
|
||||
}
|
||||
|
||||
fun authorizeFailed(tag: String, errorMsg: String) {
|
||||
val listener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag)
|
||||
if (listener == null) {
|
||||
Logger.d(TAG, "authorizeFailed,but listener is null ")
|
||||
}
|
||||
listener!!.authorizeFailed(errorMsg)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ class ApiException : CommonException {
|
||||
|
||||
companion object {
|
||||
val NULL_REQUEST_DATA_API_EXCEPTION = ApiException(2, "request data is null")
|
||||
val ENTER_ROOM_API_EXCEPTION = ApiException(3, "roomId is null or already enter room")
|
||||
}
|
||||
|
||||
constructor(code: Int, msg: String) : super(code, msg)
|
||||
|
||||
@@ -4,6 +4,7 @@ open class CommonException : Exception {
|
||||
|
||||
companion object {
|
||||
val NETWORK_EXCEPTION = CommonException(1, "network is error")
|
||||
val NULL_EXCEPTION = CommonException(1, "error msg is null")
|
||||
}
|
||||
|
||||
protected var code: Int = 0
|
||||
|
||||
@@ -5,10 +5,18 @@ import com.mogo.commons.mvp.IView
|
||||
class AuthorizeContract {
|
||||
|
||||
interface View : IView {
|
||||
fun showAuthorizationAgreementContent(agreementId: Long, agreementContent: String, agreementTitle: String, agreementBottom: String, agreementLast: String)
|
||||
|
||||
fun readyToAuthorize()
|
||||
|
||||
fun showAuthorizationError()
|
||||
}
|
||||
|
||||
interface Biz {
|
||||
fun invokeAuthorize(invokeTag: String)
|
||||
|
||||
fun agreeAuthorize(tag: String, agreementId: Long)
|
||||
|
||||
fun disAgreeAuthorize(tag: String, agreementId: Long)
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,74 @@
|
||||
package com.mogo.module.authorize.fragment
|
||||
|
||||
import android.text.Html
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.module.authorize.R
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.android.synthetic.main.module_authorize_fragment.*
|
||||
|
||||
class AuthorizeFragment : MvpFragment<AuthorizeContract.View, AuthorizePresenter>(), AuthorizeContract.View,View.OnClickListener {
|
||||
class AuthorizeFragment(private val invokeTag: String) : MvpFragment<AuthorizeContract.View, AuthorizePresenter>(), AuthorizeContract.View, View.OnClickListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "AuthorizeFragment"
|
||||
}
|
||||
|
||||
private var agreementId: Long = 0L
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_authorize_fragment
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
|
||||
btnAuthorizeAgree.setOnClickListener(this)
|
||||
btnAuthorizeDisAgree.setOnClickListener(this)
|
||||
btnAuthorizeLoadingError.setOnClickListener(this)
|
||||
clLoadingErrorContainer.setOnClickListener(this)
|
||||
Logger.d(TAG, "invokeTag :$invokeTag")
|
||||
}
|
||||
|
||||
override fun createPresenter(): AuthorizePresenter {
|
||||
return AuthorizePresenter(this)
|
||||
return AuthorizePresenter(invokeTag, this)
|
||||
}
|
||||
|
||||
override fun readyToAuthorize() {
|
||||
clLoadingErrorContainer.visibility = View.GONE
|
||||
clLoadingContainer.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun showAuthorizationAgreementContent(
|
||||
agreementId: Long,
|
||||
agreementContent: String,
|
||||
agreementTitle: String,
|
||||
agreementBottom: String,
|
||||
agreementLast: String) {
|
||||
clLoadingContainer.visibility = View.GONE
|
||||
clAuthorizeContainer.visibility = View.VISIBLE
|
||||
this.agreementId = agreementId
|
||||
tvAuthorizeTitle.text = Html.fromHtml(agreementTitle)
|
||||
tvAuthorizeContent.text = Html.fromHtml(agreementContent)
|
||||
tvAuthorizeButtonContent.text = Html.fromHtml(agreementBottom)
|
||||
tvAuthorizeLastContent.text = Html.fromHtml(agreementContent)
|
||||
}
|
||||
|
||||
override fun showAuthorizationError() {
|
||||
clLoadingContainer.visibility = View.GONE
|
||||
clLoadingErrorContainer.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
|
||||
when (v.id) {
|
||||
R.id.btnAuthorizeAgree -> {
|
||||
mPresenter.agreeAuthorize(invokeTag, agreementId)
|
||||
}
|
||||
R.id.btnAuthorizeDisAgree -> {
|
||||
mPresenter.disAgreeAuthorize(invokeTag, agreementId)
|
||||
}
|
||||
R.id.clLoadingErrorContainer, R.id.btnAuthorizeLoadingError -> {
|
||||
mPresenter.invokeAuthorize(invokeTag)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,14 +2,85 @@ package com.mogo.module.authorize.fragment
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeContentListener
|
||||
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
|
||||
import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListener
|
||||
import com.mogo.module.authorize.model.bean.UserAgreement
|
||||
import com.mogo.module.authorize.model.proxy.AuthorizeProxy
|
||||
import com.mogo.utils.logger.Logger
|
||||
|
||||
class AuthorizePresenter : Presenter<AuthorizeContract.View>, AuthorizeContract.Biz {
|
||||
class AuthorizePresenter : Presenter<AuthorizeContract.View>, AuthorizeContract.Biz, IMogoAuthorizeContentListener, IMogoAcquireAuthorizeListener {
|
||||
|
||||
constructor(view: AuthorizeContract.View?) : super(view)
|
||||
companion object {
|
||||
const val TAG = "AuthorizePresenter"
|
||||
}
|
||||
|
||||
private var invokeTag: String? = null
|
||||
|
||||
constructor(invokeTag: String, view: AuthorizeContract.View?) : super(view) {
|
||||
this.invokeTag = invokeTag
|
||||
}
|
||||
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
super.onCreate(owner)
|
||||
Logger.d(TAG, "onCreate invokeTag:$invokeTag")
|
||||
invokeAuthorize(invokeTag!!)
|
||||
}
|
||||
|
||||
override fun invokeAuthorize(invokeTag: String) {
|
||||
mView.readyToAuthorize()
|
||||
this.invokeTag = invokeTag
|
||||
mogoAuthShow.registerInvokeAuthorizeContentListener(invokeTag, this)
|
||||
mogoAuthShow.registerAuthorizeListener(invokeTag, this)
|
||||
mogoAuthShow.invokeAuthorizeContent(invokeTag)
|
||||
}
|
||||
|
||||
override fun requestContentSuccess(userAgreement: UserAgreement) {
|
||||
val id = userAgreement.agreementEntity.id
|
||||
val content = userAgreement.agreementContent[0]
|
||||
val title = userAgreement.agreementEntity.title
|
||||
val bottomContent = userAgreement.agreementEntity.agreementButtonFirst
|
||||
val lastContent = userAgreement.agreementEntity.agreementButtonSecond
|
||||
mView.showAuthorizationAgreementContent(id, content, title, bottomContent, lastContent)
|
||||
}
|
||||
|
||||
override fun requestContentFailed(errorMsg: String) {
|
||||
Logger.d(TAG, "requestContentFailed errorMsg:$errorMsg")
|
||||
mView.showAuthorizationError()
|
||||
}
|
||||
|
||||
override fun agreeAuthorize(tag: String, agreementId: Long) {
|
||||
mogoAuthShow.agreeAuthorize(tag, agreementId)
|
||||
}
|
||||
|
||||
override fun disAgreeAuthorize(tag: String, agreementId: Long) {
|
||||
mogoAuthShow.disAgreeAuthorize(tag, agreementId)
|
||||
}
|
||||
|
||||
override fun authorizeSuccess() {
|
||||
mogoAuthShow.authorizeSuccess(invokeTag!!)
|
||||
closeAuthorizeView()
|
||||
}
|
||||
|
||||
override fun authorizeFailed(errorMsg: String) {
|
||||
mogoAuthShow.authorizeFailed(invokeTag!!, errorMsg)
|
||||
closeAuthorizeView()
|
||||
}
|
||||
|
||||
override fun forbiddenVoiceWhenAuthorize(cmd: String) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
private fun closeAuthorizeView() {
|
||||
mogoAuthShow.hideAuthorizeView()
|
||||
}
|
||||
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
super.onDestroy(owner)
|
||||
Logger.d(TAG, "onDestroy invokeTag : $invokeTag")
|
||||
invokeTag?.let {
|
||||
mogoAuthShow.unregisterInvokeAuthorizeContentListener(it)
|
||||
mogoAuthShow.unregisterAuthorizeListener(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,23 @@
|
||||
package com.mogo.module.authorize.model
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.module.authorize.constant.HttpConstant
|
||||
import com.mogo.module.authorize.net.AuthorizeApi
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.MogoServicePaths
|
||||
|
||||
open class BaseRepository {
|
||||
|
||||
suspend fun <T : Any> apiCall(call: suspend () -> BaseResponse<T>): BaseResponse<T> {
|
||||
return call.invoke()
|
||||
}
|
||||
|
||||
fun getNetWorkApi(): AuthorizeApi {
|
||||
var serviceApi: IMogoServiceApis? = null
|
||||
val mogoService = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation()
|
||||
if (mogoService is IMogoServiceApis) {
|
||||
serviceApi = mogoService
|
||||
}
|
||||
return serviceApi!!.networkApi.createNoCallAdapter(AuthorizeApi::class.java, HttpConstant.getNetHost())
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import com.google.gson.Gson
|
||||
import com.mogo.commons.network.Utils.getSn
|
||||
import com.mogo.module.authorize.model.bean.RequestUserAgreement
|
||||
import com.mogo.module.authorize.model.bean.UserAgreement
|
||||
import com.mogo.module.authorize.util.ServiceUtil.getNetWorkApi
|
||||
|
||||
open class IMogoAuthorizeModel : BaseRepository() {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class RequestUserAgreement(val agreementType:Int)
|
||||
data class UserAgreement(var agreementEntity: TUserAgreementEntity, var agreementContent: List<String>)
|
||||
|
||||
data class TUserAgreementEntity(
|
||||
val id: Int, //协议ID
|
||||
val id: Long, //协议ID
|
||||
val title: String, //标题
|
||||
val subhead: String, //副标题
|
||||
val agreementButtonFirst: String, //底部标题1
|
||||
|
||||
@@ -7,25 +7,26 @@ import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Co
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_SHARE_NOVELTY
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_NOVELTY
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_TAN_LU
|
||||
import java.util.*
|
||||
|
||||
class AuthorizeProxy {
|
||||
|
||||
companion object {
|
||||
var allAuthorizeTypes = HashMap<String, IAuthorizeOperation>()
|
||||
|
||||
const val TAG = "AuthorizeProxy"
|
||||
|
||||
fun getAuthorizeType(authorizeName: String): Int {
|
||||
if (authorizeName.isNullOrBlank()) {
|
||||
return -1
|
||||
}
|
||||
return allAuthorizeTypes[authorizeName]!!.getAcquireId()
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
for ((index, type) in AuthorizeEnum.values().withIndex()) {
|
||||
type.getOperationName()?.let {
|
||||
allAuthorizeTypes[it] = type
|
||||
return when (authorizeName) {
|
||||
AUTHORIZE_TYPE_LAUNCHER_MAIN,
|
||||
AUTHORIZE_TYPE_LAUNCHER_SHARE_NOVELTY,
|
||||
AUTHORIZE_TYPE_LAUNCHER_SHARE_MUSIC -> 0
|
||||
AUTHORIZE_TYPE_TAN_LU -> 1
|
||||
AUTHORIZE_TYPE_CALL_CHAT -> 2
|
||||
AUTHORIZE_TYPE_NOVELTY -> 3
|
||||
AUTHORIZE_TYPE_AUXILIARY_DRIVING -> 4
|
||||
else -> -1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,14 +8,14 @@ import retrofit2.http.POST
|
||||
|
||||
interface AuthorizeApi {
|
||||
|
||||
//获取授权内容
|
||||
//获取授权内容·
|
||||
@FormUrlEncoded
|
||||
@POST("yycp-channelManager/agreement/findUserAgreement")
|
||||
@POST("yycp-channelManager/user/agreement/findUserAgreement")
|
||||
suspend fun getAuthorizeContent(@FieldMap authorizeContent: Map<String, String>): BaseResponse<UserAgreement>
|
||||
|
||||
//更新授权状态
|
||||
@FormUrlEncoded
|
||||
@POST("yycp-channelManager/agreement/updateStatus")
|
||||
@POST("yycp-channelManager/user/agreement/updateStatus")
|
||||
suspend fun updateAuthorize(@FieldMap updateStatus: Map<String, String>): BaseResponse<Any>
|
||||
|
||||
}
|
||||
@@ -3,7 +3,9 @@ package com.mogo.module.authorize.net
|
||||
import com.mogo.module.authorize.exception.ApiException
|
||||
import com.mogo.module.authorize.exception.ApiException.Companion.NULL_REQUEST_DATA_API_EXCEPTION
|
||||
import com.mogo.module.authorize.exception.CommonException.Companion.NETWORK_EXCEPTION
|
||||
import com.mogo.module.authorize.exception.CommonException.Companion.NULL_EXCEPTION
|
||||
import com.mogo.module.authorize.model.BaseResponse
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.coroutines.*
|
||||
import java.net.SocketTimeoutException
|
||||
import java.net.UnknownHostException
|
||||
@@ -61,11 +63,15 @@ class Request<T> {
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
if(e == null){
|
||||
onError?.invoke(NULL_EXCEPTION)
|
||||
return@launch
|
||||
}
|
||||
when (e) {
|
||||
is UnknownHostException -> onError?.invoke(NETWORK_EXCEPTION)
|
||||
is TimeoutException -> onError?.invoke(NETWORK_EXCEPTION)
|
||||
is SocketTimeoutException -> onError?.invoke(NETWORK_EXCEPTION)
|
||||
else -> onError?.invoke(java.lang.Exception(e.message))
|
||||
else -> onError?.invoke(java.lang.Exception(e.message?:""))
|
||||
}
|
||||
} finally {
|
||||
onComplete?.invoke()
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.mogo.module.authorize.util
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.module.authorize.constant.HttpConstant.Companion.getNetHost
|
||||
import com.mogo.module.authorize.net.AuthorizeApi
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.MogoServicePaths
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager
|
||||
|
||||
object ServiceUtil {
|
||||
|
||||
private lateinit var serviceApi: IMogoServiceApis
|
||||
|
||||
init {
|
||||
initMogoService()
|
||||
}
|
||||
|
||||
private fun initMogoService() {
|
||||
if (serviceApi == null) {
|
||||
val mogoService = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation()
|
||||
if (mogoService is IMogoServiceApis) {
|
||||
this.serviceApi = mogoService
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getNetWorkApi(): AuthorizeApi {
|
||||
checkInit()
|
||||
return serviceApi.networkApi.create(AuthorizeApi::class.java, getNetHost())
|
||||
}
|
||||
|
||||
fun getFragmentManagerApi(): IMogoFragmentManager {
|
||||
checkInit()
|
||||
return serviceApi.fragmentManagerApi
|
||||
}
|
||||
|
||||
private fun checkInit() {
|
||||
if (serviceApi == null) {
|
||||
initMogoService()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 194 B |
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_59" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_59" />
|
||||
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_22" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_22" />
|
||||
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="@dimen/dp_22" />
|
||||
<gradient
|
||||
android:endColor="#3F4057"
|
||||
android:startColor="#50526E " />
|
||||
</shape>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:bottomRightRadius="@dimen/dp_22" />
|
||||
<gradient android:endColor="#803F4057" android:startColor="#8050526E" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:bottomRightRadius="@dimen/dp_22" />
|
||||
<gradient android:endColor="#3F4057" android:startColor="#50526E " />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:topLeftRadius="@dimen/dp_22" android:topRightRadius="@dimen/dp_22" />
|
||||
<gradient
|
||||
android:endColor="#2A2B38"
|
||||
android:startColor="#3F4057" />
|
||||
</shape>
|
||||
@@ -1,9 +1,183 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#20ADEE">
|
||||
android:background="#000000">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clLoadingContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_330"
|
||||
android:layout_marginTop="@dimen/dp_90"
|
||||
android:layout_marginRight="@dimen/dp_330"
|
||||
android:layout_marginBottom="@dimen/dp_90"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAuthorizeLoading"
|
||||
android:layout_width="@dimen/dp_147"
|
||||
android:layout_height="@dimen/dp_147"
|
||||
android:layout_marginTop="@dimen/dp_335"
|
||||
android:src="@mipmap/module_authorize_loading"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeLoading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_44"
|
||||
android:text="@string/module_authorize_agreement_loading"
|
||||
android:textColor="#99FFFFFF"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoading" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clLoadingErrorContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_330"
|
||||
android:layout_marginTop="@dimen/dp_90"
|
||||
android:layout_marginRight="@dimen/dp_330"
|
||||
android:layout_marginBottom="@dimen/dp_90"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAuthorizeLoadingError"
|
||||
android:layout_width="@dimen/dp_147"
|
||||
android:layout_height="@dimen/dp_147"
|
||||
android:layout_marginTop="@dimen/dp_254"
|
||||
android:src="@mipmap/module_authorize_loading_error"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeLoadingError"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_33"
|
||||
android:text="@string/module_authorize_agreement_error"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoadingError" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeLoadingError"
|
||||
android:layout_width="@dimen/dp_461"
|
||||
android:layout_height="@dimen/dp_97"
|
||||
android:layout_marginTop="@dimen/dp_33"
|
||||
android:text="@string/module_authorize_agreement_retry"
|
||||
android:textColor="@android:color/white"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/module_authorize_selector_blue_corner"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeLoadingError" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clAuthorizeContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_330"
|
||||
android:layout_marginTop="@dimen/dp_90"
|
||||
android:layout_marginRight="@dimen/dp_330"
|
||||
android:layout_marginBottom="@dimen/dp_90"
|
||||
android:background="@drawable/module_authorize_shape_drak_top_corner"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeAgree"
|
||||
android:layout_width="@dimen/dp_607"
|
||||
android:layout_height="@dimen/dp_156"
|
||||
android:background="@drawable/module_authorize_selector_blue_left_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_agree"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_55"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeDisAgree"
|
||||
android:layout_width="@dimen/dp_607"
|
||||
android:layout_height="@dimen/dp_156"
|
||||
android:background="@drawable/module_authorize_selector_dark_right_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_disagree"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_55"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="0px"
|
||||
android:layout_height="0px"
|
||||
android:layout_marginBottom="@dimen/dp_160"
|
||||
android:scrollbarSize="@dimen/dp_11"
|
||||
android:scrollbarThumbVertical="@drawable/module_authorize_scrollbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeTitle">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_44" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeButtonContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeLastContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white" />
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_62"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_55"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
1046
modules/mogo-module-authorize/src/main/res/values-ldpi-v4/dimens.xml
Normal file
1046
modules/mogo-module-authorize/src/main/res/values-ldpi-v4/dimens.xml
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,8 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-module-authorize</string>
|
||||
<string name="module_authorize_agreement_agree">同意</string>
|
||||
<string name="module_authorize_agreement_disagree">不同意</string>
|
||||
<string name="module_authorize_agreement_loading">正在加载,请稍等...</string>
|
||||
<string name="module_authorize_agreement_error">加载失败</string>
|
||||
<string name="module_authorize_agreement_retry">点击重试</string>
|
||||
</resources>
|
||||
|
||||
@@ -36,6 +36,7 @@ public class ExtensionsModuleConst {
|
||||
//唤醒指令
|
||||
//分享路况/上报路况/上报拥堵/上报交通检查/上报封路 唤醒
|
||||
public static final String UPLOAD_ROAD_CONDITION_AWAKEN = "com.zhidao.pathfinder.report.roadCondition";
|
||||
public static final String UPLOAD_ROAD_CONDITION = "command_upload_roadcondition";
|
||||
//关闭分享框 唤醒
|
||||
public static final String SHARE_DIALOG_CLOSE = "com.zhidao.share.close";
|
||||
// 两次未回复关闭分享对话框
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -46,6 +48,7 @@ import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.fragmentmanager.FragmentDescriptor;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoAddressManager;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
@@ -215,8 +218,29 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mSpeedLimit = findViewById( R.id.module_entrance_id_speed_limit_container );
|
||||
mSpeedLimitValue = findViewById( R.id.module_entrance_id_speed_limit_value );
|
||||
mSpeedLimitUnit = findViewById( R.id.module_entrance_id_speed_limit_unit );
|
||||
}
|
||||
|
||||
|
||||
mApis.getIntentManagerApi().registerIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV, new IMogoIntentListener() {
|
||||
@Override public void onIntentReceived(String intentStr, Intent intent) {
|
||||
int key_type = intent.getIntExtra("KEY_TYPE", 0);
|
||||
|
||||
int type = intent.getIntExtra("EXTRA_TYPE", -1);
|
||||
int opera_type = intent.getIntExtra("EXTRA_OPERA", -1);
|
||||
if (key_type == 10027) {
|
||||
if (opera_type == 0) {
|
||||
ivMode.setSelected(false);
|
||||
} else if (opera_type == 1) {
|
||||
ivMode.setSelected(true);
|
||||
}
|
||||
ivMode.setText(
|
||||
getString( ivMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
private static final String AUTONAVI_STANDARD_BROADCAST_RECV =
|
||||
"AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
@NonNull
|
||||
@Override
|
||||
protected EntrancePresenter createPresenter() {
|
||||
|
||||
@@ -125,6 +125,8 @@ public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
* 注册唤醒命令
|
||||
*/
|
||||
private void registerAwakeVoice() {
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION, mogoIntentListener);
|
||||
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.GO_TO_SHARE, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.SHARE_DIALOG_CLOSE, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN, mogoIntentListener);
|
||||
@@ -206,6 +208,8 @@ public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
ShareControl.getInstance(mContext).dismissDialog();
|
||||
Logger.d(TAG, "mogoIntentListener 两次未回复关闭对话框");
|
||||
}
|
||||
} else if (intentStr.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION)) { //上报路况 免唤醒 --ok
|
||||
uploadRoadCondition();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -244,7 +248,8 @@ public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 上报封路 ----> ");
|
||||
uploadRoadClosed();
|
||||
} else if (mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK)
|
||||
|| mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN)) { //上报拥堵, 分享路况, 上报路况
|
||||
|| mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION_AWAKEN)
|
||||
|| mVoiceCmdType.equals(ExtensionsModuleConst.UPLOAD_ROAD_CONDITION)) { //上报拥堵, 分享路况, 上报路况
|
||||
Log.d(TAG, "handleNeedAuthorizeCmd 上报路况 ----> ");
|
||||
uploadRoadCondition();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ object GuideBizManager {
|
||||
fun init() {
|
||||
Logger.d("GuideBizManager", "init===================================")
|
||||
initService()
|
||||
addGuideFragmentToStack()
|
||||
// addGuideFragmentToStack()
|
||||
}
|
||||
|
||||
private fun initService() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_53" />
|
||||
<gradient android:endColor="#FF31A8AA" android:startColor="#FF0068CB" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoUiSettings;
|
||||
import com.mogo.map.MogoMapView;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
@@ -122,6 +123,7 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
uiSettings.setZoomControlsEnabled( false );
|
||||
//设置双指缩放手势是否可用。
|
||||
uiSettings.setZoomGesturesEnabled( true );
|
||||
mMogoMap.getUIController().changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,8 @@ public class MapPresenter extends Presenter<MapView> implements
|
||||
mRefreshStrategyController.restartAutoRefreshAtTime( 30 );
|
||||
}
|
||||
} else if (type == 2) {
|
||||
|
||||
mMogoIntentManager.invoke(AUTONAVI_STANDARD_BROADCAST_RECV,intent);
|
||||
if (opera_type == 0) {
|
||||
mView.getUIController().changeMapMode(EnumMapUI.CarUp_2D);
|
||||
} else if (opera_type == 1) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
||||
package com.mogo.service.network;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -18,7 +18,19 @@ public interface IMogoNetwork extends IProvider {
|
||||
*
|
||||
* @param service 业务类
|
||||
* @param baseUrl url
|
||||
* @return 业务类动态代理
|
||||
* @return 业务类动态代理
|
||||
*/
|
||||
@Keep <T> T create(final Class<T> service,String baseUrl);
|
||||
@Keep
|
||||
<T> T create(final Class<T> service, String baseUrl);
|
||||
|
||||
/**
|
||||
* 返回无CallAdapter Retrofit代理对象
|
||||
*
|
||||
* @param service 业务类
|
||||
* @param baseUrl url
|
||||
* @param <T>
|
||||
* @return 业务类动态代理
|
||||
*/
|
||||
@Keep
|
||||
<T> T createNoCallAdapter(final Class<T> service, String baseUrl);
|
||||
}
|
||||
|
||||
@@ -1,30 +1,10 @@
|
||||
package com.mogo.service.impl.network;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.MogoGeoSearch;
|
||||
import com.mogo.map.MogoInitor;
|
||||
import com.mogo.map.MogoInputtipsSearch;
|
||||
import com.mogo.map.MogoLocationClient;
|
||||
import com.mogo.map.MogoMapUIController;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.MogoNavi;
|
||||
import com.mogo.map.MogoPoiSearch;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoNaviListenerHandler;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.inputtips.IMogoInputtipsSearch;
|
||||
import com.mogo.map.search.inputtips.query.MogoInputtipsQuery;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.utils.network.RetrofitFactory;
|
||||
|
||||
@@ -34,15 +14,22 @@ import com.mogo.utils.network.RetrofitFactory;
|
||||
* <p>
|
||||
* 网络对外地接口
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_SERVICES_NETWORK)
|
||||
@Route(path = MogoServicePaths.PATH_SERVICES_NETWORK)
|
||||
public class MogoNetWorkService implements IMogoNetwork {
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
MogoInitor.init( context );
|
||||
public void init(Context context) {
|
||||
MogoInitor.init(context);
|
||||
}
|
||||
|
||||
@Override public <T> T create(Class<T> service,String baseUrl) {
|
||||
@Override
|
||||
public <T> T create(Class<T> service, String baseUrl) {
|
||||
return RetrofitFactory.getInstance(baseUrl).create(service);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T createNoCallAdapter(Class<T> service, String baseUrl) {
|
||||
return RetrofitFactory.getInstanceNoCallAdapter(baseUrl).create(service);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user