X-Git-Url: https://git.mdrn.pl/wl-mobile.git/blobdiff_plain/8b7b42d45674861437a31e9f9125a277ce998721..065d23f9494e1afb7f61ada08b728405b1b7a0cf:/src/pl/org/nowoczesnapolska/wlmobi/MenuInterface.java diff --git a/src/pl/org/nowoczesnapolska/wlmobi/MenuInterface.java b/src/pl/org/nowoczesnapolska/wlmobi/MenuInterface.java new file mode 100644 index 0000000..b71fd4c --- /dev/null +++ b/src/pl/org/nowoczesnapolska/wlmobi/MenuInterface.java @@ -0,0 +1,40 @@ +package pl.org.nowoczesnapolska.wlmobi; + +/* + @author Radek Czajka + */ + +import org.json.JSONArray; +import org.json.JSONException; + +import android.util.Log; + +import com.phonegap.api.Plugin; +import com.phonegap.api.PluginResult; + +public class MenuInterface extends Plugin{ + + public static String infoLabel = "Proszę czekać..."; + public static Boolean infoEnabled = false; + + @Override + public PluginResult execute(String action, JSONArray args, String callbackId) { + if (action.equals("setInfoButton")) { + try { + return this.setInfoButton(args.getString(0), args.getString(1)); + } catch (JSONException e) { + return new PluginResult(PluginResult.Status.ERROR, "Param errrors"); + } + } + else { + return new PluginResult(PluginResult.Status.INVALID_ACTION); + } + } + + private PluginResult setInfoButton(String label, String enabled) { + infoLabel = label; + infoEnabled = enabled.equals("true"); + + return new PluginResult(PluginResult.Status.OK); + } +}