Search in sources :

Example 1 with OnValueChangeListener

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;
}
Also used : OnValueChangeListener(me.angrybyte.numberpicker.listener.OnValueChangeListener) PreferenceManager(org.havenapp.main.PreferenceManager) View(android.view.View) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

Toolbar (android.support.v7.widget.Toolbar)1 View (android.view.View)1 OnValueChangeListener (me.angrybyte.numberpicker.listener.OnValueChangeListener)1 PreferenceManager (org.havenapp.main.PreferenceManager)1