use of me.angrybyte.numberpicker.listener.OnValueChangeListener in project haven by guardianproject.
the class CameraConfigureActivity method initLayout.
private void initLayout() {
mPrefManager = new PreferenceManager(getApplicationContext());
setContentView(R.layout.activity_camera_configure);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
setTitle("");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mFragment = (CameraFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_camera);
findViewById(R.id.btnCameraSwitch).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switchCamera();
}
});
mNumberTrigger = findViewById(R.id.number_trigger_level);
mNumberTrigger.setValue(mPrefManager.getCameraSensitivity());
mNumberTrigger.setListener(new OnValueChangeListener() {
@Override
public void onValueChanged(int oldValue, int newValue) {
mFragment.setMotionSensitivity(newValue);
mPrefManager.setCameraSensitivity(newValue);
setResult(RESULT_OK);
}
});
mIsInitializedLayout = true;
}
Aggregations