Class UISettings<ScanOverlayType extends ScanningOverlay>

  • Direct Known Subclasses:

    public abstract class UISettings<ScanOverlayType extends ScanningOverlay>
    extends java.lang.Object
    Base class for all concrete scan activity settings classes. Activity settings are used to configure available scanning options for the scan activity. All provided activities have their corresponding scan settings classes.
    • Constructor Detail

      • UISettings

        public UISettings()
    • Method Detail

      • getUsingFlagSecure

        public final boolean getUsingFlagSecure()
      • setUsingFlagSecure

        public final void setUsingFlagSecure​(boolean usingFlagSecure)
        Defines whether FLAG_SECURE on activity window, which indicates that the display has a secure video output and supports compositing secure surfaces, should be used. Default is false. Use this to prevent taking screenshots of the activity window content and to prevent content from being viewed on non-secure displays
        usingFlagSecure - true to request using of FLAG_SECURE, false otherwise.
      • getFilterTouchesWhenObscured

        public final boolean getFilterTouchesWhenObscured()
      • setFilterTouchesWhenObscured

        public final void setFilterTouchesWhenObscured​(boolean filterTouchesWhenObscured)
        Defines whether the framework should discard touches when the activity's window is obscured by another visible window. Default is false. Use this to prevent malicious attacks where user could be tricked into tapping on something different from what the user perceives. This is commonly known as tapjacking.
        filterTouchesWhenObscured - true to fully filter out touch events when activites are obscured, false otherwise.
      • getActivityTheme

        public final int getActivityTheme()
      • setActivityTheme

        public final void setActivityTheme​(@StyleRes
                                           int themeId)
        Sets theme that will be used by activity launched from these UiSettings. Defaults to theme set at your app level.
        themeId - custom theme to be used
      • setCameraSettings

        public final void setCameraSettings​(@NonNull
                                            CameraSettings cameraSettings)
        Sets camera settings that will be used for scanning
        cameraSettings - to be used for scanning
      • saveToIntent

        public void saveToIntent​(@NonNull
                                 android.content.Intent intent)
        Saves this scan activity settings to Intent so it can be passed to the corresponding scan activity. Intent target activity must be set before calling this method, and target activity must be compatible with this settings. DO NOT USE THIS METHOD UNLESS YOU KNOW WHAT YOU ARE DOING. Improper usage will crash your app.
        intent - Intent to which this scan activity settings should be saved.
        java.lang.IllegalStateException - If the intent target activity has not been explicitly set before calling this method.
        java.lang.IllegalArgumentException - If the target activity is not compatible with this settings.
      • getTargetActivity

        public abstract java.lang.Class<?> getTargetActivity()
        Returns target activity. Concrete settings can be used only with the corresponding activity. This method is public for convenience when you are not able to use ActivityRunner. DO NOT USE THIS METHOD UNLESS YOU KNOW WHAT YOU ARE DOING. Improper usage will crash your app.
        target activity.
      • createOverlayController

        public abstract ScanOverlayType createOverlayController​(@NonNull
                                                                ScanResultListener scanResultListener)
        Creates overlay controller and configures it using set values.