2 * This file is part of WolneLektury-Mobile, licensed under GNU Affero GPLv3 or later.
3 * Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 package pl.org.nowoczesnapolska.wlmobi;
8 import org.json.JSONArray;
9 import org.json.JSONException;
11 import com.phonegap.api.Plugin;
12 import com.phonegap.api.PluginResult;
14 public class MenuInterface extends Plugin{
16 public static String infoLabel = "Proszę czekać...";
17 public static Boolean infoEnabled = false;
20 public PluginResult execute(String action, JSONArray args, String callbackId) {
21 if (action.equals("setInfoButton")) {
23 return this.setInfoButton(args.getString(0), args.getString(1));
24 } catch (JSONException e) {
25 return new PluginResult(PluginResult.Status.ERROR, "Param errrors");
29 return new PluginResult(PluginResult.Status.INVALID_ACTION);
33 private PluginResult setInfoButton(String label, String enabled) {
35 infoEnabled = enabled.equals("true");
37 return new PluginResult(PluginResult.Status.OK);