我正在尝试实现搜索栏,以允许用户选择相机的ISO。我已经在应用程序中找到了搜索栏,但是未显示ISO的读数(从搜索栏的进度中获取)
CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraId);
maxISO = rangeISO.getUpper();
minISO = rangeISO.getLower();
rangeISO = characteristics.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE);
Range<Long> exposureTimeRange = characteristics.get(CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE);
} catch (CameraAccessException e) {
e.printStackTrace();
}
seekBar = findViewById(R.id.ISOSeekBar);
seekBar.setOnSeekBarChangeListener(seekBarChangeListener);
progress = seekBar.getProgress();
ISOText = findViewById(R.id.ISOText);
progress = progress /100;
ISO = minISO + (minISO * progress);
ISOText.setText("ISO: " + ISO);
}
SeekBar.OnSeekBarChangeListener seekBarChangeListener = new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
progress = progress /100;
ISO = minISO + (minISO * progress);
ISOText.setText("ISO: " + ISO);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
};```