Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -44,6 +44,8 @@ android {
|
||||
}
|
||||
release {
|
||||
minifyEnabled false
|
||||
zipAlignEnabled false
|
||||
shrinkResources false
|
||||
signingConfig signingConfigs.release
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
@@ -298,7 +300,7 @@ dependencies {
|
||||
releaseImplementation project(':modules:mogo-module-gps-simulator-noop')
|
||||
implementation project(':modules:mogo-module-media')
|
||||
implementation project(':modules:mogo-module-service')
|
||||
implementation project(':modules:mogo-module-splash')
|
||||
// implementation project(':modules:mogo-module-splash')
|
||||
// 事件面板分渠道引用
|
||||
d82xImplementation project(':modules:mogo-module-event-panel-noop')
|
||||
em1Implementation project(':modules:mogo-module-event-panel-noop')
|
||||
|
||||
130
app/proguard-rules.pro
vendored
130
app/proguard-rules.pro
vendored
@@ -19,3 +19,133 @@
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
|
||||
#
|
||||
#-------------------------------------------基本不用动区域----------------------------------------------
|
||||
#
|
||||
#
|
||||
# -----------------------------基本 -----------------------------
|
||||
|
||||
# 指定代码的压缩级别 0 - 7(指定代码进行迭代优化的次数,在Android里面默认是5,这条指令也只有在可以优化时起作用。)
|
||||
-optimizationpasses 5
|
||||
# 混淆时不会产生形形色色的类名(混淆时不使用大小写混合类名)
|
||||
-dontusemixedcaseclassnames
|
||||
# 指定不去忽略非公共的库类(不跳过library中的非public的类)
|
||||
-dontskipnonpubliclibraryclasses
|
||||
# 指定不去忽略包可见的库类的成员
|
||||
-dontskipnonpubliclibraryclassmembers
|
||||
#不进行优化,建议使用此选项,
|
||||
-dontoptimize
|
||||
# 不进行预校验,Android不需要,可加快混淆速度。
|
||||
-dontpreverify
|
||||
|
||||
# 屏蔽警告,暂不开启。用于抛出异常
|
||||
#-ignorewarnings
|
||||
# 指定混淆是采用的算法,后面的参数是一个过滤器
|
||||
# 这个过滤器是谷歌推荐的算法,一般不做更改
|
||||
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
|
||||
# 保护代码中的Annotation不被混淆
|
||||
-keepattributes *Annotation*,InnerClasses,Signature,EnclosingMethod
|
||||
# 避免混淆泛型, 这在JSON实体映射时非常重要
|
||||
-keepattributes Signature
|
||||
# 抛出异常时保留代码行号
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
#优化时允许访问并修改有修饰符的类和类的成员,这可以提高优化步骤的结果。
|
||||
# 比如,当内联一个公共的getter方法时,这也可能需要外地公共访问。
|
||||
# 虽然java二进制规范不需要这个,要不然有的虚拟机处理这些代码会有问题。当有优化和使用-repackageclasses时才适用。
|
||||
#指示语:不能用这个指令处理库中的代码,因为有的类和类成员没有设计成public ,而在api中可能变成public
|
||||
-allowaccessmodification
|
||||
# 混淆时记录日志(打印混淆的详细信息)
|
||||
# 这句话能够使我们的项目混淆后产生映射文件
|
||||
# 包含有类名->混淆后类名的映射关系
|
||||
-verbose
|
||||
|
||||
|
||||
#
|
||||
# ----------------------------- 默认保留 -----------------------------
|
||||
#
|
||||
#----------------------------------------------------
|
||||
# 保持哪些类不被混淆
|
||||
#继承activity,application,service,broadcastReceiver,contentprovider....不进行混淆
|
||||
|
||||
-keep public class * extends android.app.Activity
|
||||
-keep public class * extends android.app.Fragment
|
||||
-keep public class * extends android.app.Application
|
||||
-keep public class * extends android.app.Service
|
||||
-keep public class * extends android.content.BroadcastReceiver
|
||||
-keep public class * extends android.content.ContentProvider
|
||||
-keep public class * extends android.app.backup.BackupAgentHelper
|
||||
-keep public class * extends android.preference.Preference
|
||||
-keep public class * extends android.view.View
|
||||
|
||||
-dontwarn android.support.design.**
|
||||
-keep public class android.support.design.R$* { *; }
|
||||
|
||||
-keepclasseswithmembernames class * {
|
||||
native <methods>;
|
||||
}
|
||||
|
||||
#这个主要是在layout 中写的onclick方法android:onclick="onClick",不进行混淆
|
||||
#表示不混淆Activity中参数是View的方法
|
||||
-keepclassmembers class * extends android.app.Activity{
|
||||
public void *(android.view.View);
|
||||
}
|
||||
#表示不混淆枚举中的values()和valueOf()方法
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
|
||||
#表示不混淆任何一个View中的setXxx()和getXxx()方法,
|
||||
#因为属性动画需要有相应的setter和getter的方法实现,混淆了就无法工作了。
|
||||
-keep public class * extends android.view.View{
|
||||
*** get*();
|
||||
void set*(***);
|
||||
public <init>(android.content.Context);
|
||||
public <init>(android.content.Context, android.util.AttributeSet);
|
||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||
}
|
||||
-keepclasseswithmembers class * {
|
||||
public <init>(android.content.Context, android.util.AttributeSet);
|
||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||
}
|
||||
|
||||
#表示不混淆Parcelable
|
||||
-keep class * implements android.os.Parcelable {
|
||||
public static final android.os.Parcelable *;
|
||||
}
|
||||
|
||||
# 这指定了继承Serizalizable的类的如下成员不被移除混淆
|
||||
-keepclassmembers class * implements java.io.Serializable {
|
||||
static final long serialVersionUID;
|
||||
private static final java.io.ObjectStreamField[] serialPersistentFields;
|
||||
private void writeObject(java.io.ObjectOutputStream);
|
||||
private void readObject(java.io.ObjectInputStream);
|
||||
java.lang.Object writeReplace();
|
||||
java.lang.Object readResolve();
|
||||
}
|
||||
|
||||
# 保留R下面的资源
|
||||
-keep class **.R$* {
|
||||
*;
|
||||
}
|
||||
|
||||
#不混淆资源类下static的
|
||||
-keepclassmembers class **.R$* {
|
||||
public static <fields>;
|
||||
}
|
||||
|
||||
# 对于带有回调函数的onXXEvent、**On*Listener的,不能被混淆
|
||||
-keepclassmembers class * {
|
||||
void *(**On*Event);
|
||||
void *(**On*Listener);
|
||||
}
|
||||
|
||||
#(可选)避免Log打印输出
|
||||
-assumenosideeffects class android.util.Log {
|
||||
public static *** v(...);
|
||||
public static *** d(...);
|
||||
public static *** i(...);
|
||||
public static *** w(...);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.2.1.17
|
||||
|
||||
## 工程外部模块
|
||||
# 探路
|
||||
MOGO_MODULE_TANLU_VERSION=1.3.0.2
|
||||
MOGO_MODULE_TANLU_VERSION=1.3.0.1-byd
|
||||
# 车聊聊
|
||||
CARCHATTING_VERSION=1.3.2
|
||||
# 车聊聊接口
|
||||
@@ -69,15 +69,15 @@ MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT
|
||||
# 在线车辆F
|
||||
MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2
|
||||
# v2x
|
||||
MOGO_MODULE_V2X_VERSION=1.2.6
|
||||
MOGO_MODULE_V2X_VERSION=1.2.8
|
||||
# 推送
|
||||
MOGO_MODULE_PUSH_VERSION=1.1.5.5
|
||||
MOGO_MODULE_PUSH_VERSION=1.1.5.6
|
||||
MOGO_MODULE_PUSH_BASE_VERSION=1.1.5.5
|
||||
MOGO_MODULE_PUSH_NOOP_VERSION=1.1.5.5
|
||||
# 广告资源位
|
||||
MOGO_MODULE_AD_CARD_VERSION=1.0.1
|
||||
# 探路上报和分享模块
|
||||
TANLULIB_VERSION=1.3.0.2
|
||||
TANLULIB_VERSION=1.3.0.1-byd
|
||||
MOGO_MODULE_EVENT_PANEL_VERSION = 1.0.0-SNAPSHOT
|
||||
MOGO_MODULE_EVENT_PANEL_NOOP_VERSION = 1.0.0-SNAPSHOT
|
||||
#左侧面板模块
|
||||
|
||||
@@ -23,12 +23,6 @@ public class MainIndependentActivity extends MainActivity {
|
||||
super.onCreate( savedInstanceState );
|
||||
// 独立app需要在onCreate里面增加处理scheme的情况
|
||||
mPresenter.handleSchemeIntent( getIntent() );
|
||||
|
||||
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD) {
|
||||
IMogoServiceApis apis =
|
||||
(IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(this);
|
||||
apis.getShareManager().resetContext(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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_30" />
|
||||
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_30" />
|
||||
<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_30" />
|
||||
<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_30" />
|
||||
<gradient android:endColor="#803F4057" android:startColor="#8050526E" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:bottomRightRadius="@dimen/dp_30" />
|
||||
<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_30" android:topRightRadius="@dimen/dp_30" />
|
||||
<gradient
|
||||
android:endColor="#2A2B38"
|
||||
android:startColor="#3F4057" />
|
||||
</shape>
|
||||
@@ -0,0 +1,210 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/clAuthorizeTopParent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#CC000000">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clLoadingAuthorizeContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_301"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
android:layout_marginRight="@dimen/dp_301"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clAuthorizeLoading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAuthorizeLoading"
|
||||
android:layout_width="@dimen/dp_154"
|
||||
android:layout_height="@dimen/dp_154"
|
||||
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_40"
|
||||
android:text="@string/module_authorize_agreement_loading"
|
||||
android:textColor="#99FFFFFF"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoading" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</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_301"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
android:layout_marginRight="@dimen/dp_301"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
android:background="@drawable/module_authorize_selector_dark_corner"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeLoadingError"
|
||||
android:layout_width="@dimen/dp_400"
|
||||
android:layout_height="@dimen/dp_110"
|
||||
android:layout_marginTop="@dimen/dp_71"
|
||||
android:background="@drawable/module_authorize_selector_blue_corner"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_authorize_agreement_retry"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeLoadingError" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAuthorizeLoadingError"
|
||||
android:layout_width="@dimen/dp_125"
|
||||
android:layout_height="@dimen/dp_125"
|
||||
android:layout_marginTop="@dimen/dp_155"
|
||||
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_29"
|
||||
android:text="@string/module_authorize_agreement_error"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoadingError" />
|
||||
</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_301"
|
||||
android:layout_marginTop="@dimen/dp_110"
|
||||
android:layout_marginRight="@dimen/dp_301"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
android:background="@drawable/module_authorize_selector_dark_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="0px"
|
||||
android:layout_height="@dimen/dp_123"
|
||||
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_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/btnAuthorizeDisAgree" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAuthorizeDisAgree"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="@dimen/dp_123"
|
||||
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_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintLeft_toRightOf="@+id/btnAuthorizeAgree"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="0px"
|
||||
android:layout_height="0px"
|
||||
android:layout_marginBottom="@dimen/dp_139"
|
||||
android:scrollbarSize="@dimen/dp_442"
|
||||
android:layout_marginTop="@dimen/dp_139"
|
||||
android:scrollbarTrackHorizontal="@drawable/module_authorize_scrollbar"
|
||||
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:layout_marginLeft="@dimen/dp_55"
|
||||
android:layout_marginRight="@dimen/dp_55"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:lineSpacingExtra="@dimen/dp_15"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_36" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeButtonContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_36" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAuthorizeLastContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_36" />
|
||||
</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"
|
||||
android:textStyle="bold"
|
||||
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: 11 KiB |
@@ -20,7 +20,7 @@ public class BaseFloatDialog extends Dialog {
|
||||
|
||||
public BaseFloatDialog(@NonNull Context context, int themeResId) {
|
||||
super(context, themeResId);
|
||||
// addFlag();
|
||||
addFlag();
|
||||
}
|
||||
|
||||
private void addFlag() {
|
||||
|
||||
@@ -3,20 +3,13 @@ package com.mogo.module.extensions.entrance;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.text.TextUtils;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
@@ -56,7 +49,6 @@ import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener;
|
||||
import com.mogo.utils.LaunchUtils;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
@@ -64,11 +56,8 @@ import com.mogo.utils.glide.GlideApp;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.roadcondition.service.DelayService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
|
||||
/**
|
||||
@@ -110,7 +99,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
private IMogoRegisterCenter mMogoRegisterCenter;
|
||||
private IMogoAnalytics mAnalytics;
|
||||
private IMogoStatusManager mMogoStatusManager;
|
||||
private EntrancePresenter mEntrancePresenter;
|
||||
private IMogoStatusManager mStatusManager;
|
||||
|
||||
@@ -125,7 +113,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
private ImageView mUserHeadImg;
|
||||
|
||||
|
||||
/**
|
||||
* 搜索莫模块
|
||||
*/
|
||||
@@ -134,56 +121,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
public static boolean isClickShare;
|
||||
|
||||
@DrawableRes
|
||||
private int[] mUploadingFrameRes = {
|
||||
R.drawable.module_ext_ic_uploading_00000,
|
||||
R.drawable.module_ext_ic_uploading_00001,
|
||||
R.drawable.module_ext_ic_uploading_00002,
|
||||
R.drawable.module_ext_ic_uploading_00003,
|
||||
R.drawable.module_ext_ic_uploading_00004,
|
||||
R.drawable.module_ext_ic_uploading_00005,
|
||||
R.drawable.module_ext_ic_uploading_00006,
|
||||
R.drawable.module_ext_ic_uploading_00007,
|
||||
R.drawable.module_ext_ic_uploading_00008,
|
||||
R.drawable.module_ext_ic_uploading_00009,
|
||||
R.drawable.module_ext_ic_uploading_00010,
|
||||
R.drawable.module_ext_ic_uploading_00011,
|
||||
R.drawable.module_ext_ic_uploading_00012,
|
||||
R.drawable.module_ext_ic_uploading_00013,
|
||||
R.drawable.module_ext_ic_uploading_00014,
|
||||
R.drawable.module_ext_ic_uploading_00015,
|
||||
R.drawable.module_ext_ic_uploading_00016,
|
||||
R.drawable.module_ext_ic_uploading_00017,
|
||||
R.drawable.module_ext_ic_uploading_00018,
|
||||
R.drawable.module_ext_ic_uploading_00019,
|
||||
R.drawable.module_ext_ic_uploading_00020,
|
||||
R.drawable.module_ext_ic_uploading_00021,
|
||||
R.drawable.module_ext_ic_uploading_00022,
|
||||
R.drawable.module_ext_ic_uploading_00023,
|
||||
R.drawable.module_ext_ic_uploading_00024,
|
||||
R.drawable.module_ext_ic_uploading_00025,
|
||||
R.drawable.module_ext_ic_uploading_00026,
|
||||
R.drawable.module_ext_ic_uploading_00027,
|
||||
R.drawable.module_ext_ic_uploading_00028,
|
||||
R.drawable.module_ext_ic_uploading_00029,
|
||||
R.drawable.module_ext_ic_uploading_00030,
|
||||
R.drawable.module_ext_ic_uploading_00031,
|
||||
R.drawable.module_ext_ic_uploading_00032,
|
||||
R.drawable.module_ext_ic_uploading_00033,
|
||||
R.drawable.module_ext_ic_uploading_00034,
|
||||
R.drawable.module_ext_ic_uploading_00035,
|
||||
R.drawable.module_ext_ic_uploading_00036,
|
||||
R.drawable.module_ext_ic_uploading_00037,
|
||||
R.drawable.module_ext_ic_uploading_00038,
|
||||
R.drawable.module_ext_ic_uploading_00039,
|
||||
R.drawable.module_ext_ic_uploading_00040
|
||||
};
|
||||
private int mCurrentUploadFrame = 0;
|
||||
private Handler mUploadFrameAnimHandler;
|
||||
public static final int MSG_FRAME_ANIM = 307;
|
||||
public static final int MSG_STOP_ANIM = 308;
|
||||
public static final long TIME_FRAME_INTERVAL_TIME = 80;
|
||||
|
||||
private Rect mDisplayOverviewBounds;
|
||||
|
||||
private boolean toggle = false;
|
||||
@@ -199,16 +136,13 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
}
|
||||
};
|
||||
|
||||
private UploadButtonAnimatorController mUploadButtonAnimatorController;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_ext_layout_entrance;
|
||||
}
|
||||
|
||||
private List< View > demoCache = new ArrayList<>();
|
||||
|
||||
private int[] heights = new int[]{100,200,300};
|
||||
private int currentHeight;
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( getContext() );
|
||||
@@ -222,36 +156,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mUpload = findViewById( R.id.module_entrance_id_upload );
|
||||
mUploading = findViewById( R.id.module_entrance_id_uploading );
|
||||
mUploadRoadCondition.setOnClickListener( view -> {
|
||||
// // todo 测试动画
|
||||
// View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null);
|
||||
// TextView tv = v.findViewById(R.id.tvIndex);
|
||||
// Random random = new Random();
|
||||
// currentHeight = heights[random.nextInt(3)];
|
||||
// tv.setText(demoCache.size()+" height: "+currentHeight + ": " + v);
|
||||
// demoCache.add(v);
|
||||
// ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, currentHeight);
|
||||
// mApis.getTopViewManager().addView(v, params,new IMogoTopViewStatusListener() {
|
||||
// @Override
|
||||
// public void onViewAdded(View view) {
|
||||
// Logger.d(TAG, "onViewAdded: " + view);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onViewRemoved(View view) {
|
||||
// Logger.d(TAG, "onViewRemoved: " + view);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void beforeViewAddAnim(View view) {
|
||||
// Logger.d(TAG, "beforeViewAddAnim: " + view);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void beforeViewRemoveAnim(View view) {
|
||||
// Logger.d(TAG, "beforeViewRemoveAnim: " + view);
|
||||
// }
|
||||
// });
|
||||
// 原始逻辑
|
||||
showShareDialog();
|
||||
} );
|
||||
|
||||
@@ -272,57 +176,18 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mMove2CurrentLocation = findViewById( R.id.module_entrance_id_move2_current_location );
|
||||
mMove2CurrentLocation.setOnClickListener( view -> {
|
||||
// // todo 测试动画
|
||||
// if(!toggle) {
|
||||
// TopViewAnimHelper.getInstance().showNaviView();
|
||||
// }else{
|
||||
// TopViewAnimHelper.getInstance().hideNaviView();
|
||||
// }
|
||||
// toggle = !toggle;
|
||||
// if(demoCache.size()>0) {
|
||||
// View v = demoCache.remove(demoCache.size() - 1);
|
||||
// boolean isViewAdded = mApis.getTopViewManager().isViewAdded(v);
|
||||
// Logger.d(TAG, "isViewAdded===" + isViewAdded);
|
||||
// mApis.getTopViewManager().removeView(v);
|
||||
// }
|
||||
// View v = LayoutInflater.from(getContext()).inflate(R.layout.demo_top, null);
|
||||
// TextView tv = v.findViewById(R.id.tvIndex);
|
||||
// tv.setText("sub view "+demoCache.size()+" height: "+currentHeight + ": " + v);
|
||||
// demoCache.add(v);
|
||||
// mApis.getTopViewManager().addSubView(v,new IMogoTopViewStatusListener() {
|
||||
// @Override
|
||||
// public void onViewAdded(View view) {
|
||||
// Logger.d(TAG, "onSubViewAdded: " + view);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onViewRemoved(View view) {
|
||||
// Logger.d(TAG, "onSubViewRemoved: " + view);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void beforeViewAddAnim(View view) {
|
||||
// Logger.d(TAG, "beforeSubViewAddAnim: " + view);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void beforeViewRemoveAnim(View view) {
|
||||
// Logger.d(TAG, "beforeSubViewRemoveAnim: " + view);
|
||||
// }
|
||||
// });
|
||||
// 原始逻辑
|
||||
final MogoLocation location = mMogoLocationClient.getLastKnowLocation();
|
||||
if ( location != null ) {
|
||||
if ( !mMogoStatusManager.isV2XShow() ) {
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
if ( !mStatusManager.isV2XShow() ) {
|
||||
mStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mMApUIController.setLockZoom( 16 );
|
||||
mMApUIController.changeZoom( 16.0f );
|
||||
}
|
||||
if ( mStatusManager.isDisplayOverview() ) {
|
||||
mMogoStatusManager.setDisplayOverview( TAG, false );
|
||||
mStatusManager.setDisplayOverview( TAG, false );
|
||||
UiThreadHandler.removeCallbacks( mLockCarRunnable );
|
||||
}
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mMApUIController.recoverLockMode();
|
||||
}
|
||||
} );
|
||||
@@ -334,7 +199,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
} );
|
||||
}
|
||||
|
||||
// mNaviInfo = findViewById( R.id.module_entrance_id_navi_info_panel );
|
||||
ConstraintLayout rootView = findViewById( R.id.module_entrance_id_top_motion_layout );
|
||||
if ( rootView != null ) {
|
||||
TopViewAnimHelper.getInstance().init( rootView );
|
||||
@@ -394,10 +258,8 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
}
|
||||
}
|
||||
} );
|
||||
MogoEntranceButtons.save( ButtonIndex.BUTTON1,
|
||||
findViewById( R.id.module_entrance_id_button1 ) );
|
||||
MogoEntranceButtons.save( ButtonIndex.BUTTON2,
|
||||
findViewById( R.id.module_entrance_id_button2 ) );
|
||||
MogoEntranceButtons.save( ButtonIndex.BUTTON1, findViewById( R.id.module_entrance_id_button1 ) );
|
||||
MogoEntranceButtons.save( ButtonIndex.BUTTON2, findViewById( R.id.module_entrance_id_button2 ) );
|
||||
|
||||
mDisplayOverviewBounds = new Rect(
|
||||
ResourcesHelper.getDimensionPixelSize( getContext(),
|
||||
@@ -425,7 +287,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mWeatherIcon = findViewById( R.id.module_ext_id_weather_icon );
|
||||
mWeatherTemp = findViewById( R.id.module_ext_id_weather_temp );
|
||||
|
||||
mUserHeadImg = findViewById(R.id.ivUserHeadImg);
|
||||
mUserHeadImg = findViewById( R.id.ivUserHeadImg );
|
||||
|
||||
mMsgContainer = findViewById( R.id.module_ext_id_msg );
|
||||
|
||||
@@ -433,22 +295,24 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
ARouter.getInstance().build( "/push/ui/message" ).navigation( getContext() );
|
||||
} );
|
||||
mMsgCounter = findViewById( R.id.module_ext_id_msg_counter );
|
||||
mUserHeadImg.setOnClickListener(view ->{
|
||||
mUserHeadImg.setOnClickListener( view -> {
|
||||
// todo 测试代码
|
||||
// mApis.getEventPanelManager().showPanel();
|
||||
// 原始逻辑
|
||||
try {
|
||||
LaunchUtils.launchByPkg(getContext(), "com.zhidao.auto.personal");
|
||||
LaunchUtils.launchByPkg( getContext(), "com.zhidao.auto.personal" );
|
||||
// 埋点
|
||||
final Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", 3);
|
||||
final Map< String, Object > properties = new HashMap<>();
|
||||
properties.put( "type", 3 );
|
||||
ServiceApisManager.serviceApis.getAnalyticsApi().track( "Launcher_APP_Icon", properties );
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, e, "打开个人中心Exception");
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "打开个人中心Exception" );
|
||||
}
|
||||
});
|
||||
} );
|
||||
|
||||
mUserHeadImg.setVisibility(DebugConfig.isLauncher()?View.VISIBLE:View.GONE);
|
||||
mUserHeadImg.setVisibility( DebugConfig.isLauncher() ? View.VISIBLE : View.GONE );
|
||||
|
||||
mUploadButtonAnimatorController = new UploadButtonAnimatorController( mUploading, mUpload, mStatusManager );
|
||||
}
|
||||
|
||||
public void showShareDialog() {
|
||||
@@ -475,7 +339,6 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mMogoLocationClient = mService.getSingletonLocationClient( getContext() );
|
||||
mMogoNavi = mService.getNavi( getContext() );
|
||||
mAnalytics = mApis.getAnalyticsApi();
|
||||
mMogoStatusManager = mApis.getStatusManagerApi();
|
||||
|
||||
mMogoRegisterCenter.registerMogoNaviListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
mMogoRegisterCenter.registerMogoMapListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
@@ -483,9 +346,8 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mMogoMarkerManager = mService.getMarkerManager( getContext() );
|
||||
|
||||
mMogoStatusManager.registerStatusChangedListener( TAG, StatusDescriptor.UPLOADING, this );
|
||||
mMogoStatusManager.registerStatusChangedListener( TAG, StatusDescriptor.DISPLAY_OVERVIEW,
|
||||
this );
|
||||
mStatusManager.registerStatusChangedListener( TAG, StatusDescriptor.UPLOADING, this );
|
||||
mStatusManager.registerStatusChangedListener( TAG, StatusDescriptor.DISPLAY_OVERVIEW, this );
|
||||
|
||||
TopViewAnimHelper.getInstance().setIMogoMapUIController( mMApUIController );
|
||||
}
|
||||
@@ -553,8 +415,8 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mIsLock = isLock;
|
||||
if ( isLock ) {
|
||||
mExitNavi.setText( R.string.module_ext_str_exit_navi );
|
||||
if ( mMogoStatusManager.isDisplayOverview() ) {
|
||||
mMogoStatusManager.setDisplayOverview( TAG, false );
|
||||
if ( mStatusManager.isDisplayOverview() ) {
|
||||
mStatusManager.setDisplayOverview( TAG, false );
|
||||
}
|
||||
} else {
|
||||
mExitNavi.setText( R.string.module_ext_str_continue_navi );
|
||||
@@ -577,16 +439,9 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
if ( isTrue ) {
|
||||
mUploading.setVisibility( View.VISIBLE );
|
||||
mUpload.setVisibility( View.GONE );
|
||||
if ( mUploadFrameAnimHandler != null ) {
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_STOP_ANIM );
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
}
|
||||
doFrameAnimOnUploadButton();
|
||||
mUploadButtonAnimatorController.doFrameAnimOnUploadButton();
|
||||
} else {
|
||||
mCurrentUploadFrame = 0;
|
||||
if ( mUploadFrameAnimHandler != null ) {
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
}
|
||||
mUploadButtonAnimatorController.stopAnimation();
|
||||
mUploading.setVisibility( View.GONE );
|
||||
mUpload.setVisibility( View.VISIBLE );
|
||||
}
|
||||
@@ -609,52 +464,14 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mCameraMode.setVisibility( View.VISIBLE );
|
||||
}
|
||||
}
|
||||
} else if (descriptor == StatusDescriptor.ACC_STATUS) {
|
||||
Log.d(TAG, " onStatusChanged isTrue = " + isTrue);
|
||||
} else if ( descriptor == StatusDescriptor.ACC_STATUS ) {
|
||||
Log.d( TAG, " onStatusChanged isTrue = " + isTrue );
|
||||
if ( isTrue ) {
|
||||
DelayService.Companion.launchService(getContext());
|
||||
DelayService.Companion.launchService( getContext() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doFrameAnimOnUploadButton() {
|
||||
if ( mUploadFrameAnimHandler == null ) {
|
||||
mUploadFrameAnimHandler = new Handler( Looper.getMainLooper() ) {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
super.handleMessage( msg );
|
||||
if ( msg.what == MSG_FRAME_ANIM ) {
|
||||
if ( mUploadingFrameRes == null || mUploadingFrameRes.length == 0 ) {
|
||||
if ( mUploading != null ) {
|
||||
mUploading.setVisibility( View.GONE );
|
||||
}
|
||||
if ( mUpload != null ) {
|
||||
mUpload.setVisibility( View.VISIBLE );
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ( !mMogoStatusManager.isUploading() ) {
|
||||
mCurrentUploadFrame = 0;
|
||||
return;
|
||||
}
|
||||
if ( mUploading != null ) {
|
||||
if ( mCurrentUploadFrame == mUploadingFrameRes.length ) {
|
||||
mCurrentUploadFrame = 12;
|
||||
}
|
||||
mUploading.setImageResource( mUploadingFrameRes[mCurrentUploadFrame++ % mUploadingFrameRes.length] );
|
||||
}
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_FRAME_ANIM,
|
||||
TIME_FRAME_INTERVAL_TIME );
|
||||
} else if ( msg.what == MSG_STOP_ANIM ) {
|
||||
mStatusManager.setUploadingStatus( TAG, false );
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
mUploadFrameAnimHandler.sendEmptyMessage( MSG_FRAME_ANIM );
|
||||
// 30s 后无论成功与否,停止动画
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_STOP_ANIM, 30_000 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderWeatherInfo( String temp, String desc, int iconId ) {
|
||||
@@ -679,10 +496,10 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderUserInfo(UserInfo userInfo) {
|
||||
if(userInfo != null){
|
||||
Logger.d(TAG, "renderUserInfo: " + userInfo);
|
||||
GlideApp.with(getContext()).load(userInfo.getHeadImgurl()).placeholder(R.drawable.model_ext_default_user_head).circleCrop().into(mUserHeadImg);
|
||||
public void renderUserInfo( UserInfo userInfo ) {
|
||||
if ( userInfo != null ) {
|
||||
Logger.d( TAG, "renderUserInfo: " + userInfo );
|
||||
GlideApp.with( getContext() ).load( userInfo.getHeadImgurl() ).placeholder( R.drawable.model_ext_default_user_head ).circleCrop().into( mUserHeadImg );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/7/16
|
||||
*
|
||||
* 上传按钮动画
|
||||
*/
|
||||
class UploadButtonAnimatorController {
|
||||
|
||||
private static final String TAG = "UploadButtonAnimator";
|
||||
|
||||
private ImageView mUploading;
|
||||
private TextView mUpload;
|
||||
private IMogoStatusManager mStatusManager;
|
||||
|
||||
private int mCurrentUploadFrame = 0;
|
||||
public static final int MSG_FRAME_ANIM = 307;
|
||||
public static final int MSG_STOP_ANIM = 308;
|
||||
public static final long TIME_FRAME_INTERVAL_TIME = 80;
|
||||
|
||||
private Handler mUploadFrameAnimHandler = new Handler( Looper.getMainLooper() ) {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
super.handleMessage( msg );
|
||||
if ( msg.what == MSG_FRAME_ANIM ) {
|
||||
if ( mUploadingFrameRes == null || mUploadingFrameRes.length == 0 ) {
|
||||
if ( mUploading != null ) {
|
||||
mUploading.setVisibility( View.GONE );
|
||||
}
|
||||
if ( mUpload != null ) {
|
||||
mUpload.setVisibility( View.VISIBLE );
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ( !mStatusManager.isUploading() ) {
|
||||
mCurrentUploadFrame = 0;
|
||||
return;
|
||||
}
|
||||
if ( mUploading != null ) {
|
||||
if ( mCurrentUploadFrame == mUploadingFrameRes.length ) {
|
||||
mCurrentUploadFrame = 12;
|
||||
}
|
||||
mUploading.setImageResource( mUploadingFrameRes[mCurrentUploadFrame++ % mUploadingFrameRes.length] );
|
||||
}
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_FRAME_ANIM,
|
||||
TIME_FRAME_INTERVAL_TIME );
|
||||
} else if ( msg.what == MSG_STOP_ANIM ) {
|
||||
mStatusManager.setUploadingStatus( TAG, false );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@DrawableRes
|
||||
private int[] mUploadingFrameRes = {
|
||||
R.drawable.module_ext_ic_uploading_00000,
|
||||
R.drawable.module_ext_ic_uploading_00001,
|
||||
R.drawable.module_ext_ic_uploading_00002,
|
||||
R.drawable.module_ext_ic_uploading_00003,
|
||||
R.drawable.module_ext_ic_uploading_00004,
|
||||
R.drawable.module_ext_ic_uploading_00005,
|
||||
R.drawable.module_ext_ic_uploading_00006,
|
||||
R.drawable.module_ext_ic_uploading_00007,
|
||||
R.drawable.module_ext_ic_uploading_00008,
|
||||
R.drawable.module_ext_ic_uploading_00009,
|
||||
R.drawable.module_ext_ic_uploading_00010,
|
||||
R.drawable.module_ext_ic_uploading_00011,
|
||||
R.drawable.module_ext_ic_uploading_00012,
|
||||
R.drawable.module_ext_ic_uploading_00013,
|
||||
R.drawable.module_ext_ic_uploading_00014,
|
||||
R.drawable.module_ext_ic_uploading_00015,
|
||||
R.drawable.module_ext_ic_uploading_00016,
|
||||
R.drawable.module_ext_ic_uploading_00017,
|
||||
R.drawable.module_ext_ic_uploading_00018,
|
||||
R.drawable.module_ext_ic_uploading_00019,
|
||||
R.drawable.module_ext_ic_uploading_00020,
|
||||
R.drawable.module_ext_ic_uploading_00021,
|
||||
R.drawable.module_ext_ic_uploading_00022,
|
||||
R.drawable.module_ext_ic_uploading_00023,
|
||||
R.drawable.module_ext_ic_uploading_00024,
|
||||
R.drawable.module_ext_ic_uploading_00025,
|
||||
R.drawable.module_ext_ic_uploading_00026,
|
||||
R.drawable.module_ext_ic_uploading_00027,
|
||||
R.drawable.module_ext_ic_uploading_00028,
|
||||
R.drawable.module_ext_ic_uploading_00029,
|
||||
R.drawable.module_ext_ic_uploading_00030,
|
||||
R.drawable.module_ext_ic_uploading_00031,
|
||||
R.drawable.module_ext_ic_uploading_00032,
|
||||
R.drawable.module_ext_ic_uploading_00033,
|
||||
R.drawable.module_ext_ic_uploading_00034,
|
||||
R.drawable.module_ext_ic_uploading_00035,
|
||||
R.drawable.module_ext_ic_uploading_00036,
|
||||
R.drawable.module_ext_ic_uploading_00037,
|
||||
R.drawable.module_ext_ic_uploading_00038,
|
||||
R.drawable.module_ext_ic_uploading_00039,
|
||||
R.drawable.module_ext_ic_uploading_00040
|
||||
};
|
||||
|
||||
public UploadButtonAnimatorController( ImageView mUploading, TextView mUpload, IMogoStatusManager mStatusManager ) {
|
||||
this.mUploading = mUploading;
|
||||
this.mUpload = mUpload;
|
||||
this.mStatusManager = mStatusManager;
|
||||
}
|
||||
|
||||
public void doFrameAnimOnUploadButton() {
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_STOP_ANIM );
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
mUploadFrameAnimHandler.sendEmptyMessage( MSG_FRAME_ANIM );
|
||||
// 30s 后无论成功与否,停止动画
|
||||
mUploadFrameAnimHandler.sendEmptyMessageDelayed( MSG_STOP_ANIM, 30_000 );
|
||||
}
|
||||
|
||||
public void stopAnimation() {
|
||||
mCurrentUploadFrame = 0;
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
}
|
||||
}
|
||||
@@ -114,6 +114,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
if ( mServiceApis == null ) {
|
||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
}
|
||||
mServiceApis.getShareManager().resetContext(this);
|
||||
mMogoStatusManager = mServiceApis.getStatusManagerApi();
|
||||
mMogoStatusManager.setMainPageLaunchedStatus( TAG, true );
|
||||
AutopilotServiceManage.getInstance().init( getContext() );
|
||||
|
||||
@@ -55,6 +55,7 @@ import com.mogo.service.module.MogoAction;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -286,6 +287,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.ADAS_UI, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.MAIN_PAGE_RESUME, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.SEEK_HELPING, this );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.ACC_STATUS, this );
|
||||
mStatusManager.setAIAssistReady( TAG, AIAssist.getInstance( mContext ).hasFlush() );
|
||||
|
||||
registerMogoReceiver( context );
|
||||
@@ -723,6 +725,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
refreshStrategy();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -293,6 +293,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
MogoLatLng centerPoint ) {
|
||||
// 将数据同步给在线车辆,避免每次 perform 的时候去拉取,造成消耗
|
||||
if ( onlineCarList == null || onlineCarList.isEmpty() ) {
|
||||
MarkerServiceHandler.getMarkerManager().removeMarkers( ModuleNames.CARD_TYPE_USER_DATA );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -324,9 +325,12 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
String sn = getPrimaryKeyFromEntity( markerOnlineCar );
|
||||
IMogoMarker mogoMarker = existCarMap.get( sn );
|
||||
if ( mogoMarker == null ) {
|
||||
if ( mogoMarker == null || mogoMarker.isDestroyed() ) {
|
||||
mogoMarker = drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_LOW );
|
||||
}
|
||||
if ( mogoMarker != null ) {
|
||||
mogoMarker.setVisible( true );
|
||||
}
|
||||
startSmooth( mogoMarker, markerOnlineCar, markerLocation );
|
||||
}
|
||||
|
||||
@@ -362,9 +366,12 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
String sn = getPrimaryKeyFromEntity( markerExploreWay );
|
||||
IMogoMarker mogoMarker = existCarMap.get( sn );
|
||||
if ( mogoMarker == null ) {
|
||||
if ( mogoMarker == null || mogoMarker.isDestroyed() ) {
|
||||
Logger.d( TAG, "draw road condition, sn = %s", sn );
|
||||
drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
|
||||
mogoMarker = drawMapMarker( markerShowEntity, ServiceConst.MARKER_Z_INDEX_HIGH );
|
||||
}
|
||||
if ( mogoMarker != null ) {
|
||||
mogoMarker.setVisible( true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.module.splash">
|
||||
|
||||
/
|
||||
</manifest>
|
||||
@@ -1,5 +1,3 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.module.splash">
|
||||
|
||||
/
|
||||
</manifest>
|
||||
Reference in New Issue
Block a user