lizhanwei
2020-05-14 8735b56eefde751618c819f5b331a56a62274a5c
app/src/main/java/safeluck/drive/evaluation/fragment/HomeFragment.java
@@ -1,10 +1,9 @@
package safeluck.drive.evaluation.fragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.Gravity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -14,18 +13,16 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import com.anyun.exam.lib.AYSdk;
import me.yokeyword.fragmentation.ISupportFragment;
import me.yokeyword.fragmentation.SupportFragment;
import safeluck.drive.evaluation.BuildConfig;
import safeluck.drive.evaluation.MainActivity;
import safeluck.drive.evaluation.R;
import safeluck.drive.evaluation.bean.ExamPlatformData;
import safeluck.drive.evaluation.customview.LoadProgressDialog;
import safeluck.drive.evaluation.customview.MyDialog;
/**
@@ -54,6 +51,14 @@
    }
    private void initView(View view) {
        Log.i(TAG,"currTopFragment="+getTopFragment().getClass().getSimpleName());
        if (HomeFragment.class.getSimpleName().equals(getTopFragment().getClass().getSimpleName())){
            ((MainActivity)_mActivity).viewtitle.setVisibility(View.GONE);
            ((MainActivity)_mActivity).btn_return.setVisibility(View.GONE);
        }else{
            ((MainActivity)_mActivity).viewtitle.setVisibility(View.VISIBLE);
            ((MainActivity)_mActivity).btn_return.setVisibility(View.VISIBLE);
        }
        view.findViewById(R.id.network_train).setOnClickListener(this);
        view.findViewById(R.id.car_train).setOnClickListener(this);
        view.findViewById(R.id.system_setting).setOnClickListener(this);
@@ -103,16 +108,23 @@
                break;
            case R.id.exit_sys:
                //退出系统
                AlertDialog.Builder builder = new AlertDialog.Builder(_mActivity);
                builder.setMessage("您将退出系统,请确认数据已保存").setPositiveButton("确定", new DialogInterface.OnClickListener() {
                MyDialog myDialog = MyDialog.Companion.newInstance("您将退出系统,请确认数据已保存");
                myDialog.setOnClick(new MyDialog.MyOnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                    public void onSure() {
                        _mActivity.finish();
                    }
                }).setNegativeButton("取消", (DialogInterface dialog, int which)-> {
                        dialog.dismiss();
                }).show();
                    @Override
                    public void onCancle() {
                    }
                });
                myDialog.show(getFragmentManager(),"mydialog");
                break;
            case R.id.system_setting: