Merge branch 'demo/shunyi_v2v' into demo/shunyi_v2v_merge
# Conflicts: # app/src/main/java/com/mogo/launcher/MogoApplication.java # modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java # modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml # modules/mogo-module-search/build.gradle # services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java # services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
@@ -9,7 +8,7 @@ import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -60,8 +59,10 @@ import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.glide.GlideApp;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.manager.ts.TsThreshold;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -119,6 +120,11 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
private TextView mMsgCounter;
|
||||
|
||||
private ImageView mUserHeadImg;
|
||||
private View thresholdSetContainer;
|
||||
private EditText topEditC, frontLeftEditC, frontRightEditC, backLeftEditC, backRightEditC,
|
||||
bottomEditC;
|
||||
private EditText topEditS, frontLeftEditS, frontRightEditS, backLeftEditS, backRightEditS,
|
||||
bottomEditS;
|
||||
|
||||
/**
|
||||
* 搜索莫模块
|
||||
@@ -313,6 +319,67 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload, mStatusManager);
|
||||
|
||||
debugTopView();
|
||||
debugCrashWarn();
|
||||
}
|
||||
|
||||
private void debugCrashWarn(){
|
||||
thresholdSetContainer = findViewById(R.id.thresholdSetContainer);
|
||||
topEditC = findViewById(R.id.etTopC);
|
||||
frontLeftEditC = findViewById(R.id.etFrontLeftC);
|
||||
backLeftEditC = findViewById(R.id.etBackLeftC);
|
||||
frontRightEditC = findViewById(R.id.etFrontRightC);
|
||||
backRightEditC = findViewById(R.id.etBackRightC);
|
||||
bottomEditC = findViewById(R.id.etBottomC);
|
||||
|
||||
topEditS = findViewById(R.id.etTopS);
|
||||
frontLeftEditS = findViewById(R.id.etFrontLeftS);
|
||||
backLeftEditS = findViewById(R.id.etBackLeftS);
|
||||
frontRightEditS = findViewById(R.id.etFrontRightS);
|
||||
backRightEditS = findViewById(R.id.etBackRightS);
|
||||
bottomEditS = findViewById(R.id.etBottomS);
|
||||
|
||||
findViewById(R.id.btnClose).setOnClickListener(view -> {
|
||||
thresholdSetContainer.setVisibility(View.GONE);
|
||||
mApis.getAdasControllerApi().showADAS();
|
||||
});
|
||||
mUploadRoadCondition.setOnLongClickListener(v -> {
|
||||
mApis.getAdasControllerApi().closeADAS();
|
||||
thresholdSetContainer.setVisibility(View.VISIBLE);
|
||||
TsThreshold threshold = mApis.getCrashWarnProvider().getCurrentCrashThreshold();
|
||||
topEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC5()));
|
||||
topEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS5()));
|
||||
bottomEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC6()));
|
||||
bottomEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS6()));
|
||||
frontLeftEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC4()));
|
||||
frontLeftEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS4()));
|
||||
backLeftEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC3()));
|
||||
backLeftEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS3()));
|
||||
frontRightEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC1()));
|
||||
frontRightEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS1()));
|
||||
backRightEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC2()));
|
||||
backRightEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS2()));
|
||||
return true;
|
||||
});
|
||||
findViewById(R.id.btnSet).setOnClickListener(view -> {
|
||||
// 设置阈值
|
||||
TsThreshold threshold = new TsThreshold(
|
||||
Integer.parseInt(frontRightEditC.getText().toString()),
|
||||
Integer.parseInt(frontRightEditS.getText().toString()),
|
||||
Integer.parseInt(backRightEditC.getText().toString()),
|
||||
Integer.parseInt(backRightEditS.getText().toString()),
|
||||
Integer.parseInt(backLeftEditC.getText().toString()),
|
||||
Integer.parseInt(backLeftEditS.getText().toString()),
|
||||
Integer.parseInt(frontLeftEditC.getText().toString()),
|
||||
Integer.parseInt(frontLeftEditS.getText().toString()),
|
||||
Integer.parseInt(topEditC.getText().toString()),
|
||||
Integer.parseInt(topEditS.getText().toString()),
|
||||
Integer.parseInt(bottomEditC.getText().toString()),
|
||||
Integer.parseInt(bottomEditS.getText().toString())
|
||||
);
|
||||
mApis.getCrashWarnProvider().setCrashThreshold(threshold);
|
||||
thresholdSetContainer.setVisibility(View.GONE);
|
||||
mApis.getAdasControllerApi().showADAS();
|
||||
});
|
||||
}
|
||||
|
||||
public void showShareDialog() {
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/thresholdSetContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#000"
|
||||
android:padding="30dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="前保险杠设置(5)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etTopC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvTop"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTop" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etTopS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvTop"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTop" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFrontLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="左前门设置(4)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tvFrontRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etTopC" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etFrontLeftC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvFrontLeft"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvFrontLeft" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etFrontLeftS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvFrontLeft"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvFrontLeft" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFrontRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:text="右前门设置(1)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tvFrontLeft"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etTopC" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etFrontRightC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvFrontRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvFrontRight" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etFrontRightS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvFrontRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvFrontRight" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBackLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="左后门设置(3)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tvBackRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etFrontRightS" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBackLeftC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvBackLeft"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBackLeft" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBackLeftS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvBackLeft"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBackLeft" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBackRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="右后门设置(2)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tvBackLeft"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etFrontRightS" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBackRightC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvBackRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBackRight" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBackRightS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvBackRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBackRight" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="后保险杠设置(6)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etBackRightS" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBottomC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvBottom"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBottom" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBottomS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvBottom"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBottom" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnClose"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="关闭"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="设置"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -217,4 +217,6 @@
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="btnDebugCtrlNaviView,btnDebugCtrlSubView,btnDebugCtrlTopView,btnDebugAddBottomLayerView" />
|
||||
|
||||
<include layout="@layout/module_ext_layout_crash_threshold_set" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user