当前位置: 首页>>代码示例>>Java>>正文


Java PreferencesActivity类代码示例

本文整理汇总了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();
  }
}
 
开发者ID:saqimtiaz,项目名称:BibSearch,代码行数:27,代码来源:CameraManager.java

示例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();
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:11,代码来源:AutoFocusManager.java

示例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;
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:10,代码来源:ResultHandler.java

示例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);
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:8,代码来源:CameraConfigurationManager.java

示例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);
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:30,代码来源:HistoryManager.java

示例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();
}
 
开发者ID:xiong-it,项目名称:PortraitZXing,代码行数:10,代码来源:AutoFocusManager.java

示例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);
	}
}
 
开发者ID:xiong-it,项目名称:PortraitZXing,代码行数:8,代码来源:CameraConfigurationManager.java

示例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;
}
 
开发者ID:xiong-it,项目名称:PortraitZXing,代码行数:9,代码来源:ResultHandler.java

示例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);
	}
}
 
开发者ID:xiong-it,项目名称:PortraitZXing,代码行数:31,代码来源:HistoryManager.java

示例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();
}
 
开发者ID:yingLanNull,项目名称:ZxingLite,代码行数:11,代码来源:AutoFocusManager.java

示例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);
    }
}
 
开发者ID:yingLanNull,项目名称:ZxingLite,代码行数:8,代码来源:CameraConfigurationManager.java


注:本文中的com.google.zxing.client.android.PreferencesActivity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。