本文整理汇总了Java中se.embargo.core.databinding.PreferenceProperties类的典型用法代码示例。如果您正苦于以下问题:Java PreferenceProperties类的具体用法?Java PreferenceProperties怎么用?Java PreferenceProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PreferenceProperties类属于se.embargo.core.databinding包,在下文中一共展示了PreferenceProperties类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClick
import se.embargo.core.databinding.PreferenceProperties; //导入依赖的package包/类
@Override
public void onClick() {
CameraHandle handle = _cameraHandle.getValue();
if (handle != null) {
Camera.Parameters params = handle.camera.getParameters();
SeekBarDialog dialog = new SeekBarDialog(MainActivity.this,
PreferenceProperties.integer(Pictures.PREF_EXPOSURE + "_" + handle.id, 0).observe(_prefs),
params.getExposureCompensationStep(),
params.getMinExposureCompensation(),
params.getMaxExposureCompensation());
_detailedPreferences.setVisibility(View.GONE);
dialog.setOnDismissListener(this);
dialog.show();
}
}
示例2: onCreate
import se.embargo.core.databinding.PreferenceProperties; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
_prefs = getSharedPreferences(SettingsActivity.PREFS_NAMESPACE, MODE_PRIVATE);
Intent args = new Intent(this, CallService.class);
args.putExtra(CallService.EXTRA_EVENT, CallService.EXTRA_STATE_BOOT);
startService(args);
setContentView(R.layout.main_activity);
Fragment fragment = Fragment.instantiate(this, PhonecallListFragment.class.getName());
getFragmentManager().beginTransaction().replace(R.id.fragment, fragment).commit();
View unsupportedLayout = findViewById(R.id.recordingUnsupportedLayout);
_binding.bindValue(
WidgetProperties.visible().observe(unsupportedLayout),
new ObservableValueAdapter<Boolean, Integer>(PreferenceProperties.bool(
SettingsActivity.PREF_RECORDING_SUPPORTED, SettingsActivity.PREF_RECORDING_SUPPORTED_DEFAULT).observe(_prefs)) {
@Override
public Integer getValue() {
return _object.getValue() ? View.GONE : View.VISIBLE;
}
@Override
public void setValue(Integer value) {}
});
}
示例3: onCreate
import se.embargo.core.databinding.PreferenceProperties; //导入依赖的package包/类
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
_prefs = getSharedPreferences(PREFS_NAMESPACE, MODE_PRIVATE);
_baseline = PreferenceProperties.floating(PREF_BASELINE, PREF_BASELINE_DEFAULT).observe(_prefs);
_autofocus = PreferenceProperties.bool(PREF_AUTOFOCUS, PREF_AUTOFOCUS_DEFAULT).observe(_prefs);
_autofocusvalue = PreferenceProperties.floating(PREF_AUTOFOCUS_VALUE, PREF_BASELINE_DEFAULT).observe(_prefs);
_autofocusvalue.addChangeListener(new IChangeListener<Float>() {
@Override
public void handleChange(final ChangeEvent<Float> event) {
if (_autofocus.getValue()) {
_baseline.setValue(event.getValue());
}
}
});
// Keep screen on while this activity is focused
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
// Switch to full screen
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
// Force switch to landscape orientation
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setContentView(R.layout.main_activity);
_sonogram = (SonogramSurface)findViewById(R.id.sonogramSurface);
_sonar = null;
if (Intent.ACTION_VIEW.equals(getIntent().getAction())) {
Uri url = getIntent().getData();
//Uri url = Uri.parse("file:///storage/emulated/0/Pictures/Sonar/IMGS0048.sonar");
if (url != null) {
Log.i(TAG, "Opening sonar dump: " + url);
_sonar = new StreamReader(url.getPath());
}
}
if (_sonar == null) {
_sonar = new Sonar(this, _autofocusvalue);
}
_prefsListener.onSharedPreferenceChanged(_prefs, PREF_VISUALIZATION);
// Connect the recording mode button
{
final ImageButton cameraModeButton = (ImageButton)findViewById(R.id.cameraModeButton);
cameraModeButton.setOnClickListener(new CameraModeButtonListener());
_cameraState.addChangeListener(new RecordStateListener());
_cameraState.setValue(_cameraState.getValue());
}
// Connect the focus button
{
final ImageButton focusButton = (ImageButton)findViewById(R.id.focusButton);
focusButton.setOnClickListener(new FocusButtonListener());
}
// Connect the visualization button
{
final ImageButton button = (ImageButton)findViewById(R.id.visualizationButton);
button.setOnClickListener(new ListPreferenceDialog(
this, _prefs, PREF_VISUALIZATION, getResources().getString(R.string.pref_visualization_default),
R.string.menu_option_visualization, R.array.pref_visualization_labels, R.array.pref_visualization_values));
}
}