| | |
| | | package safeluck.drive.evaluation.fragment; |
| | | |
| | | import android.content.Context; |
| | | import android.os.Bundle; |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.EditText; |
| | | import android.widget.TextView; |
| | | |
| | | import com.anyun.exam.lib.MyLog; |
| | | import com.google.gson.Gson; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.Constant; |
| | | import safeluck.drive.evaluation.DB.rtktb.RTKConfigViewModel; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.DB.rtktb.RTKConfig; |
| | | import safeluck.drive.evaluation.cEventCenter.CEventCenter; |
| | | import safeluck.drive.evaluation.cEventCenter.ICEventListener; |
| | | import safeluck.drive.evaluation.viewmodels.RTKConnAndLogin; |
| | | import safeluck.drive.evaluation.viewmodels.RTKConnAndLoginViewModel; |
| | | |
| | | /**FTP配置UI |
| | | * MyApplication2 |
| | |
| | | private static final String TAG = "RTKConfigFragment"; |
| | | |
| | | private EditText et_ip,et_port,et_city_id,et_city_province,et_phone; |
| | | // RTK注册状态、RTK连接状态、 |
| | | private TextView tv_reg,tv_connect,tv_model,tv_sn,tv_imei,tv_login; |
| | | private RTKConfigViewModel rtkConfigViewModel; |
| | | private RTKConfig mRtkConfig; |
| | | |
| | |
| | | et_city_province.setText(String.valueOf(rtkConfig.getProvince())); |
| | | et_port.setText(String.valueOf(rtkConfig.getPort())); |
| | | et_phone.setText(rtkConfig.getPhone()); |
| | | tv_sn.setText(getResources().getString(R.string.rtk_config_sn,rtkConfig.getSn())); |
| | | tv_model.setText(getResources().getString(R.string.rtk_config_model,rtkConfig.getModel())); |
| | | tv_imei.setText(getResources().getString(R.string.rtk_config_imei,rtkConfig.getImei())); |
| | | tv_reg.setText(getResources().getString(R.string.rtk_register_status,rtkConfig.getRegistered())); |
| | | |
| | | } |
| | | }); |
| | | |
| | | |
| | | RTKConnAndLoginViewModel rtkConnAndLoginViewModel = ViewModelProviders.of(this).get(RTKConnAndLoginViewModel.class); |
| | | rtkConnAndLoginViewModel.getRtkConnAndLogin().observe(this, new Observer<RTKConnAndLogin>() { |
| | | @Override |
| | | public void onChanged(RTKConnAndLogin rtkConnAndLogin) { |
| | | MyLog.i(TAG,"平台登录结果及连接状态"+rtkConnAndLogin.toString()); |
| | | tv_connect.setText(getResources().getString(R.string.rtk_connect_status,rtkConnAndLogin.getConnect_status())); |
| | | tv_connect.setText(getResources().getString(R.string.rtk_config_login,rtkConnAndLogin.getLogin_code())); |
| | | } |
| | | }); |
| | | |
| | | return view; |
| | | } |
| | | |
| | |
| | | et_city_province = view.findViewById(R.id.et_provice_id); |
| | | et_phone = view.findViewById(R.id.et_phone); |
| | | et_port = view.findViewById(R.id.rtk_addr_port); |
| | | |
| | | tv_connect = view.findViewById(R.id.tv_rtk_connect);//RTK平台连接状态 |
| | | tv_imei = view.findViewById(R.id.tv_rtk_imei); |
| | | tv_login = view.findViewById(R.id.tv_rtk_login);//RTK平台登录结果 |
| | | tv_model = view.findViewById(R.id.tv_rtk_model); |
| | | tv_reg = view.findViewById(R.id.tv_rtk_reg);//RTK平台注册状态 |
| | | tv_sn = view.findViewById(R.id.tv_rtk_sn); |
| | | } |
| | | |
| | | @Override |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void onAttach(Context context) { |
| | | super.onAttach(context); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onDetach() { |
| | | super.onDetach(); |
| | | } |
| | | } |