| | |
| | | package com.basic.security.fragment; |
| | | |
| | | import android.content.Intent; |
| | | import android.media.MediaPlayer; |
| | | import android.text.TextUtils; |
| | | import android.view.View; |
| | |
| | | |
| | | @ViewById |
| | | public EditText ip; |
| | | @ViewById |
| | | public EditText title; |
| | | @ViewById |
| | | public EditText port; |
| | | @ViewById |
| | |
| | | public void show() { |
| | | saved = false; |
| | | initData(SettingManager.getIpStr(), SettingManager.getSecondStr(), |
| | | SettingManager.getAlarmAudioStr(), SettingManager.getPortStr(), SettingManager.getKeepTime(), SettingManager.getKeepTimeType()); |
| | | SettingManager.getAlarmAudioStr(), SettingManager.getPortStr(), SettingManager.getKeepTime(), SettingManager.getKeepTimeType(), SettingManager.getAppTitle()); |
| | | } |
| | | |
| | | @UiThread |
| | | public void initData(String ipStr, String secondStr, String alarmAudioStr, String portStr, String keepTimeStr, String keepTimeTypeStr) { |
| | | public void initData(String ipStr, String secondStr, String alarmAudioStr, String portStr, String keepTimeStr, String keepTimeTypeStr, String appTitle) { |
| | | if (second != null) { |
| | | second.setSelection(getSelectedIndex(secondArray, secondStr)); |
| | | } |
| | |
| | | } |
| | | if (portStr != null) { |
| | | port.setText(portStr); |
| | | } |
| | | if (appTitle != null) { |
| | | title.setText(appTitle); |
| | | } |
| | | oldPassword.setText(""); |
| | | newPassword.setText(""); |
| | |
| | | return false; |
| | | } |
| | | |
| | | private boolean validateDate() {// 验证输入的信息是否正确 |
| | | private boolean validateDate() { |
| | | String ip = ip_address.getText().toString(); |
| | | if (ip.equals("") || !ipCheck(ip)) { |
| | | ip_address.setFocusable(true); |
| | |
| | | String keepTimeTypeStr = keepTimeType.getSelectedItem().toString(); |
| | | String ipStr = ip.getText().toString().trim(); |
| | | String portStr = port.getText().toString().trim(); |
| | | String appTitle = title.getText().toString().trim(); |
| | | String oldPasswordStr = oldPassword.getText().toString().trim(); |
| | | String newPasswordStr = newPassword.getText().toString().trim(); |
| | | String newPassword2Str = newPassword2.getText().toString().trim(); |
| | |
| | | setting.put(Setting.ip, ipStr); |
| | | setting.put(Setting.second, secondStr); |
| | | setting.put(Setting.port, portStr); |
| | | setting.put(Setting.appTitle, appTitle); |
| | | setting.put(Setting.password, password); |
| | | setting.put(Setting.keepTime, keepTimeStr); |
| | | setting.put(Setting.keepTimeType, keepTimeTypeStr); |
| | |
| | | HomePlayAlarmSound.shouldRestartSound = true; |
| | | SocketClient.needRestart = true; |
| | | } |
| | | // try { |
| | | // if (Constants.NativeLib) { |
| | | // refreshAddrInfo(mLztek.getEthEnable()); |
| | | // } |
| | | // } catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // } |
| | | } |
| | | |
| | | @Click |
| | |
| | | android.os.Process.killProcess(android.os.Process.myPid()); |
| | | System.exit(0); |
| | | } |
| | | |
| | | @Click |
| | | public void open_system_setting() { |
| | | startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0); |
| | | } |
| | | } |