diff --git a/app/src/main/java/com/syncedsynapse/kore2/jsonrpc/method/GUI.java b/app/src/main/java/com/syncedsynapse/kore2/jsonrpc/method/GUI.java index fd21c83aa..effd7aeb8 100644 --- a/app/src/main/java/com/syncedsynapse/kore2/jsonrpc/method/GUI.java +++ b/app/src/main/java/com/syncedsynapse/kore2/jsonrpc/method/GUI.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.syncedsynapse.kore2.jsonrpc.ApiException; import com.syncedsynapse.kore2.jsonrpc.ApiMethod; +import com.syncedsynapse.kore2.utils.JsonUtils; /** * All JSON RPC methods in GUI.* @@ -181,4 +182,27 @@ public String resultFromJson(ObjectNode jsonObject) throws ApiException { } } + /** + * Toggle fullscreen/GUI + */ + public static final class SetFullscreen extends ApiMethod { + public final static String METHOD_NAME = "GUI.SetFullscreen"; + + /** + * Toggle fullscreen/GUI + */ + public SetFullscreen() { + super(); + addParameterToRequest("fullscreen", "toggle"); + } + + @Override + public String getMethodName() { return METHOD_NAME; } + + @Override + public Boolean resultFromJson(ObjectNode jsonObject) throws ApiException { + return JsonUtils.booleanFromJsonNode(jsonObject, RESULT_NODE); + } + } + } diff --git a/app/src/main/java/com/syncedsynapse/kore2/ui/RemoteActivity.java b/app/src/main/java/com/syncedsynapse/kore2/ui/RemoteActivity.java index ffce938d4..46b3cd81b 100644 --- a/app/src/main/java/com/syncedsynapse/kore2/ui/RemoteActivity.java +++ b/app/src/main/java/com/syncedsynapse/kore2/ui/RemoteActivity.java @@ -34,8 +34,11 @@ import com.syncedsynapse.kore2.host.HostConnectionObserver; import com.syncedsynapse.kore2.host.HostManager; import com.syncedsynapse.kore2.jsonrpc.ApiCallback; -import com.syncedsynapse.kore2.jsonrpc.method.*; +import com.syncedsynapse.kore2.jsonrpc.method.Application; +import com.syncedsynapse.kore2.jsonrpc.method.AudioLibrary; +import com.syncedsynapse.kore2.jsonrpc.method.Input; import com.syncedsynapse.kore2.jsonrpc.method.System; +import com.syncedsynapse.kore2.jsonrpc.method.VideoLibrary; import com.syncedsynapse.kore2.jsonrpc.type.ListType; import com.syncedsynapse.kore2.jsonrpc.type.PlayerType; import com.syncedsynapse.kore2.ui.hosts.AddHostActivity; @@ -173,6 +176,11 @@ public boolean onOptionsItemSelected(MenuItem item) { SendTextDialogFragment.newInstance(getString(R.string.send_text)); dialog.show(getSupportFragmentManager(), null); return true; + case R.id.toggle_fullscreen: +// GUI.SetFullscreen actionSetFullscreen = new GUI.SetFullscreen(); + Input.ExecuteAction actionSetFullscreen = new Input.ExecuteAction(Input.ExecuteAction.TOGGLEFULLSCREEN); + actionSetFullscreen.execute(hostManager.getConnection(), null, null); + return true; case R.id.clean_video_library: VideoLibrary.Clean actionCleanVideo = new VideoLibrary.Clean(); actionCleanVideo.execute(hostManager.getConnection(), null, null); diff --git a/app/src/main/res/menu/remote.xml b/app/src/main/res/menu/remote.xml index 7c8284861..df1f8837e 100644 --- a/app/src/main/res/menu/remote.xml +++ b/app/src/main/res/menu/remote.xml @@ -58,4 +58,8 @@ app:showAsAction="never"/> + diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index ecc779aa3..92f35640a 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -56,6 +56,8 @@ Mettre à jour la bibliothèque vidéo Mettre à jour la bibliothèque audio + Plein écran + Connecté à %1$s Connexion en cours\u2026 Connexion à %1$s (%2$s)\u2026 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 32b0ac3a8..f2d1e29d7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -56,6 +56,8 @@ Update video library Update audio library + Toggle fullscreen + Connected to %1$s Connecting… Connecting to %1$s (%2$s)…