Class UISettings<ScanOverlayType extends ScanningOverlay>
java.lang.Object
com.microblink.photopay.uisettings.UISettings<ScanOverlayType>
- Direct Known Subclasses:
BasicScanUISettings,FieldByFieldUISettings
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ScanOverlayTypecreateOverlayController(android.app.Activity activity, ScanResultListener scanResultListener) Creates overlay controller and configures it using set values.final intfinal booleanabstract Class<?>Returns target activity.final booleanvoidsaveToIntent(android.content.Intent intent) Saves this scan activity settings toIntentso it can be passed to the corresponding scan activity.final voidsetActivityTheme(int themeId) Sets theme that will be used by activity launched from these UiSettings.final voidsetCameraSettings(CameraSettings cameraSettings) Sets camera settings that will be used for scanningfinal voidsetFilterTouchesWhenObscured(boolean filterTouchesWhenObscured) Defines whether the framework should discard touches when the activity's window is obscured by another visible window.final voidsetUsingFlagSecure(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.
-
Constructor Details
-
UISettings
public UISettings()
-
-
Method Details
-
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 isfalse. Use this to prevent taking screenshots of the activity window content and to prevent content from being viewed on non-secure displays- Parameters:
usingFlagSecure-trueto request using of FLAG_SECURE,falseotherwise.
-
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 isfalse. 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.- Parameters:
filterTouchesWhenObscured-trueto fully filter out touch events when activites are obscured,falseotherwise.
-
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.- Parameters:
themeId- custom theme to be used
-
setCameraSettings
Sets camera settings that will be used for scanning- Parameters:
cameraSettings- to be used for scanning
-
saveToIntent
@CallSuper public void saveToIntent(@NonNull android.content.Intent intent) Saves this scan activity settings toIntentso 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.- Parameters:
intent- Intent to which this scan activity settings should be saved.- Throws:
IllegalStateException- If the intent target activity has not been explicitly set before calling this method.IllegalArgumentException- If the target activity is not compatible with this settings.
-
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 useActivityRunner. DO NOT USE THIS METHOD UNLESS YOU KNOW WHAT YOU ARE DOING. Improper usage will crash your app.- Returns:
- target activity.
-
createOverlayController
@NonNull public abstract ScanOverlayType createOverlayController(@NonNull android.app.Activity activity, @NonNull ScanResultListener scanResultListener) Creates overlay controller and configures it using set values.
-