Example #1
0
  @Override
  public void onResume() {
    super.onResume();

    // - Display camera preview.
    displayCameraPreview();

    // - Snack to enable internet if not.
    if (!AndroidUtils.isDataEnabled(getActivity())) {
      AndroidUtils.snackEnableData(getActivity(), getView());
    }
  }
Example #2
0
 @Click(R.id.snapButton)
 protected void onSnapButtonClicked(final View view) {
   // - Analyze bitmap if internet is enabled.
   if (AndroidUtils.isDataEnabled(getActivity())) {
     mSnapButton.setEnabled(false);
     new AnalyzeAndSearchAsyncTask(
             getActivity(),
             mCropper.getActualCropRect(),
             webView,
             analyzeAndSearchAsyncTaskCallBack)
         .execute(mTextureView.getBitmap());
   } else {
     AndroidUtils.snackEnableData(getActivity(), getView());
   }
 }