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() {
|
||||
|
||||
Reference in New Issue
Block a user