lizhanwei
2020-04-16 26842d764910bd6c214afac58c1332909b022c6e
二维码生成加入安运logo
3个文件已修改
1个文件已添加
37 ■■■■■ 已修改文件
app/src/main/java/safeluck/drive/evaluation/customview/QRCodeDialog.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/drawable/anyunlog.jpg 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/customview/QRCodeDialog.java
@@ -1,6 +1,9 @@
package safeluck.drive.evaluation.customview;
import android.app.Dialog;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
@@ -42,6 +45,9 @@
    private boolean canCancel= true;
    private ImageView iv_qrCode;
    private Button btn;
    private Bitmap qrBitmap;
    private Bitmap logobitmap;
    private Handler handler = new Handler(Looper.getMainLooper()){
        @Override
@@ -57,9 +63,7 @@
        View view = inflater.inflate(R.layout.layout_dialog_qrcode,container,false);
        initView(view);
        setCancelable(canCancel);
        Bundle bundle =getArguments();
        message = bundle.getString("tittle");
        Log.i(TAG,"meesage="+message);
        Message message = Message.obtain();
        message.what = 1;
        handler.sendMessageDelayed(message,15*1000);
@@ -67,7 +71,15 @@
    }
    private void initView(View view) {
        Bundle bundle =getArguments();
        message = bundle.getString("tittle");
        Log.i(TAG,"meesage="+message);
        btn = view.findViewById(R.id.btn_qr_sure);
        iv_qrCode =view.findViewById(R.id.iv_qr_code);
        logobitmap = BitmapFactory.decodeResource(getResources(),R.drawable.anyunlog);
        qrBitmap = QRCodeUtil.createQRCodeBitmap(message,640,640,"UTF-8","H",
                "1", Color.BLACK,Color.WHITE,logobitmap,0.2f,null);
        iv_qrCode.setImageBitmap(qrBitmap);
        btn.setOnClickListener(v -> {
            dismiss();
        });
app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java
@@ -108,12 +108,12 @@
    private FailedProjViewModel failedProjViewModel;
    String icson;//返回的ic卡信息 json
    WokViewModel wokViewModel;
    private List<SimulateNightBean.QuestionBean> tempQs=  new ArrayList<>();
    private List<Integer> btn_ids = new ArrayList<Integer>();
    public static SupportFragment newInstance() {
        return new NetWorkTrainFragment();
    }
    private String content;//用以生成二维码的内容
app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java
@@ -6,6 +6,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import androidx.work.OneTimeWorkRequest;
@@ -59,6 +60,7 @@
import safeluck.drive.evaluation.cEventCenter.ICEventListener;
import safeluck.drive.evaluation.customview.ArrowView;
import safeluck.drive.evaluation.customview.HouseView;
import safeluck.drive.evaluation.customview.LoadProgressDialog;
import safeluck.drive.evaluation.customview.MyDialogFragment;
import safeluck.drive.evaluation.im.MessageProcessor;
import safeluck.drive.evaluation.platformMessage.JKMessage0201;
@@ -106,8 +108,9 @@
    private static final int SPEED_DATA = 2;
    private FailedProjViewModel failedProjViewModel;
    String icson;//返回的ic卡信息 json
    private List<SimulateNightBean.QuestionBean> tempQs=  new ArrayList<>();
    private TableRow tableRow1,tableRow2,tableRow3;
    private String content;//用以生成二维码的内容
    private LoadProgressDialog loadProgressDialog;
private List<Integer> btn_ids = new ArrayList<Integer>();
@@ -544,10 +547,6 @@
        tv_total_score = view.findViewById(R.id.tv_total_score);
        tv_network_time = view.findViewById(R.id.network_time);
        tableRow1 = view.findViewById(R.id.first);
        tableRow2 = view.findViewById(R.id.second);
        tableRow3 = view.findViewById(R.id.third);
        tv_network_time.setText(Utils.getHHmm());
@@ -653,9 +652,9 @@
                break;
            case R.id.iv_head:
                MyLog.i(TAG,"签到,获取身份证物理卡号");
                AYSdk.getInstance().sendCmd(Constant.READ_PHYSICAL_ID,"");
                //TODO 获得物理卡号 发送JKMessage0201给平台,获取姓名、身份证、head_url
                loadProgressDialog = LoadProgressDialog.newInstance("请稍后...");
                loadProgressDialog.setStyle(DialogFragment.STYLE_NORMAL,R.style.Dialog_FullScreen);
                loadProgressDialog.showNow(getFragmentManager(),"loadingdiaolog");
                break;
        }
    }
app/src/main/res/drawable/anyunlog.jpg