| | |
| | | import android.view.ViewGroup; |
| | | |
| | | import androidx.annotation.Nullable; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | 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.viewmodels.CommonSettingViewModel; |
| | | import safeluck.drive.evaluation.viewmodels.CorneringLampSettingViewModel; |
| | | |
| | | /** |
| | | * DriveJudge |
| | |
| | | |
| | | |
| | | private int mNumber; |
| | | |
| | | private TextEditText te_turn_signal_min_advance; |
| | | private CorneringLampSetting mCornerLampSetting; |
| | | private CorneringLampSettingViewModel corneringLampSettingViewModel; |
| | | |
| | | public static FragmentSetting6 newInstance(String number) { |
| | | FragmentSetting6 fragment = new FragmentSetting6(); |
| | |
| | | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View view = inflater.inflate(R.layout.layout_fragment_setlights, container, false); |
| | | initView(view); |
| | | corneringLampSettingViewModel = ViewModelProviders.of(this).get(CorneringLampSettingViewModel.class); |
| | | corneringLampSettingViewModel.getCorneringLampSetting().observe(this, new Observer<CorneringLampSetting>() { |
| | | @Override |
| | | public void onChanged(CorneringLampSetting commonSetting) { |
| | | if (commonSetting != null){ |
| | | mCornerLampSetting = commonSetting; |
| | | setDatas(); |
| | | } |
| | | } |
| | | }); |
| | | return view; |
| | | } |
| | | |
| | | private void initView(View view) { |
| | | |
| | | te_turn_signal_min_advance = view.findViewById(R.id.turn_signal_min_advance); |
| | | |
| | | } |
| | | |
| | | private void setDatas() { |
| | | te_turn_signal_min_advance.setInput(String.valueOf(mCornerLampSetting.getTurn_signal_min_advance())); |
| | | } |
| | | } |