这是我到目前为止所做的。
seekbarZoom = findViewById(R.id.vertical_Seekbar);
seekbarZoom.setOnSeekBarChangeListener(new
SeekBar.OnSeekBarChangeListener(){
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
Log.d(TAG, "progress:"+progress);
onZoomClick2(seekBar);
// YOur code here in set zoom for pinch zooming, sth like this
if(mStreamerGL.getCameraParameters().isZoomSupported()){
Camera.Parameters params = mStreamerGL.getCameraParameters();
seekbarZoom.setMax(params.getMaxZoom());
params.setZoom(progress);
mStreamerGL.setCameraParameters(params);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
Log.d(TAG, "onStartTrackingTouch");
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
Log.d(TAG, "onStartTrackingTouch");
}
});
它仅适用于低级API手机。我需要使用搜索栏控制camera2 API缩放。