Merge branch 'dev' into demo/shunyi_v2v_merge
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
android:name=".AppsListActivity"
|
||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
|
||||
android:launchMode="singleTask"
|
||||
android:resizeableActivity="true"
|
||||
android:resizeableActivity="false"
|
||||
android:resumeWhilePausing="true"
|
||||
android:screenOrientation="landscape"
|
||||
android:stateNotNeeded="true"
|
||||
|
||||
@@ -175,9 +175,9 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
} );
|
||||
|
||||
// 初始化MonitorModule
|
||||
IMogoMonitorProvider monitorProvider = (IMogoMonitorProvider) ARouter.getInstance().build(MogoServicePaths.PATH_MOGO_MONITOR).navigation(this);
|
||||
monitorProvider.resetActivityContext(this);
|
||||
|
||||
// IMogoMonitorProvider monitorProvider = (IMogoMonitorProvider) ARouter.getInstance().build(MogoServicePaths.PATH_MOGO_MONITOR).navigation(this);
|
||||
// monitorProvider.resetActivityContext(this);
|
||||
mServiceApis.getMogoMonitorApi().resetActivityContext(this);
|
||||
}
|
||||
|
||||
private void startBaseService() {
|
||||
|
||||
@@ -48,9 +48,11 @@ public class MogoMonitorProvider implements IMogoMonitorProvider,
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
this.context = context;
|
||||
IMogoServiceApis apis =
|
||||
(IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
|
||||
apis.getSocketManagerApi(context).registerOnMessageListener(MogoMonitorConst.LOG_PUSH_TYPE, this);
|
||||
startRemoteCtrl();
|
||||
}
|
||||
|
||||
private void startRemoteCtrl(){
|
||||
@@ -68,7 +70,6 @@ public class MogoMonitorProvider implements IMogoMonitorProvider,
|
||||
this.context = context;
|
||||
logDebugDialog = new LogDebugDialog(context);
|
||||
logDebugDialog.setDialogListener(this);
|
||||
startRemoteCtrl();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,6 +49,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.androidxcardview
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
@@ -66,7 +67,6 @@ dependencies {
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':modules:mogo-module-gps-simulator')
|
||||
}
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
implementation 'com.zhidaoauto.voice.controller:api:1.0.2'
|
||||
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ class LauncherCardRefresher {
|
||||
|
||||
public static final int MSG_REFRESH = 2020;
|
||||
public static final int MSG_TTS_TIP = 2021;
|
||||
public static final long ONE_MINUTE = 60 * 1000L;
|
||||
public static final long HALF_ONE_MINUTE = 30 * 1000L;
|
||||
public static final long ONE_MINUTE = 15 * 1000L;
|
||||
public static final long ONE_DAY = 24 * 60 * ONE_MINUTE;
|
||||
|
||||
private LauncherCardRefresher( Context context ) {
|
||||
mContext = context;
|
||||
@@ -117,7 +117,7 @@ class LauncherCardRefresher {
|
||||
int counter = SharedPrefsMgr.getInstance( mContext ).getInt( KEY_LauncherCardTipCounter, 0 );
|
||||
if ( counter >= 5 ) {
|
||||
long lastTipTime = SharedPrefsMgr.getInstance( mContext ).getLong( KEY_LauncherCardTipLastTipTime, 0L );
|
||||
if ( System.currentTimeMillis() - lastTipTime < /*10 * 24 * 60 **/ ONE_MINUTE ) {
|
||||
if ( System.currentTimeMillis() - lastTipTime < 10 * ONE_DAY ) {
|
||||
stop();
|
||||
return;
|
||||
} else {
|
||||
@@ -223,14 +223,16 @@ class LauncherCardRefresher {
|
||||
if ( response.getResult().getExploreWay() == null || response.getResult().getExploreWay().isEmpty() ) {
|
||||
return false;
|
||||
}
|
||||
speakTTS( String.format( tts, response.getResult().getExploreWay().size(), mRefreshStrategy.getDesc() ) );
|
||||
notifyLauncherCard( String.format( info, response.getResult().getExploreWay().size(), mRefreshStrategy.getDesc() ) );
|
||||
int size = response.getResult().getExploreWay().size();
|
||||
speakTTS( tts = String.format( tts, size, mRefreshStrategy.getDesc() ) );
|
||||
notifyLauncherCard( String.format( info, size, mRefreshStrategy.getDesc() ), size, tts );
|
||||
} else {
|
||||
if ( response.getResult().getOnlineCar() == null || response.getResult().getOnlineCar().isEmpty() ) {
|
||||
return false;
|
||||
}
|
||||
speakTTS( String.format( tts, response.getResult().getOnlineCar().size(), mRefreshStrategy.getDesc() ) );
|
||||
notifyLauncherCard( String.format( info, response.getResult().getOnlineCar().size(), mRefreshStrategy.getDesc() ) );
|
||||
int size = response.getResult().getOnlineCar().size();
|
||||
speakTTS( tts = String.format( tts, size, mRefreshStrategy.getDesc() ) );
|
||||
notifyLauncherCard( String.format( info, size, mRefreshStrategy.getDesc() ), size , tts);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -243,13 +245,15 @@ class LauncherCardRefresher {
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( msg );
|
||||
}
|
||||
|
||||
private void notifyLauncherCard( String info ) {
|
||||
private void notifyLauncherCard( String info, int amount, String tts ) {
|
||||
Intent intent = new Intent( "com.mogo.launcher.v2x" );
|
||||
intent.putExtra( "v2x_warning_type", 20000 );
|
||||
intent.putExtra( "v2x_warining_timeout", 20 );
|
||||
intent.putExtra( "v2x_warning_tts", "" );
|
||||
intent.putExtra( "v2x_warning_type", "20000" );
|
||||
intent.putExtra( "v2x_warining_timeout", 20 * 1000 );
|
||||
intent.putExtra( "v2x_warning_tts", tts );
|
||||
intent.putExtra( "v2x_warning_eventCount", amount );
|
||||
intent.putExtra( "v2x_warning_info", info );
|
||||
mContext.sendBroadcast( intent );
|
||||
Logger.d( TAG, "发送广播到桌面卡片." );
|
||||
}
|
||||
|
||||
private void playTTS() {
|
||||
|
||||
@@ -42,13 +42,9 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'androidx.appcompat:appcompat:1.0.2'
|
||||
implementation 'androidx.core:core-ktx:1.3.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation rootProject.ext.dependencies.androidxccorektx
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
@@ -42,14 +42,6 @@
|
||||
<category android:name="android.intent.category.HOME" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".receiver.NetWorkReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
|
||||
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
|
||||
<action android:name="android.net.wifi.STATE_CHANGE" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.mogo.module.tanlu.receiver
|
||||
|
||||
import android.Manifest
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.module.tanlu.util.NetworkUtil
|
||||
|
||||
/**
|
||||
* @description 网络改变监听
|
||||
*
|
||||
* @author lixiaopeng
|
||||
* @since 2019-10-17
|
||||
*/
|
||||
class NetWorkReceiver : BroadcastReceiver() {
|
||||
private var isConnect = true
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent?) {
|
||||
if (ContextCompat.checkSelfPermission(
|
||||
context,
|
||||
Manifest.permission.ACCESS_NETWORK_STATE
|
||||
) === PackageManager.PERMISSION_GRANTED
|
||||
) {
|
||||
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
|
||||
isConnect = NetworkUtil.isConnected(context)
|
||||
} else {
|
||||
isConnect = NetworkUtil.isConnectedV21(context)
|
||||
}
|
||||
}
|
||||
|
||||
// if (!isConnect) {
|
||||
// Toast.makeText(context, "网络已断开,请检查网络", Toast.LENGTH_SHORT).show()
|
||||
// //TODO
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -48,7 +48,6 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
if (viewType == V2XShareEventItemEnum.ITEM_TYPE_NUM_DES) {
|
||||
View v = shareLayoutInflater.inflate(R.layout.module_v2x_event_share_description, parent,
|
||||
false);
|
||||
v.getBackground().setAlpha((int) 0.7);
|
||||
shareDescriptionViewHolder holder = new shareDescriptionViewHolder(v);
|
||||
return holder;
|
||||
} else if (viewType == V2XShareEventItemEnum.ITEM_TYPE_SHARE_LIST) {
|
||||
|
||||
@@ -108,7 +108,12 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
|
||||
|
||||
@Override
|
||||
public void onFail(String msg) {
|
||||
if (dataArrayList.size() > 0) {
|
||||
dataArrayList.clear();
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
loadingView.stopWithError(msg, View.VISIBLE);
|
||||
|
||||
loadingView.refresButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -200,7 +205,7 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
|
||||
|
||||
@Override
|
||||
public void onFail(String msg) {
|
||||
loadingView.stopWithError(msg, View.INVISIBLE);
|
||||
loadingView.stopWithError("网络异常,点击刷新重试", View.INVISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -181,8 +181,8 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
|
||||
String originStr = String.format(getContext().getResources().getString(R.string.v2x_surrounding_top_brief), exploreWayList.size());
|
||||
SpannableString spannableString = new SpannableString(originStr);
|
||||
spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#459DFF")), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
//设置字体大小,true表示前面的字体大小20单位为dip
|
||||
spannableString.setSpan(new AbsoluteSizeSpan(38, true), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
//设置字体大小,true表示前面的字体大小 dip
|
||||
spannableString.setSpan(new AbsoluteSizeSpan(46, true), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
spannableString.setSpan(new StyleSpan(Typeface.NORMAL), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
mTotalTv.setText(spannableString);
|
||||
} else {
|
||||
|
||||
@@ -79,22 +79,20 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
|
||||
void onClickRight();
|
||||
}
|
||||
|
||||
private boolean isShown;
|
||||
private WindowManagerView windowManager;
|
||||
|
||||
public void show() {
|
||||
try {
|
||||
Logger.d(TAG, "使用windowManager实现");
|
||||
if (!isShown) {
|
||||
if ( windowManager == null ) {
|
||||
windowManager = new WindowManagerView.Builder(
|
||||
V2XServiceManager.getMogoEntranceButtonController().getButton(ButtonIndex.BUTTON2).getContext()
|
||||
).contentView(this).build();
|
||||
windowManager.show();
|
||||
isShown = true;
|
||||
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("确定要解除求助状态吗");
|
||||
unRegisterVoiceCmd();
|
||||
registerVoiceCmd();
|
||||
}
|
||||
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("确定要解除求助状态吗");
|
||||
unRegisterVoiceCmd();
|
||||
registerVoiceCmd();
|
||||
windowManager.show();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -111,10 +109,10 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
|
||||
};
|
||||
|
||||
public void dismiss() {
|
||||
if (isShown && windowManager != null) {
|
||||
if (windowManager != null) {
|
||||
windowManager.dismiss();
|
||||
isShown = false;
|
||||
}
|
||||
windowManager = null;
|
||||
}
|
||||
|
||||
//放弃求助
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginTop="@dimen/dp_21"
|
||||
android:layout_marginEnd="@dimen/dp_31"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvFaultHelpEventTime"
|
||||
app:layout_constraintEnd_toEndOf="@+id/rlRoadEventList"
|
||||
app:layout_constraintStart_toStartOf="@+id/tagEventType"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tagEventType"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
android:id="@+id/tv_brief"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:gravity="top"
|
||||
android:layout_marginLeft="@dimen/module_v2x_surrounding_margin_left"
|
||||
android:text="周围5公里,共15条交通信息"
|
||||
android:textColor="@color/white"
|
||||
@@ -48,12 +48,12 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/layout_top"
|
||||
android:layout_marginLeft="@dimen/module_v2x_surrounding_root_margin_left"
|
||||
android:layout_marginTop="@dimen/module_v2x_surrounding_empty_tv_margin_top"
|
||||
android:layout_marginRight="@dimen/module_v2x_surrounding_root_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_v2x_surrounding_margin_left">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/surrounding_recycleview"
|
||||
android:layout_marginTop="@dimen/module_v2x_surrounding_empty_tv_margin_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible" />
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20px"
|
||||
android:layout_marginRight="20px"
|
||||
android:layout_marginBottom="16px"
|
||||
android:layout_marginBottom="14px"
|
||||
android:background="@drawable/bg_v2x_event_description"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
<style name="customRatingBarStyle" parent="@style/Widget.AppCompat.RatingBar">
|
||||
<item name="android:minHeight">16px</item>
|
||||
<item name="android:maxHeight">16px</item>
|
||||
<item name="android:maxWidth">19px</item>
|
||||
<item name="android:minWidth">19px</item>
|
||||
<item name="android:spacing">4px</item>
|
||||
<item name="android:maxWidth">20px</item>
|
||||
<item name="android:minWidth">20px</item>
|
||||
<item name="android:numStars">5</item>
|
||||
<item name="android:rating">1</item>
|
||||
<item name="android:stepSize">0.5</item>
|
||||
|
||||
Reference in New Issue
Block a user