Class ScanFragmentLegacy

  • All Implemented Interfaces:
    android.content.ComponentCallbacks, android.view.View.OnCreateContextMenuListener, androidx.activity.result.ActivityResultCaller, androidx.lifecycle.HasDefaultViewModelProviderFactory, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner

    @Deprecated
    public class ScanFragmentLegacy
    extends ScanFragment
    Deprecated.
    Implementation of ScanFragment using the legacy Camera API
    • Constructor Summary

      Constructors 
      Constructor Description
      ScanFragmentLegacy()
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.util.List<FlashMode> getAvailableFlashModes()
      Deprecated.
       
      void initializeCamera()
      Deprecated.
      Setup the camera and start the preview.
      boolean isRealTimeBorderDetectionEnabled()
      Deprecated.
       
      void onActivityCreated​(android.os.Bundle savedInstanceState)
      Deprecated.
       
      void onAttach​(android.content.Context context)
      Deprecated.
       
      android.view.View onCreateView​(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
      Deprecated.
       
      void onDestroy()
      Deprecated.
       
      void onPause()
      Deprecated.
       
      void resetBorderDetection()
      Deprecated.
       
      void setAutoTriggerAnimationEnabled​(boolean enabled)
      Deprecated.
       
      void setBorderDetectorListener​(BorderDetector.BorderDetectorListener listener)
      Deprecated.
       
      void setFlashMode​(FlashMode flashMode)
      Deprecated.
      Set the camera flash mode.
      void setFocusIndicator​(FocusIndicator focusIndicator)
      Deprecated.
       
      void setJpegQuality​(int jpegQuality)
      Deprecated.
      Set the JPEG quality of camera output pictures.
      void setOverlayColor​(int color)
      Deprecated.
       
      void setOverlayColorResource​(int colorResId)
      Deprecated.
       
      void setPreviewAspectFill​(boolean isAspectFill)
      Deprecated.
       
      void setPreviewEnabled​(boolean enabled)
      Deprecated.
       
      void setRealTimeDetectionEnabled​(boolean enabled)
      Deprecated.
       
      boolean takePicture​(ImageCaptureCallback callback)
      Deprecated.
       
      boolean takePicture​(ImageCaptureCallback callback, boolean focusBeforeTrigger)
      Deprecated.
      Stop the real-time border detection and capture the image
      FlashMode toggleFlashMode()
      Deprecated.
      Toggle the flash mode to the next available flash mode.
      • Methods inherited from class androidx.fragment.app.Fragment

        dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onSaveInstanceState, onStart, onStop, onViewCreated, onViewStateRestored, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ScanFragmentLegacy

        public ScanFragmentLegacy()
        Deprecated.
    • Method Detail

      • onAttach

        public void onAttach​(@NonNull
                             android.content.Context context)
        Deprecated.
        Overrides:
        onAttach in class androidx.fragment.app.Fragment
      • onCreateView

        public android.view.View onCreateView​(@NonNull
                                              android.view.LayoutInflater inflater,
                                              android.view.ViewGroup container,
                                              android.os.Bundle savedInstanceState)
        Deprecated.
        Overrides:
        onCreateView in class androidx.fragment.app.Fragment
      • onActivityCreated

        public void onActivityCreated​(android.os.Bundle savedInstanceState)
        Deprecated.
        Overrides:
        onActivityCreated in class androidx.fragment.app.Fragment
      • onPause

        public void onPause()
        Deprecated.
        Overrides:
        onPause in class androidx.fragment.app.Fragment
      • onDestroy

        public void onDestroy()
        Deprecated.
        Overrides:
        onDestroy in class androidx.fragment.app.Fragment
      • initializeCamera

        public void initializeCamera()
        Deprecated.
        Description copied from class: ScanFragment
        Setup the camera and start the preview. This needs to be called by the parent activity in Activity#onResume().
        Specified by:
        initializeCamera in class ScanFragment
      • takePicture

        public boolean takePicture​(ImageCaptureCallback callback,
                                   boolean focusBeforeTrigger)
        Deprecated.
        Description copied from class: ScanFragment
        Stop the real-time border detection and capture the image
        Specified by:
        takePicture in class ScanFragment
        Parameters:
        callback - used to notify capture success or failure
        focusBeforeTrigger - if true, an auto-focus will run before the picture is captured. This can be especially useful on devices where the continuous auto-focus is not great to improve the chances of the picture being sharp, but it slows down the capture.
        Returns:
        false if a picture is already being taken, true otherwise
      • setOverlayColor

        public void setOverlayColor​(@ColorInt
                                    int color)
        Deprecated.
        Specified by:
        setOverlayColor in class ScanFragment
      • getAvailableFlashModes

        @NonNull
        public java.util.List<FlashMode> getAvailableFlashModes()
        Deprecated.
        Specified by:
        getAvailableFlashModes in class ScanFragment
        Returns:
        supported flash modes or an empty list if the camera is not yet available
      • toggleFlashMode

        @Nullable
        public FlashMode toggleFlashMode()
        Deprecated.
        Description copied from class: ScanFragment
        Toggle the flash mode to the next available flash mode. It's best to call ScanFragment.getAvailableFlashModes() to make sure that the camera supports this flash mode.
        Specified by:
        toggleFlashMode in class ScanFragment
        Returns:
        the next available flash mode or null if the camera doesn't support flash.
      • setJpegQuality

        public void setJpegQuality​(int jpegQuality)
        Deprecated.
        Description copied from class: ScanFragment
        Set the JPEG quality of camera output pictures. This method can only be called when the camera is ready.
        Specified by:
        setJpegQuality in class ScanFragment
        Parameters:
        jpegQuality - , between 0 and 100