本文整理匯總了Java中hugo.weaving.DebugLog類的典型用法代碼示例。如果您正苦於以下問題:Java DebugLog類的具體用法?Java DebugLog怎麽用?Java DebugLog使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DebugLog類屬於hugo.weaving包,在下文中一共展示了DebugLog類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: stopBackgroundThread
import hugo.weaving.DebugLog; //導入依賴的package包/類
/**
* Stops the background thread and its {@link Handler}.
*/
@SuppressLint("LongLogTag")
@DebugLog
private void stopBackgroundThread() {
backgroundThread.quitSafely();
inferenceThread.quitSafely();
try {
backgroundThread.join();
backgroundThread = null;
backgroundHandler = null;
inferenceThread.join();
inferenceThread = null;
inferenceThread = null;
} catch (final InterruptedException e) {
Log.e(TAG, "error" ,e );
}
}
示例2: chooseOptimalSize
import hugo.weaving.DebugLog; //導入依賴的package包/類
/**
* Given {@code choices} of {@code Size}s supported by a camera, chooses the smallest one whose
* width and height are at least as large as the respective requested values, and whose aspect
* ratio matches with the specified value.
*
* @param choices The list of sizes that the camera supports for the intended output class
* @param width The minimum desired width
* @param height The minimum desired height
* @param aspectRatio The aspect ratio
* @return The optimal {@code Size}, or an arbitrary one if none were big enough
*/
@SuppressLint("LongLogTag")
@DebugLog
private static Size chooseOptimalSize(
final Size[] choices, final int width, final int height, final Size aspectRatio) {
// Collect the supported resolutions that are at least as big as the preview Surface
final List<Size> bigEnough = new ArrayList<Size>();
for (final Size option : choices) {
if (option.getHeight() >= MINIMUM_PREVIEW_SIZE && option.getWidth() >= MINIMUM_PREVIEW_SIZE) {
Timber.tag(TAG).i("Adding size: " + option.getWidth() + "x" + option.getHeight());
bigEnough.add(option);
} else {
Timber.tag(TAG).i("Not adding size: " + option.getWidth() + "x" + option.getHeight());
}
}
// Pick the smallest of those, assuming we found any
if (bigEnough.size() > 0) {
final Size chosenSize = Collections.min(bigEnough, new CompareSizesByArea());
Timber.tag(TAG).i("Chosen size: " + chosenSize.getWidth() + "x" + chosenSize.getHeight());
return chosenSize;
} else {
Timber.tag(TAG).e("Couldn't find any suitable preview size");
return choices[0];
}
}
示例3: closeCamera
import hugo.weaving.DebugLog; //導入依賴的package包/類
/**
* Closes the current {@link CameraDevice}.
*/
@DebugLog
private void closeCamera() {
try {
cameraOpenCloseLock.acquire();
if (null != captureSession) {
captureSession.close();
captureSession = null;
}
if (null != cameraDevice) {
cameraDevice.close();
cameraDevice = null;
}
if (null != previewReader) {
previewReader.close();
previewReader = null;
}
if (null != mOnGetPreviewListener) {
mOnGetPreviewListener.deInitialize();
}
} catch (final InterruptedException e) {
throw new RuntimeException("Interrupted while trying to lock camera closing.", e);
} finally {
cameraOpenCloseLock.release();
}
}
示例4: stopBackgroundThread
import hugo.weaving.DebugLog; //導入依賴的package包/類
/**
* Stops the background thread and its {@link Handler}.
*/
@SuppressLint("LongLogTag")
@DebugLog
private void stopBackgroundThread() {
backgroundThread.quitSafely();
inferenceThread.quitSafely();
try {
backgroundThread.join();
backgroundThread = null;
backgroundHandler = null;
inferenceThread.join();
inferenceThread = null;
inferenceThread = null;
} catch (final InterruptedException e) {
Timber.tag(TAG).e("error", e);
}
}
示例5: verifyPermissions
import hugo.weaving.DebugLog; //導入依賴的package包/類
/**
* Checks if the app has permission to write to device storage or open camera
* If the app does not has permission then the user will be prompted to grant permissions
*
* @param activity
*/
@DebugLog
private static boolean verifyPermissions(Activity activity) {
// Check if we have write permission
int write_permission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE);
int read_persmission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE);
int camera_permission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.CAMERA);
if (write_permission != PackageManager.PERMISSION_GRANTED ||
read_persmission != PackageManager.PERMISSION_GRANTED ||
camera_permission != PackageManager.PERMISSION_GRANTED) {
// We don't have permission so prompt the user
ActivityCompat.requestPermissions(
activity,
PERMISSIONS_REQ,
REQUEST_CODE_PERMISSION
);
return false;
} else {
return true;
}
}
示例6: selectImage
import hugo.weaving.DebugLog; //導入依賴的package包/類
@DebugLog
@OnClick(R.id.backdrop)
void selectImage() {
int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
Nammu.askForPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE, new PermissionCallback() {
@DebugLog
@Override
public void permissionGranted() {
EasyImage.openGallery(NameActivity.this, 0);
//Nothing, this sample saves to Public gallery so it needs permission
}
@DebugLog
@Override
public void permissionRefused() {
// finish();
}
});
}
else {
EasyImage.openGallery(NameActivity.this, 0);
}
}
示例7: getSupportInfo
import hugo.weaving.DebugLog; //導入依賴的package包/類
@DebugLog
private String getSupportInfo() {
StringBuilder stringBuilder = new StringBuilder();
CoreApplierType[] values = CoreApplierType.values();
if (values != null) {
for (CoreApplierType type : values) {
Applier applier = CoreApplier.getInstance().getApplier(type);
if (applier.isSupport()) {
stringBuilder.append("name:");
stringBuilder.append(type.getName());
stringBuilder.append(" is supported");
stringBuilder.append("\n");
} else {
stringBuilder.append("name:");
stringBuilder.append(type.getName());
stringBuilder.append(" is not supported");
stringBuilder.append("\n");
}
}
}
return stringBuilder.toString();
}
示例8: handleGoogleSignInResult
import hugo.weaving.DebugLog; //導入依賴的package包/類
@DebugLog
void handleGoogleSignInResult(GoogleSignInResult result) {
if (result.isSuccess()) {
// Successful Google sign in, authenticate with Firebase.
GoogleSignInAccount acct = result.getSignInAccount();
firebaseAuthWithGoogle(acct);
} else {
// Unsuccessful Google Sign In, show signed-out UI
Timber.e("Google Sign-In failed.");
Timber.e("status code : " + result.getStatus().getStatusCode());
Timber.e(result.getStatus().getStatusMessage());
String error = "Google Sign-In failed. status code : " +
result.getStatus().getStatusCode() + " . reason: " +
result.getStatus().getStatusMessage();
Toast.makeText(this, error, Toast.LENGTH_SHORT).show();
FirebaseCrash.log(error);
}
}
示例9: onCreate
import hugo.weaving.DebugLog; //導入依賴的package包/類
@DebugLog
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
/** Getting the arguments to the Bundle object */
Bundle data = getArguments();
/** Getting integer data of the key current_page from the bundle */
mFaction = (Faction) data.getSerializable(KEY_FACTION_ENUM);
// passed from racefragmentpageradapter when this is constructed
mCurrentExpansion = (Expansion) data.getSerializable(KEY_EXPANSION_ENUM);
} else {
mFaction = (Faction) savedInstanceState.getSerializable(KEY_FACTION_ENUM);
mCurrentExpansion = (Expansion) savedInstanceState.getSerializable(KEY_EXPANSION_ENUM);
}
mBgDrawable = sIconByRace.containsKey(mFaction) ? sIconByRace.get(mFaction) : R.drawable.not_found;
}
示例10: onCreateView
import hugo.weaving.DebugLog; //導入依賴的package包/類
@DebugLog
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// create a list view to show the builds for this race
// and make clicks on an item start the playback activity for that build
View v = inflater.inflate(R.layout.fragment_race_layout, container, false);
mRecyclerView = (RecyclerView) v.findViewById(R.id.build_list);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setBackgroundDrawable(this.getActivity().getResources().getDrawable(mBgDrawable));
// load list of build order names for this tab's faction and expansion
// use race ID to differentiate the cursor from ones for other tabs
getActivity().getSupportLoaderManager().initLoader(mFaction.ordinal(), null, this);
mRootView = (ViewGroup) v;
return v;
}
示例11: onCreateLoader
import hugo.weaving.DebugLog; //導入依賴的package包/類
/**
* Loads a cursor to the list of build order names in the database for this tab's race
* and expansion.
*/
@DebugLog
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
DbAdapter db = getDb();
db.open();
final String whereClause = DbAdapter.KEY_FACTION_ID + " = " + DbAdapter.getFactionID(mFaction)
+ " and " + DbAdapter.KEY_EXPANSION_ID + " = " + DbAdapter.getExpansionID(mCurrentExpansion);
return new CursorLoader(getActivity(),
Uri.withAppendedPath(BuildOrderProvider.BASE_URI, DbAdapter.TABLE_BUILD_ORDER), // table URI
new String[]{DbAdapter.KEY_BUILD_ORDER_ID, DbAdapter.KEY_NAME, DbAdapter.KEY_CREATED, DbAdapter.KEY_VS_FACTION_ID}, // columns to return
whereClause, // select clause
null, // select args
DbAdapter.KEY_VS_FACTION_ID + ", " + DbAdapter.KEY_NAME + " asc"); // sort order
}
示例12: chooseOptimalSize
import hugo.weaving.DebugLog; //導入依賴的package包/類
/**
* Given {@code choices} of {@code Size}s supported by a camera, chooses the smallest one whose
* width and height are at least as large as the respective requested values, and whose aspect
* ratio matches with the specified value.
*
* @param choices The list of sizes that the camera supports for the intended output class
* @param width The minimum desired width
* @param height The minimum desired height
* @param aspectRatio The aspect ratio
* @return The optimal {@code Size}, or an arbitrary one if none were big enough
*/
@SuppressLint("LongLogTag")
@DebugLog
private static Size chooseOptimalSize(
final Size[] choices, final int width, final int height, final Size aspectRatio) {
// Collect the supported resolutions that are at least as big as the preview Surface
final List<Size> bigEnough = new ArrayList<Size>();
for (final Size option : choices) {
if (option.getHeight() >= MINIMUM_PREVIEW_SIZE && option.getWidth() >= MINIMUM_PREVIEW_SIZE) {
Log.i(TAG, "Adding size: " + option.getWidth() + "x" + option.getHeight());
bigEnough.add(option);
} else {
Log.i(TAG, "Not adding size: " + option.getWidth() + "x" + option.getHeight());
}
}
// Pick the smallest of those, assuming we found any
if (bigEnough.size() > 0) {
final Size chosenSize = Collections.min(bigEnough, new CompareSizesByArea());
Log.i(TAG, "Chosen size: " + chosenSize.getWidth() + "x" + chosenSize.getHeight());
return chosenSize;
} else {
Log.e(TAG, "Couldn't find any suitable preview size");
return choices[0];
}
}
示例13: chooseOptimalSize
import hugo.weaving.DebugLog; //導入依賴的package包/類
@SuppressLint("LongLogTag")
@DebugLog
private static Size chooseOptimalSize(
final Size[] choices, final int width, final int height, final Size aspectRatio) {
// Collect the supported resolutions that are at least as big as the preview Surface
final List<Size> bigEnough = new ArrayList<Size>();
for (final Size option : choices) {
if (option.getHeight() >= MINIMUM_PREVIEW_SIZE && option.getWidth() >= MINIMUM_PREVIEW_SIZE) {
Log.i(TAG, "Adding size: " + option.getWidth() + "x" + option.getHeight());
bigEnough.add(option);
} else {
Log.i(TAG, "Not adding size: " + option.getWidth() + "x" + option.getHeight());
}
}
// Pick the smallest of those, assuming we found any
if (bigEnough.size() > 0) {
final Size chosenSize = Collections.min(bigEnough, new ARMaskFragment.CompareSizesByArea());
Log.i(TAG, "Chosen size: " + chosenSize.getWidth() + "x" + chosenSize.getHeight());
return chosenSize;
} else {
Log.e(TAG, "Couldn't find any suitable preview size");
return choices[0];
}
}
示例14: closeCamera
import hugo.weaving.DebugLog; //導入依賴的package包/類
@DebugLog
private void closeCamera() {
try {
cameraOpenCloseLock.acquire();
if (null != captureSession) {
captureSession.close();
captureSession = null;
}
if (null != cameraDevice) {
cameraDevice.close();
cameraDevice = null;
}
if (null != previewReader) {
previewReader.close();
previewReader = null;
}
if (null != mOnGetPreviewListener) {
mOnGetPreviewListener.deInitialize();
}
} catch (final InterruptedException e) {
throw new RuntimeException("Interrupted while trying to lock camera closing.", e);
} finally {
cameraOpenCloseLock.release();
}
}
示例15: stopBackgroundThread
import hugo.weaving.DebugLog; //導入依賴的package包/類
@SuppressLint("LongLogTag")
@DebugLog
private void stopBackgroundThread() {
backgroundThread.quitSafely();
inferenceThread.quitSafely();
try {
backgroundThread.join();
backgroundThread = null;
backgroundHandler = null;
inferenceThread.join();
inferenceThread = null;
inferenceThread = null;
} catch (final InterruptedException e) {
Log.e(TAG, "error" ,e );
}
}