diff --git a/core/function-impl/mogo-core-function-devatools/build.gradle b/core/function-impl/mogo-core-function-devatools/build.gradle index dd29601f0e..704be88b02 100644 --- a/core/function-impl/mogo-core-function-devatools/build.gradle +++ b/core/function-impl/mogo-core-function-devatools/build.gradle @@ -80,6 +80,7 @@ dependencies { implementation rootProject.ext.dependencies.androidxroomruntime kapt rootProject.ext.dependencies.androidxroomcompiler implementation rootProject.ext.dependencies.rxandroid + implementation rootProject.ext.dependencies.androidxcardview implementation rootProject.ext.dependencies.androidxroomktx implementation rootProject.ext.dependencies.protobuf_java implementation rootProject.ext.dependencies.androidxappcompat diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/RecordScreenDialog.java b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/RecordScreenDialog.java new file mode 100644 index 0000000000..031fe59d1d --- /dev/null +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/RecordScreenDialog.java @@ -0,0 +1,64 @@ +package com.zhjt.mogo_core_function_devatools.badcase.biz; + +import static com.mogo.eagle.core.utilcode.util.FileUtils.millis2String; +import static com.mogo.eagle.core.utilcode.util.TimeUtils.getMdFormat; + +import android.app.Dialog; +import android.content.Context; +import android.net.Uri; +import android.os.Bundle; +import android.os.Environment; +import android.view.WindowManager; +import android.widget.ImageView; + +import androidx.annotation.NonNull; + +import com.zhjt.mogo_core_function_devatools.R; + +import java.io.File; + +/** + * 录包时鹰眼截图查看对话框 + */ +public class RecordScreenDialog extends Dialog { + + private ImageView ivScreen; //截图展示 + private ImageView ivScreenClose; //关闭按钮 + + private Context mContext; + + public RecordScreenDialog(@NonNull Context context) { + super(context, R.style.bad_case_dialog); + mContext = context; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dialog_record_screen); + WindowManager.LayoutParams params = getWindow().getAttributes(); + params.height = 1013; + params.width = 1708; + getWindow().setAttributes(params);//向WindowManager设置属性 + setCanceledOnTouchOutside(false); + init(); + initEvent(); + } + + private void init(){ + ivScreen = findViewById(R.id.ivScreen); + ivScreenClose = findViewById(R.id.ivScreenClose); + } + + private void initEvent(){ + String imagePath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator+ + "MapScreen" + File.separator+ millis2String(System.currentTimeMillis(),getMdFormat()) + File.separator+"test.png"; + Uri imageUri = Uri.parse(imagePath); + + ivScreen.setImageURI(imageUri); + + //关闭当前弹窗 + ivScreenClose.setOnClickListener(view -> dismiss()); + } + +} diff --git a/core/function-impl/mogo-core-function-devatools/src/main/res/drawable-xhdpi/icon_screen_close.png b/core/function-impl/mogo-core-function-devatools/src/main/res/drawable-xhdpi/icon_screen_close.png new file mode 100644 index 0000000000..1899acac7e Binary files /dev/null and b/core/function-impl/mogo-core-function-devatools/src/main/res/drawable-xhdpi/icon_screen_close.png differ diff --git a/core/function-impl/mogo-core-function-devatools/src/main/res/layout/dialog_record_screen.xml b/core/function-impl/mogo-core-function-devatools/src/main/res/layout/dialog_record_screen.xml new file mode 100644 index 0000000000..a2f20a926d --- /dev/null +++ b/core/function-impl/mogo-core-function-devatools/src/main/res/layout/dialog_record_screen.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/TimeUtils.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/TimeUtils.java index 2ad587de61..e837752e57 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/TimeUtils.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/TimeUtils.java @@ -47,6 +47,10 @@ public final class TimeUtils { return getSafeDateFormat("yyyy-MM-dd HH:mm:ss"); } + public static SimpleDateFormat getMdFormat(){ + return getSafeDateFormat("yyyy-MM-dd"); + } + public static SimpleDateFormat getHourMinSecondFormat(){ return getSafeDateFormat("HH:mm:ss"); }