| | |
| | | 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.CorneringLampSetting; |
| | | 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.CorneringLampSettingViewModel; |
| | | |
| | |
| | | private static final String ARG_NUMBER = "arg_number"; |
| | | private static final String TAG = FragmentSetting6.class.getSimpleName(); |
| | | |
| | | |
| | | private Gson gson = new Gson(); |
| | | private int mNumber; |
| | | |
| | | private TextEditText te_turn_signal_min_advance; |
| | |
| | | |
| | | private void initView(View view) { |
| | | te_turn_signal_min_advance = view.findViewById(R.id.turn_signal_min_advance); |
| | | view.findViewById(R.id.btn_setting_save).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | String teTurnSignalMinAdvanceInput = te_turn_signal_min_advance.getInput(); |
| | | if (mCornerLampSetting != null){ |
| | | if (Utils.isDigital(teTurnSignalMinAdvanceInput)){ |
| | | |
| | | mCornerLampSetting.setTurn_signal_min_advance(Integer.parseInt(teTurnSignalMinAdvanceInput)); |
| | | Toast.makeText(_mActivity, "转向灯设置成功", Toast.LENGTH_SHORT).show(); |
| | | corneringLampSettingViewModel.saveCommonSetting(mCornerLampSetting); |
| | | AYSdk.getInstance().sendCmd(Constant.ID_judge_args,gson.toJson(mCornerLampSetting)); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |