| | |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.Toast; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | |
| | | import com.anyun.exam.lib.AYSdk; |
| | | import com.google.gson.Gson; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.Constant; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.bean.CommonSetting; |
| | | import safeluck.drive.evaluation.bean.SubDecGearSetting; |
| | | import safeluck.drive.evaluation.fragment.rulefragments.cview.TextEditText; |
| | | import safeluck.drive.evaluation.util.Utils; |
| | | import safeluck.drive.evaluation.viewmodels.CommonSettingViewModel; |
| | | import safeluck.drive.evaluation.viewmodels.SubDecGearSettingViewModel; |
| | | |
| | |
| | | private static final String ARG_NUMBER = "arg_number"; |
| | | private static final String TAG = FragmentSetting8.class.getSimpleName(); |
| | | |
| | | |
| | | private Gson gson = new Gson(); |
| | | private int mNumber; |
| | | |
| | | |
| | |
| | | |
| | | te_shift_limit_distance = view.findViewById(R.id.shift_limit_distance); |
| | | te_road_shift_hold_time =view.findViewById(R.id.road_shift_hold_time); |
| | | view.findViewById(R.id.btn_setting_save).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | String teRoadShiftHoldTimeInput = te_road_shift_hold_time.getInput(); |
| | | String teShiftLimitDistanceInput = te_shift_limit_distance.getInput(); |
| | | |
| | | if (mSubGearSetting != null){ |
| | | if (Utils.isDigital(teRoadShiftHoldTimeInput)){ |
| | | mSubGearSetting.setShift_hold_time(Integer.parseInt(teRoadShiftHoldTimeInput)); |
| | | }if (Utils.isDigital(teShiftLimitDistanceInput)){ |
| | | mSubGearSetting.setShift_limit_distance(Integer.parseInt(teShiftLimitDistanceInput)); |
| | | } |
| | | |
| | | subDecGearSettingViewModel.saveSubDecGearSetting(mSubGearSetting); |
| | | AYSdk.getInstance().sendCmd(Constant.ID_judge_args,gson.toJson(mSubGearSetting)); |
| | | Toast.makeText(_mActivity, "加减档设置成功", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private void setDatas() { |