public class SoftSpot
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SoftSpot.Point
X/Y screen coordinates.
|
static class |
SoftSpot.WorkingArea
Constraints defining the frame to restrict SoftSpot's movement.
|
| Modifier and Type | Field and Description |
|---|---|
static long |
TIMEOUT_MILLIS
API will return the last known value if SoftSpot does not respond before
the timeout.
|
| Constructor and Description |
|---|
SoftSpot(android.content.Context ctx)
Create an object to communicate with SoftSpot.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearCustomImage(ImageEnum imageEnum)
Delete the custom image for the given ImageEnum.
It's icon will be changed back to the default number icons. |
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,
java.io.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
ImageState.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.
|
public static final long TIMEOUT_MILLIS
public SoftSpot(android.content.Context ctx)
ctx - Required for broadcasting to SoftSpot.public SoftSpot.Point getPositionMin()
public SoftSpot.Point getPositionMax()
public SoftSpot.WorkingArea getWorkingArea()
public void setWorkingArea(SoftSpot.WorkingArea area)
area - WorkingArea describing how to restrict SoftSpot.public void clearWorkingArea()
public SoftSpot.Point getPosition()
public void setPosition(SoftSpot.Point point)
point - X and Y coordinates to set as the center of SoftSpot.public float getScaleMin()
public float getScaleMax()
public float getScale()
public void setScale(float scalar)
scalar - Scale multiplier to set SoftSpot size. A value that is not
between the minimum and maximum will be ignored.public boolean getLockState()
public void lock(boolean lockVal)
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 hide()
public void show()
public boolean isEnabled()
public void setEnabled(boolean enable)
enable - True to enable SoftSpot, false to disable SoftSpot.public ImageEnum getImage(ActionType actionType, ImageState imageState)
actionType - The type of action to retreive an image for.imageState - The state of the image to retrieve the image for.public void setImage(ActionType actionType, ImageState imageState, ImageEnum imageEnum)
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 setCustomImage(ImageEnum imageEnum, java.io.File imageFile) throws java.io.FileNotFoundException
imageEnum - The ImageEnum to set the new image to. Must be a custom slot.imageFile - Image in external storage to be copied.java.io.FileNotFoundExceptionpublic void setCustomImage(ImageEnum imageEnum, byte[] data) throws java.lang.NullPointerException
imageEnum - The ImageEnum to set the new image to. Must be a custom slot.data - Byte array containing the image to be copied.java.lang.NullPointerExceptionpublic void clearCustomImage(ImageEnum imageEnum)
imageEnum - The slot for the custom image to be deleted. Must be a custom slot.public void setDecodedDuration(DecodedDuration decodedDuration)
ImageState.NORMAL image.decodedDuration - Enum value representing the number of seconds to display
the 'decoded' image for.public void setVibrator(boolean enable)
enable - set to true to enable vibrator. set to false to disable vibrator.public boolean getVibrator()