public class FITAWebWidget
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isLoading |
protected FITAWebWidgetHandler |
mHandler |
protected android.webkit.WebView |
mView |
static java.lang.String |
widgetContainerURL |
| Constructor and Description |
|---|
FITAWebWidget(android.webkit.WebView view,
FITAWebWidgetHandler handler) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the widget.
|
void |
create(java.lang.String productSerial)
Create the widget with a product serial.
|
void |
create(java.lang.String productSerial,
org.json.JSONObject options)
Create the widget with a product serial and widget options as JSONObject.
|
void |
create(java.lang.String productSerial,
WidgetOptions options)
Create the widget with a product serial and widget options.
|
void |
createAndSendAction(java.lang.String action,
org.json.JSONArray arguments) |
boolean |
load()
Begin loading the HTML widget container page.
|
void |
onContainerLoadError(java.lang.String description) |
void |
open(java.lang.String productSerial)
Open the widget with a new product serial.
|
void |
open(java.lang.String productSerial,
org.json.JSONObject options)
Open the widget with a new product serial and/or widget object (as JSONObejct).
|
void |
open(java.lang.String productSerial,
WidgetOptions options)
Show the actual widget.
|
void |
processMessage(java.lang.String encodedMessage) |
void |
receiveMessage(java.lang.String message) |
void |
recommend(java.lang.String productSerial)
Request a recommendation with productSerial.
|
void |
recommend(java.lang.String productSerial,
org.json.JSONObject options)
Request a recommendation with productSerial and widget options (as JSONObject).
|
void |
recommend(java.lang.String productSerial,
WidgetOptions options)
Request a recommendation with productSerial and widget options.
|
void |
reconfigure(java.lang.String productSerial)
Reconfigure the widget with a new product serial.
|
void |
reconfigure(java.lang.String productSerial,
org.json.JSONObject options)
Reconfigure the widget with the new product serial and/or widget options object (as JSONObject).
|
void |
reconfigure(java.lang.String productSerial,
WidgetOptions options)
Reconfigure the widget with the new product serial and/or widget options object.
|
protected void |
sendMessage(org.json.JSONObject message) |
public static java.lang.String widgetContainerURL
protected android.webkit.WebView mView
protected FITAWebWidgetHandler mHandler
protected boolean isLoading
public FITAWebWidget(android.webkit.WebView view,
FITAWebWidgetHandler handler)
public boolean load()
public void create(java.lang.String productSerial,
WidgetOptions options)
productSerial - (nullable) The serial ID of the product to load at beginning. When `null` no product will be loaded.options - Initial set of options for the widget as WidgetOptions object.public void create(java.lang.String productSerial)
productSerial - (nullable) The serial ID of the product to load at beginning. When `null` no product will be loaded.public void create(java.lang.String productSerial,
org.json.JSONObject options)
productSerial - (nullable) The serial ID of the product to load at beginning. When `null` no product will be loaded.options - Initial set of options for the widget as JSONObject object.public void open(java.lang.String productSerial,
WidgetOptions options)
productSerial - (nullable) The new product serialoptions - Additional widget options as WidgetOptionspublic void open(java.lang.String productSerial)
productSerial - (nullable) the new product serialpublic void open(java.lang.String productSerial,
org.json.JSONObject options)
productSerial - (nullable) the new product serialoptions - Additional widget options as JSONObjectpublic void reconfigure(java.lang.String productSerial,
WidgetOptions options)
productSerial - (nullable) the new product serialoptions - widget options as WidgetOptionspublic void reconfigure(java.lang.String productSerial)
productSerial - (nullable) the new product serialpublic void reconfigure(java.lang.String productSerial,
org.json.JSONObject options)
productSerial - (nullable) the new product serialoptions - widget options as JSONObjectpublic void close()
public void recommend(java.lang.String productSerial,
WidgetOptions options)
productSerial - (nullable) The new product serialoptions - Additional widget optionspublic void recommend(java.lang.String productSerial)
productSerial - (nullable) The new product serialpublic void recommend(java.lang.String productSerial,
org.json.JSONObject options)
productSerial - (nullable) The new product serialoptions - Additional widget options as JSONObjectpublic void receiveMessage(java.lang.String message)
public void processMessage(java.lang.String encodedMessage)
public void createAndSendAction(java.lang.String action,
org.json.JSONArray arguments)
protected void sendMessage(org.json.JSONObject message)
public void onContainerLoadError(java.lang.String description)