[6.2.4]录包工具查看截图弹窗
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="1708dp"
|
||||
android:layout_height="1013dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="1586dp"
|
||||
android:layout_height="@dimen/dp_893"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:cardCornerRadius="@dimen/dp_20"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivScreen"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
/>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivScreenClose"
|
||||
android:layout_width="@dimen/dp_84"
|
||||
android:layout_height="@dimen/dp_86"
|
||||
android:src="@drawable/icon_screen_close"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="@dimen/dp_120"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user