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


Java DebugLog类代码示例

本文整理汇总了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 );
    }
}
 
开发者ID:SimonCherryGZ,项目名称:face-landmark-android,代码行数:21,代码来源:CameraConnectionFragment.java

示例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];
    }
}
 
开发者ID:gicheonkang,项目名称:fast_face_android,代码行数:37,代码来源:CameraConnectionFragment.java

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

示例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);
    }
}
 
开发者ID:gicheonkang,项目名称:fast_face_android,代码行数:21,代码来源:CameraConnectionFragment.java

示例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;
    }
}
 
开发者ID:gicheonkang,项目名称:fast_face_android,代码行数:28,代码来源:MainActivity.java

示例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);
    }
}
 
开发者ID:BackPackerDz,项目名称:PotRoom,代码行数:27,代码来源:NameActivity.java

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

示例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);
    }
}
 
开发者ID:hbmartin,项目名称:firebase-chat-android-architecture-components,代码行数:19,代码来源:ProfileActivity.java

示例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;
}
 
开发者ID:kiwiandroiddev,项目名称:starcraft-2-build-player,代码行数:22,代码来源:RaceFragment.java

示例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;
}
 
开发者ID:kiwiandroiddev,项目名称:starcraft-2-build-player,代码行数:19,代码来源:RaceFragment.java

示例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
}
 
开发者ID:kiwiandroiddev,项目名称:starcraft-2-build-player,代码行数:21,代码来源:RaceFragment.java

示例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];
    }
}
 
开发者ID:SimonCherryGZ,项目名称:face-landmark-android,代码行数:37,代码来源:CameraConnectionFragment.java

示例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];
    }
}
 
开发者ID:SimonCherryGZ,项目名称:face-landmark-android,代码行数:26,代码来源:ARMaskFragment.java

示例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();
    }
}
 
开发者ID:SimonCherryGZ,项目名称:face-landmark-android,代码行数:26,代码来源:ARMaskFragment.java

示例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 );
    }
}
 
开发者ID:SimonCherryGZ,项目名称:face-landmark-android,代码行数:18,代码来源:ARMaskFragment.java


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