Commit 9927a7e6 authored by Conor Shipp's avatar Conor Shipp Committed by Jeffrey Schiller

Added LoadingDialogMessage and ShowLoadingDialog properties to Fusiontables component

This commit adds two new properties to the FusionTables component. The
first property is "LoadingDialogMessage". This allows the user to
customise the default "Please wait loading..." text which is shown in
the dialog after calling the .SendQuery function.  The second property
is "ShowLoadingDialog" this allows the user to choose whether or not
to show the dialog.

Change-Id: Ia034d66dcab4960ad3ef972e17c0d89336aca75d
parent 7e4d2ff5
......@@ -2907,6 +2907,10 @@ public interface OdeMessages extends Messages {
@Description("")
String LineWidthProperties();
@DefaultMessage("LoadingDialogMessage")
@Description("")
String LoadingDialogMessageProperties();
@DefaultMessage("Message")
@Description("")
String MessageProperties();
......@@ -3023,6 +3027,10 @@ public interface OdeMessages extends Messages {
@Description("")
String ServiceURLProperties();
@DefaultMessage("ShowLoadingDialog")
@Description("")
String ShowLoadingDialogProperties();
@DefaultMessage("FirebaseURL")
@Description("")
String FirebaseURLProperties();
......
......@@ -976,6 +976,11 @@ public final class YoungAndroidFormUpgrader {
// were added.
srcCompVersion = 3;
}
if (srcCompVersion < 4) {
// The LoadingDialogMessage property was added
// The ShowLoadingDialog property was added
srcCompVersion = 4;
}
return srcCompVersion;
}
......
......@@ -1513,7 +1513,11 @@ Blockly.Versioning.AllUpgradeMaps =
// AI2: - InsertRow, GetRows and GetRowsWithConditions was added.
// - KeyFile, UseServiceAuthentication and ServiceAccountEmail
// were added.
3: "noUpgrade"
3: "noUpgrade",
// The LoadingDialogMessage property was added
// The ShowLoadingDialog property was added
4: "noUpgrade"
}, // End FusiontablesControl upgraders
......
......@@ -427,8 +427,10 @@ public class YaVersion {
// - NOTIFIER_COMPONENT_VERSION was incremented to 5
// For YOUNG_ANDROID_VERSION 170:
// - MAP_COMPONENT_VERSION was incremented to 4
// For YOUNG_ANDROID_VERSION 171:
// - FUSIONTABLESCONTROL_COMPONENT_VERSION was incremented to 4
public static final int YOUNG_ANDROID_VERSION = 170;
public static final int YOUNG_ANDROID_VERSION = 171;
// ............................... Blocks Language Version Number ...............................
......@@ -752,7 +754,10 @@ public class YaVersion {
// - InsertRow, GetRows and GetRowsWithConditions was added.
// - KeyFile, UseServiceAuthentication and ServiceAccountEmail
// were added.
public static final int FUSIONTABLESCONTROL_COMPONENT_VERSION = 3;
// For FUSIONTABLESCONTROL_COMPONENT_VERSION 4:
// - The LoadingDialogMessage property was added
// - The ShowLoadingDialog property was added
public static final int FUSIONTABLESCONTROL_COMPONENT_VERSION = 4;
public static final int GAMECLIENT_COMPONENT_VERSION = 1;
......
......@@ -221,6 +221,10 @@ public class FusiontablesControl extends AndroidNonvisibleComponent implements C
private String scope = "https://www.googleapis.com/auth/fusiontables";
private String loadingDialogMessage = "Please wait loading...";
private boolean showLoadingDialog = true;
public FusiontablesControl(ComponentContainer componentContainer) {
super(componentContainer.$form());
this.container = componentContainer;
......@@ -432,6 +436,48 @@ public class FusiontablesControl extends AndroidNonvisibleComponent implements C
new QueryProcessorV2(activity).execute(query);
}
/**
* Setter for the loading dialog's message.
*/
@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING,
defaultValue = "Please wait loading...")
@SimpleProperty
public void LoadingDialogMessage(String loadingDialogMessage) {
this.loadingDialogMessage = loadingDialogMessage;
}
/**
* Getter for the loading dialog's message.
* @return loadingDialogMessage
*/
@SimpleProperty(
description = "Set the loading message for the dialog.",
category = PropertyCategory.BEHAVIOR)
public String LoadingDialogMessage() {
return loadingDialogMessage;
}
/**
* Setter for the loading dialog's visibility.
*/
@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_BOOLEAN,
defaultValue = "True")
@SimpleProperty
public void ShowLoadingDialog(boolean showLoadingDialog) {
this.showLoadingDialog = showLoadingDialog;
}
/**
* Getter for the loading dialog's visibility.
* @return True if the loading dialog should be shown, otherwise False.
*/
@SimpleProperty(
description = "Whether or not to show the loading dialog",
category = PropertyCategory.BEHAVIOR)
public boolean ShowLoadingDialog() {
return showLoadingDialog;
}
// To be Deprecated, based on the old API
private IClientLoginHelper createClientLoginHelper(String accountPrompt, String service) {
......@@ -784,9 +830,11 @@ public class FusiontablesControl extends AndroidNonvisibleComponent implements C
@Override
protected void onPreExecute() {
dialog.setMessage("Please wait loading...");
if (ShowLoadingDialog()) {
dialog.setMessage(LoadingDialogMessage());
dialog.show();
}
}
/**
* The Oauth handshake and the API request are both handled here.
......
......@@ -577,10 +577,14 @@ none
<dd>Your Google API Key. See above for details on obtaining an API key. </dd>
<dt><code>KeyFile</code></dt>
<dd>Specifies the path of the private key file. This key file is used to get access to the FusionTables API through Service Authentication.</dd>
<dt><code>LoadingDialogMessage</code></dt>
<dd>The message shown in the loading dialog </dd>
<dt><code>Query</code></dt>
<dd>The query to send to the Fusion Tables API. <p>For legal query formats and examples, see the <a href="https://developers.google.com/fusiontables/docs/v2/getting_started" target="_blank">Fusion Tables API v2.0 reference manual</a>.</p> <p>Note that you do not need to worry about UTF-encoding the query. You must make sure the query follows the syntax described in the reference manual. Note that capitalization for names of columns is necessary and that single quotes must be used around column names if there are spaces in them.</p> </dd>
<dt><code>ServiceAccountEmail</code></dt>
<dd>The Service Account Email Address used for Service Authentication.</dd>
<dt><code>ShowLoadingDialog</code></dt>
<dd>Whether to show the loading dialog or not </dd>
<dt><code>UseServiceAuthentication</code></dt>
<dd>Indicates whether a service account should be used for authentication.</dd>
</dl>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment