|
|
@ -70,6 +70,7 @@ public class ChannelActivity extends AppCompatActivity {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
binding.btnNightMode.setOnClickListener(new View.OnClickListener() {
|
|
|
|
binding.btnNightMode.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
@ -87,6 +88,7 @@ public class ChannelActivity extends AppCompatActivity {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private View.OnFocusChangeListener onFocusChangeListener = new View.OnFocusChangeListener() {
|
|
|
|
private View.OnFocusChangeListener onFocusChangeListener = new View.OnFocusChangeListener() {
|
|
|
@ -130,7 +132,7 @@ public class ChannelActivity extends AppCompatActivity {
|
|
|
|
|
|
|
|
|
|
|
|
binding.btnAutoExplosure.setChecked(true);
|
|
|
|
binding.btnAutoExplosure.setChecked(true);
|
|
|
|
binding.btnAutoFocus.setChecked(true);
|
|
|
|
binding.btnAutoFocus.setChecked(true);
|
|
|
|
binding.btnHdrMode.setChecked(true);
|
|
|
|
// binding.btnHdrMode.setChecked(true);
|
|
|
|
binding.exposuretime.setText("0");
|
|
|
|
binding.exposuretime.setText("0");
|
|
|
|
binding.sensitivity.setText("0");
|
|
|
|
binding.sensitivity.setText("0");
|
|
|
|
|
|
|
|
|
|
|
@ -146,8 +148,17 @@ public class ChannelActivity extends AppCompatActivity {
|
|
|
|
binding.btnUsbCamera.setChecked(jsonObject.optInt("usbCamera", 0) == 1);
|
|
|
|
binding.btnUsbCamera.setChecked(jsonObject.optInt("usbCamera", 0) == 1);
|
|
|
|
binding.btnAutoExplosure.setChecked(jsonObject.optInt("autoExposure", 1) == 1);
|
|
|
|
binding.btnAutoExplosure.setChecked(jsonObject.optInt("autoExposure", 1) == 1);
|
|
|
|
binding.btnAutoFocus.setChecked(jsonObject.optInt("autoFocus", 1) == 1);
|
|
|
|
binding.btnAutoFocus.setChecked(jsonObject.optInt("autoFocus", 1) == 1);
|
|
|
|
binding.btnHdrMode.setChecked(jsonObject.optInt("hdrMode", 0) == 1);
|
|
|
|
// binding.btnHdrMode.setChecked(jsonObject.optInt("hdrMode", 0) == 1);
|
|
|
|
binding.btnNightMode.setChecked(jsonObject.optInt("nightMode", 0) == 1);
|
|
|
|
// binding.btnNightMode.setChecked(jsonObject.optInt("nightMode", 0) == 1);
|
|
|
|
|
|
|
|
int sceneMode = jsonObject.optInt("sceneMode", 0);
|
|
|
|
|
|
|
|
String sceneModeText = Integer.toString(sceneMode) + " ";
|
|
|
|
|
|
|
|
for (int idx = 0; idx < binding.sceneModes.getCount(); idx++) {
|
|
|
|
|
|
|
|
String text = (String)binding.sceneModes.getItemAtPosition(idx);
|
|
|
|
|
|
|
|
if (text.indexOf(sceneModeText) == 0) {
|
|
|
|
|
|
|
|
binding.sceneModes.setSelection(idx);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
binding.exposuretime.setText(Integer.toString(jsonObject.optInt("exposureTime", 0)));
|
|
|
|
binding.exposuretime.setText(Integer.toString(jsonObject.optInt("exposureTime", 0)));
|
|
|
|
binding.sensitivity.setText(Integer.toString(jsonObject.optInt("sensibility", 0)));
|
|
|
|
binding.sensitivity.setText(Integer.toString(jsonObject.optInt("sensibility", 0)));
|
|
|
|
binding.orientations.setSelection(jsonObject.optInt("orientation", 0));
|
|
|
|
binding.orientations.setSelection(jsonObject.optInt("orientation", 0));
|
|
|
@ -223,8 +234,13 @@ public class ChannelActivity extends AppCompatActivity {
|
|
|
|
jsonObject.put("usbCamera", binding.btnUsbCamera.isChecked() ? 1 : 0);
|
|
|
|
jsonObject.put("usbCamera", binding.btnUsbCamera.isChecked() ? 1 : 0);
|
|
|
|
jsonObject.put("autoExposure", binding.btnAutoExplosure.isChecked() ? 1 : 0);
|
|
|
|
jsonObject.put("autoExposure", binding.btnAutoExplosure.isChecked() ? 1 : 0);
|
|
|
|
jsonObject.put("autoFocus", binding.btnAutoFocus.isChecked() ? 1 : 0);
|
|
|
|
jsonObject.put("autoFocus", binding.btnAutoFocus.isChecked() ? 1 : 0);
|
|
|
|
jsonObject.put("hdrMode", binding.btnHdrMode.isChecked() ? 1 : 0);
|
|
|
|
// jsonObject.put("hdrMode", binding.btnHdrMode.isChecked() ? 1 : 0);
|
|
|
|
jsonObject.put("nightMode", binding.btnNightMode.isChecked() ? 1 : 0);
|
|
|
|
// jsonObject.put("nightMode", binding.btnNightMode.isChecked() ? 1 : 0);
|
|
|
|
|
|
|
|
int sceneMode = 0;
|
|
|
|
|
|
|
|
String sceneModeText = (String)binding.sceneModes.getSelectedItem();
|
|
|
|
|
|
|
|
sceneModeText = sceneModeText.substring(0, sceneModeText.indexOf(" -"));
|
|
|
|
|
|
|
|
sceneMode = Integer.parseInt(sceneModeText);
|
|
|
|
|
|
|
|
jsonObject.put("sceneMode", sceneMode);
|
|
|
|
jsonObject.put("exposureTime", Integer.parseInt(binding.exposuretime.getText().toString()));
|
|
|
|
jsonObject.put("exposureTime", Integer.parseInt(binding.exposuretime.getText().toString()));
|
|
|
|
jsonObject.put("sensibility", Integer.parseInt(binding.sensitivity.getText().toString()));
|
|
|
|
jsonObject.put("sensibility", Integer.parseInt(binding.sensitivity.getText().toString()));
|
|
|
|
jsonObject.put("orientation", binding.orientations.getSelectedItemPosition());
|
|
|
|
jsonObject.put("orientation", binding.orientations.getSelectedItemPosition());
|
|
|
|