本文整理汇总了Java中com.google.zxing.client.android.PreferencesActivity类的典型用法代码示例。如果您正苦于以下问题:Java PreferencesActivity类的具体用法?Java PreferencesActivity怎么用?Java PreferencesActivity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PreferencesActivity类属于com.google.zxing.client.android包,在下文中一共展示了PreferencesActivity类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openDriver
import com.google.zxing.client.android.PreferencesActivity; //导入依赖的package包/类
/**
* Opens the camera driver and initializes the hardware parameters.
*
* @param holder The surface object which the camera will draw preview frames into.
* @throws IOException Indicates the camera driver failed to open.
*/
public void openDriver(SurfaceHolder holder) throws IOException {
if (camera == null) {
camera = Camera.open();
if (camera == null) {
throw new IOException();
}
}
camera.setPreviewDisplay(holder);
if (!initialized) {
initialized = true;
configManager.initFromCameraParameters(camera);
}
configManager.setDesiredCameraParameters(camera);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
reverseImage = prefs.getBoolean(PreferencesActivity.KEY_REVERSE_IMAGE, false);
if (prefs.getBoolean(PreferencesActivity.KEY_FRONT_LIGHT, false)) {
FlashlightManager.enableFlashlight();
}
}
示例2: AutoFocusManager
import com.google.zxing.client.android.PreferencesActivity; //导入依赖的package包/类
AutoFocusManager(Context context, Camera camera) {
this.camera = camera;
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
String currentFocusMode = camera.getParameters().getFocusMode();
useAutoFocus =
sharedPrefs.getBoolean(PreferencesActivity.KEY_AUTO_FOCUS, true) &&
FOCUS_MODES_CALLING_AF.contains(currentFocusMode);
Log.i(TAG, "Current focus mode '" + currentFocusMode + "'; use auto focus? " + useAutoFocus);
start();
}
示例3: parseCustomSearchURL
import com.google.zxing.client.android.PreferencesActivity; //导入依赖的package包/类
private String parseCustomSearchURL() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
String customProductSearch = prefs.getString(PreferencesActivity.KEY_CUSTOM_PRODUCT_SEARCH,
null);
if (customProductSearch != null && customProductSearch.trim().isEmpty()) {
return null;
}
return customProductSearch;
}
示例4: doSetTorch
import com.google.zxing.client.android.PreferencesActivity; //导入依赖的package包/类
private void doSetTorch(Camera.Parameters parameters, boolean newSetting, boolean safeMode) {
CameraConfigurationUtils.setTorch(parameters, newSetting);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (!safeMode && !prefs.getBoolean(PreferencesActivity.KEY_DISABLE_EXPOSURE, true)) {
CameraConfigurationUtils.setBestExposure(parameters, newSetting);
}
}
示例5: addHistoryItem
import com.google.zxing.client.android.PreferencesActivity; //导入依赖的package包/类
public void addHistoryItem(Result result, ResultHandler handler) {
// Do not save this item to the history if the preference is turned off, or the contents are
// considered secure.
if (!activity.getIntent().getBooleanExtra(Intents.Scan.SAVE_HISTORY, true) ||
handler.areContentsSecure() || !enableHistory) {
return;
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
if (!prefs.getBoolean(PreferencesActivity.KEY_REMEMBER_DUPLICATES, false)) {
deletePrevious(result.getText());
}
ContentValues values = new ContentValues();
values.put(DBHelper.TEXT_COL, result.getText());
values.put(DBHelper.FORMAT_COL, result.getBarcodeFormat().toString());
values.put(DBHelper.DISPLAY_COL, handler.getDisplayContents().toString());
values.put(DBHelper.TIMESTAMP_COL, System.currentTimeMillis());
SQLiteOpenHelper helper = new DBHelper(activity);
SQLiteDatabase db = null;
try {
db = helper.getWritableDatabase();
// Insert the new entry into the DB.
db.insert(DBHelper.TABLE_NAME, DBHelper.TIMESTAMP_COL, values);
} finally {
close(null, db);
}
}
示例6: AutoFocusManager
import com.google.zxing.client.android.PreferencesActivity; //导入依赖的package包/类
AutoFocusManager(Context context, Camera camera) {
this.camera = camera;
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
String currentFocusMode = camera.getParameters().getFocusMode();
useAutoFocus = sharedPrefs.getBoolean(PreferencesActivity.KEY_AUTO_FOCUS, true)
&& FOCUS_MODES_CALLING_AF.contains(currentFocusMode);
Log.i(TAG, "Current focus mode '" + currentFocusMode + "'; use auto focus? " + useAutoFocus);
start();
}
示例7: doSetTorch
import com.google.zxing.client.android.PreferencesActivity; //导入依赖的package包/类
private void doSetTorch(Camera.Parameters parameters, boolean newSetting, boolean safeMode) {
CameraConfigurationUtils.setTorch(parameters, newSetting);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (!safeMode && !prefs.getBoolean(PreferencesActivity.KEY_DISABLE_EXPOSURE, true)) {
CameraConfigurationUtils.setBestExposure(parameters, newSetting);
}
}
示例8: parseCustomSearchURL
import com.google.zxing.client.android.PreferencesActivity; //导入依赖的package包/类
private String parseCustomSearchURL() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
String customProductSearch = prefs.getString(PreferencesActivity.KEY_CUSTOM_PRODUCT_SEARCH, null);
if (customProductSearch != null && customProductSearch.trim().isEmpty()) {
return null;
}
return customProductSearch;
}
示例9: addHistoryItem
import com.google.zxing.client.android.PreferencesActivity; //导入依赖的package包/类
public void addHistoryItem(Result result, ResultHandler handler) {
// Do not save this item to the history if the preference is turned off,
// or the contents are
// considered secure.
if (!activity.getIntent().getBooleanExtra(Intents.Scan.SAVE_HISTORY, true) || handler.areContentsSecure()
|| !enableHistory) {
return;
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
if (!prefs.getBoolean(PreferencesActivity.KEY_REMEMBER_DUPLICATES, false)) {
deletePrevious(result.getText());
}
ContentValues values = new ContentValues();
values.put(DBHelper.TEXT_COL, result.getText());
values.put(DBHelper.FORMAT_COL, result.getBarcodeFormat().toString());
values.put(DBHelper.DISPLAY_COL, handler.getDisplayContents().toString());
values.put(DBHelper.TIMESTAMP_COL, System.currentTimeMillis());
SQLiteOpenHelper helper = new DBHelper(activity);
SQLiteDatabase db = null;
try {
db = helper.getWritableDatabase();
// Insert the new entry into the DB.
db.insert(DBHelper.TABLE_NAME, DBHelper.TIMESTAMP_COL, values);
} finally {
close(null, db);
}
}
示例10: AutoFocusManager
import com.google.zxing.client.android.PreferencesActivity; //导入依赖的package包/类
AutoFocusManager(Context context, Camera camera) {
this.camera = camera;
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
String currentFocusMode = camera.getParameters().getFocusMode();
useAutoFocus =
sharedPrefs.getBoolean(PreferencesActivity.KEY_AUTO_FOCUS, true) &&
FOCUS_MODES_CALLING_AF.contains(currentFocusMode);
Log.i(TAG, "Current focus mode '" + currentFocusMode + "'; use auto focus? " + useAutoFocus);
start();
}
示例11: doSetTorch
import com.google.zxing.client.android.PreferencesActivity; //导入依赖的package包/类
private void doSetTorch(Camera.Parameters parameters, boolean newSetting, boolean safeMode) {
CameraConfigurationUtils.setTorch(parameters, newSetting);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (!safeMode && !prefs.getBoolean(PreferencesActivity.KEY_DISABLE_EXPOSURE, true)) {
CameraConfigurationUtils.setBestExposure(parameters, newSetting);
}
}