mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Actually use CheckboxPreference defaults in preferences.xml!
git-svn-id: https://zxing.googlecode.com/svn/trunk@2101 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
f13443cac8
commit
0b58fc05d6
|
@ -159,6 +159,8 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|||
inactivityTimer = new InactivityTimer(this);
|
||||
beepManager = new BeepManager(this);
|
||||
|
||||
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
|
||||
|
||||
showHelpOnFirstLaunch();
|
||||
}
|
||||
|
||||
|
|
|
@ -59,13 +59,13 @@ final class DecodeThread extends Thread {
|
|||
if (decodeFormats == null || decodeFormats.isEmpty()) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
decodeFormats = EnumSet.noneOf(BarcodeFormat.class);
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_1D, true)) {
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_1D, false)) {
|
||||
decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS);
|
||||
}
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_QR, true)) {
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_QR, false)) {
|
||||
decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
|
||||
}
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_DATA_MATRIX, true)) {
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_DATA_MATRIX, false)) {
|
||||
decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue