public class

SoftSpot

extends Object
java.lang.Object
   ↳ com.datalogic.softspot.SoftSpot

Class Overview

API to configure SoftSpot. All X/Y coordinates are based at the top-left of the screen. The left of the screen is where X is 0, and the top of the screen is where Y is 0.

Summary

Nested Classes
class SoftSpot.Point X/Y screen coordinates. 
class SoftSpot.WorkingArea Constraints defining the frame to restrict SoftSpot's movement. 
Constants
long TIMEOUT_MILLIS API will return the last known value if SoftSpot does not respond before the timeout.
Public Constructors
SoftSpot(Context ctx)
Create an object to communicate with SoftSpot.
Public Methods
void clearCustomImage(ImageEnum imageEnum)
Delete the custom image for the given ImageEnum.
void clearWorkingArea()
Reset the working area to the whole screen.
ImageEnum getImage(ActionType actionType, ImageState imageState)
Get the image in use for the given ActionType and ImageState values.
boolean getLockState()
Get current lock state (can I move it around the screen on finger drag?)
SoftSpot.Point getPosition()
Current X/Y position
SoftSpot.Point getPositionMax()
Maximum X/Y position
Changing scale will change this value.
SoftSpot.Point getPositionMin()
Minimum X/Y position
Changing scale will change this value.
float getScale()
Current scale multiplier
float getScaleMax()
Maximum scale multiplier
float getScaleMin()
Minimum scale multiplier
boolean getVibrator()
Is vibration enabled when using SoftSpot?
SoftSpot.WorkingArea getWorkingArea()
Get Area that SoftSpot can move within
void hide()
Hide SoftSpot.
boolean isEnabled()
When SoftSpot is enabled then it will either be currently showing, or a notification is available to show.
void lock(boolean lockVal)
Set lock state of SoftSpot, it impacts SoftSpot motion ability on finger dragging events.
void setCustomImage(ImageEnum imageEnum, byte[] data)
Copy the image in the byte array, then assigns the custom imageEnum to use that image.
void setCustomImage(ImageEnum imageEnum, File imageFile)
Copy the image located at the given filepath, then assigns the custom imageEnum to use that image.
void setDecodedDuration(DecodedDuration decodedDuration)
Set the duration for how long the decoded image should be displayed on screen after a good read before switching back to the NORMAL image.
void setEnabled(boolean enable)
Set the current enabled state of SoftSpot.
void setImage(ActionType actionType, ImageState imageState, ImageEnum imageEnum)
Set the image to use when SoftSpot has the given ActionType and ImageState values.
void setPosition(SoftSpot.Point point)
Move SoftSpot
void setScale(float scalar)
Set the scale multiplier used for SoftSpot size.
void setVibrator(boolean enable)
Toggle the vibrator on or off when SoftSpot is pressed or moved.
void setWorkingArea(SoftSpot.WorkingArea area)
Restrict SoftSpot to a square region on the screen
void show()
Show SoftSpot.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final long TIMEOUT_MILLIS

Added in revision 1

API will return the last known value if SoftSpot does not respond before the timeout.

Constant Value: 1000 (0x00000000000003e8)

Public Constructors

public SoftSpot (Context ctx)

Added in revision 1

Create an object to communicate with SoftSpot.

Parameters
ctx Required for broadcasting to SoftSpot.

Public Methods

public void clearCustomImage (ImageEnum imageEnum)

Added in revision 15

Delete the custom image for the given ImageEnum.
It's icon will be changed back to the default number icons.

Parameters
imageEnum The slot for the custom image to be deleted. Must be a custom slot.

public void clearWorkingArea ()

Added in revision 15

Reset the working area to the whole screen.

public ImageEnum getImage (ActionType actionType, ImageState imageState)

Added in revision 5

Get the image in use for the given ActionType and ImageState values.

Parameters
actionType The type of action to retreive an image for.
imageState The state of the image to retrieve the image for.

public boolean getLockState ()

Added in revision 5

Get current lock state (can I move it around the screen on finger drag?)

Returns
  • Current lock state of SoftSpot

public SoftSpot.Point getPosition ()

Added in revision 1

Current X/Y position

Returns
  • Current X/Y position of SoftSpot. This is the central point of SoftSpot.

public SoftSpot.Point getPositionMax ()

Added in revision 1

Maximum X/Y position
Changing scale will change this value.

Returns
  • Maximum X/Y coordinates to set as position.

public SoftSpot.Point getPositionMin ()

Added in revision 1

Minimum X/Y position
Changing scale will change this value.

Returns
  • Minimum X/Y coordinates to set as position.

public float getScale ()

Added in revision 1

Current scale multiplier

Returns
  • The current scale multiplier used for SoftSpot size.

public float getScaleMax ()

Added in revision 1

Maximum scale multiplier

Returns
  • The maximum scale multiplier used for SoftSpot size.

public float getScaleMin ()

Added in revision 1

Minimum scale multiplier

Returns
  • The minimum scale multiplier used for SoftSpot size.

public boolean getVibrator ()

Added in revision 15

Is vibration enabled when using SoftSpot?

Returns
  • True if SoftSpot vibration effects are enabled.

public SoftSpot.WorkingArea getWorkingArea ()

Added in revision 15

Get Area that SoftSpot can move within

Returns
  • WorkingArea specifying the area that SoftSpot can move within.

public void hide ()

Added in revision 1

Hide SoftSpot. A notification will be available to show again. If SoftSpot is not enabled, this will have no effect.

public boolean isEnabled ()

Added in revision 1

When SoftSpot is enabled then it will either be currently showing, or a notification is available to show.

Returns
  • True if SoftSpot is currently enabled. Otherwise SoftSpot is disabled.

public void lock (boolean lockVal)

Added in revision 5

Set lock state of SoftSpot, it impacts SoftSpot motion ability on finger dragging events.

Parameters
lockVal Pass in 'true' to keep SoftSpot locked to its current position. Pass in 'false' to allow SoftSpot to be moved around the screen.

public void setCustomImage (ImageEnum imageEnum, byte[] data)

Added in revision 15

Copy the image in the byte array, then assigns the custom imageEnum to use that image.< Image will be downsampled if too large.

Parameters
imageEnum The ImageEnum to set the new image to. Must be a custom slot.
data Byte array containing the image to be copied.
Throws
NullPointerException

public void setCustomImage (ImageEnum imageEnum, File imageFile)

Added in revision 15

Copy the image located at the given filepath, then assigns the custom imageEnum to use that image.< Image will be downsampled if too large.

Parameters
imageEnum The ImageEnum to set the new image to. Must be a custom slot.
imageFile Image in external storage to be copied.
Throws
FileNotFoundException

public void setDecodedDuration (DecodedDuration decodedDuration)

Added in revision 5

Set the duration for how long the decoded image should be displayed on screen after a good read before switching back to the NORMAL image.

Parameters
decodedDuration Enum value representing the number of seconds to display the 'decoded' image for.

public void setEnabled (boolean enable)

Added in revision 1

Set the current enabled state of SoftSpot.

Parameters
enable True to enable SoftSpot, false to disable SoftSpot.

public void setImage (ActionType actionType, ImageState imageState, ImageEnum imageEnum)

Added in revision 5

Set the image to use when SoftSpot has the given ActionType and ImageState values.

Parameters
actionType The type of action to set an image for.
imageState The state of the image for which the image should be set.
imageEnum The image to set as active.

public void setPosition (SoftSpot.Point point)

Added in revision 1

Move SoftSpot

Parameters
point X and Y coordinates to set as the center of SoftSpot.

public void setScale (float scalar)

Added in revision 1

Set the scale multiplier used for SoftSpot size.

Parameters
scalar Scale multiplier to set SoftSpot size. A value that is not between the minimum and maximum will be ignored.

public void setVibrator (boolean enable)

Added in revision 5

Toggle the vibrator on or off when SoftSpot is pressed or moved. Also, vibrate when SoftSpot is used to launch an application.

Parameters
enable set to true to enable vibrator. set to false to disable vibrator.

public void setWorkingArea (SoftSpot.WorkingArea area)

Added in revision 15

Restrict SoftSpot to a square region on the screen

Parameters
area WorkingArea describing how to restrict SoftSpot.

public void show ()

Added in revision 1

Show SoftSpot. If SoftSpot is not enabled, this will have no effect.