Packagecom.distriqt.extension.scanner
Classpublic class ActivityOptions
InheritanceActivityOptions Inheritance Object

Scanning UI options for the fullscreen scanner activity



Public Properties
 PropertyDefined By
  cancelLabel : String = Cancel
The label to place on the cancel button.
ActivityOptions
  colour : int = 0x4863A0
The colour code for the background of the interface elements
ActivityOptions
  heading : String
A heading label to display at the top of the scanner interface.
ActivityOptions
  message : String
A message string to display at the top of the scanner interface, below the heading.
ActivityOptions
  overlay : BitmapData = null
This overlay is placed over the top of the camera image directly in the center of the screen.
ActivityOptions
  overlayAutoScale : Boolean = false
This controls how the overlay image data is scaled.
ActivityOptions
  singleResult : Boolean = false
If this option is true then the scanner will automatically stop and close the interface when a code is successfully scanned.
ActivityOptions
  textColour : int = 0xFFFFFF
The colour code for the text elements
ActivityOptions
Public Methods
 MethodDefined By
  
Constructor
ActivityOptions
  
Set the background colour for the ui
ActivityOptions
  
Set the cancel button label
ActivityOptions
  
setHeading(heading:String):ActivityOptions
Set the heading text
ActivityOptions
  
setMessage(message:String):ActivityOptions
Set the message text
ActivityOptions
  
setOverlay(overlay:BitmapData, autoScale:Boolean = false):ActivityOptions
Set an overlay for the camera preview
ActivityOptions
  
setSingleResult(singleResult:Boolean = true):ActivityOptions
Set the single result option
ActivityOptions
  
Set the text colour
ActivityOptions
Property Detail
cancelLabelproperty
public var cancelLabel:String = Cancel

The label to place on the cancel button. If this string is empty ie "" then the cancel button is removed.

colourproperty 
public var colour:int = 0x4863A0

The colour code for the background of the interface elements

headingproperty 
public var heading:String

A heading label to display at the top of the scanner interface.

messageproperty 
public var message:String

A message string to display at the top of the scanner interface, below the heading.

overlayproperty 
public var overlay:BitmapData = null

This overlay is placed over the top of the camera image directly in the center of the screen.

Supported:

overlayAutoScaleproperty 
public var overlayAutoScale:Boolean = false

This controls how the overlay image data is scaled. This is mainly for retina screens where you may want to take advantage of iOS points (rather than pixels).

When this is true an image that is 320x480 or 320x568 on the iPhone5 will fill the entire screen on all iOS devices whether the screen is 320x480 or a retina 640x960. This means that you can provide one image for both retina and non-retina screens. This works really well with pixel perfect images but otherwise we suggest you provide different images for resolutions by disabling this option.

When this is false the image will be displayed at the actual pixel dimensions. You may wish to provide different images for higher resolution screens.

Supported:

singleResultproperty 
public var singleResult:Boolean = false

If this option is true then the scanner will automatically stop and close the interface when a code is successfully scanned.

If false, the interface will remain open until the user clicks the cancel option or the code calls stopScan.

Note: This may return more than one code if true. The scanner processes an entire image or frame at a time so if multiple codes are detected in the one frame this will result in several detected codes. The extension doesn't attempt to place importance on these and simply returns all of them and then closes the scanner.

See also

textColourproperty 
public var textColour:int = 0xFFFFFF

The colour code for the text elements

Constructor Detail
ActivityOptions()Constructor
public function ActivityOptions()

Constructor

Method Detail
setBackgroundColour()method
public function setBackgroundColour(colour:int):ActivityOptions

Set the background colour for the ui

Parameters

colour:int — The colour

Returns
ActivityOptionsActivityOptions instance for chaining calls

See also

setCancelLabel()method 
public function setCancelLabel(label:String):ActivityOptions

Set the cancel button label

Parameters

label:String — The button label

Returns
ActivityOptionsActivityOptions instance for chaining calls

See also

setHeading()method 
public function setHeading(heading:String):ActivityOptions

Set the heading text

Parameters

heading:String — The heading

Returns
ActivityOptionsActivityOptions instance for chaining calls

See also

setMessage()method 
public function setMessage(message:String):ActivityOptions

Set the message text

Parameters

message:String — The message

Returns
ActivityOptionsActivityOptions instance for chaining calls

See also

setOverlay()method 
public function setOverlay(overlay:BitmapData, autoScale:Boolean = false):ActivityOptions

Set an overlay for the camera preview

Parameters

overlay:BitmapData — The bitmap data to use for the camera overlay
 
autoScale:Boolean (default = false) — Whether the overlay should be auto scaled with the native ui

Returns
ActivityOptionsActivityOptions instance for chaining calls

See also

setSingleResult()method 
public function setSingleResult(singleResult:Boolean = true):ActivityOptions

Set the single result option

Parameters

singleResult:Boolean (default = true) — If true the activity will close after one scan result

Returns
ActivityOptionsActivityOptions instance for chaining calls

See also

setTextColour()method 
public function setTextColour(colour:int):ActivityOptions

Set the text colour

Parameters

colour:int — The colour

Returns
ActivityOptionsActivityOptions instance for chaining calls

See also