diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedSurfaceController.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedSurfaceController.kt index bab6cdd01c..dd0225649e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedSurfaceController.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedSurfaceController.kt @@ -39,10 +39,14 @@ interface EmbeddedSurfaceController { fun attachView(view: SandboxedSdkView) /** The session became the visible tab. */ - fun onShown() {} + fun onShown() { + // Optional hook: default no-op. Controllers that don't pause/resume applet JS need no action. + } /** The session is warm but off-screen; a controller may pause its applet here. */ - fun onHidden() {} + fun onHidden() { + // Optional hook: default no-op. Controllers that don't pause/resume applet JS need no action. + } /** Permanently close the session (unbind the service); used on eviction. */ fun teardown() @@ -59,5 +63,7 @@ interface EmbeddedSurfaceController { var onLoadStatusChanged: ((EmbeddedLoadStatus) -> Unit)? /** Re-attempt the load from scratch (the overlay's Retry); default no-op. */ - fun retry() {} + fun retry() { + // Default no-op: only controllers that report a real load state (and thus can fail) override this. + } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/RemoteImeView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/RemoteImeView.kt index 24adb7b84e..19fdac7055 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/RemoteImeView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/RemoteImeView.kt @@ -85,14 +85,18 @@ class RemoteImeView( start: Int, count: Int, after: Int, - ) {} + ) { + // No-op: TextWatcher requires this override, but only afterTextChanged drives our flush. + } override fun onTextChanged( s: CharSequence?, start: Int, before: Int, count: Int, - ) {} + ) { + // No-op: TextWatcher requires this override, but only afterTextChanged drives our flush. + } override fun afterTextChanged(s: Editable?) { if (!applyingRemote) onEdited?.invoke() diff --git a/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserUiAdapter.kt b/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserUiAdapter.kt index f1b3c43578..bbb2ed68fa 100644 --- a/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserUiAdapter.kt +++ b/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletBrowserUiAdapter.kt @@ -81,7 +81,9 @@ private class BrowserSession( override val signalOptions: Set = emptySet() - override fun notifySessionRendered(supportedSignalOptions: Set) {} + override fun notifySessionRendered(supportedSignalOptions: Set) { + // No-op: signalOptions is empty, so there are no supported signals to report back on. + } override fun notifyResized( width: Int, @@ -91,11 +93,17 @@ private class BrowserSession( webView.requestLayout() } - override fun notifyZOrderChanged(isZOrderOnTop: Boolean) {} + override fun notifyZOrderChanged(isZOrderOnTop: Boolean) { + // No-op: the WebView's z-order within the SurfaceControlViewHost surface is fixed. + } - override fun notifyConfigurationChanged(configuration: Configuration) {} + override fun notifyConfigurationChanged(configuration: Configuration) { + // No-op: the WebView handles configuration changes itself; the session needs no extra action. + } - override fun notifyUiChanged(uiContainerInfo: Bundle) {} + override fun notifyUiChanged(uiContainerInfo: Bundle) { + // No-op: no host-side reaction is needed to UI-container geometry updates. + } override fun close() { // The library may call close() off the main thread; WebView.destroy() (and the tabs mutation) diff --git a/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletHostUiAdapter.kt b/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletHostUiAdapter.kt index 4297bdab68..1fe4c18942 100644 --- a/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletHostUiAdapter.kt +++ b/nappletHost/src/main/kotlin/com/vitorpamplona/amethyst/napplethost/NappletHostUiAdapter.kt @@ -82,7 +82,9 @@ private class HostSession( override val signalOptions: Set = emptySet() - override fun notifySessionRendered(supportedSignalOptions: Set) {} + override fun notifySessionRendered(supportedSignalOptions: Set) { + // No-op: signalOptions is empty, so there are no supported signals to report back on. + } override fun notifyResized( width: Int, @@ -92,11 +94,17 @@ private class HostSession( webView.requestLayout() } - override fun notifyZOrderChanged(isZOrderOnTop: Boolean) {} + override fun notifyZOrderChanged(isZOrderOnTop: Boolean) { + // No-op: the WebView's z-order within the SurfaceControlViewHost surface is fixed. + } - override fun notifyConfigurationChanged(configuration: Configuration) {} + override fun notifyConfigurationChanged(configuration: Configuration) { + // No-op: the WebView handles configuration changes itself; the session needs no extra action. + } - override fun notifyUiChanged(uiContainerInfo: Bundle) {} + override fun notifyUiChanged(uiContainerInfo: Bundle) { + // No-op: no host-side reaction is needed to UI-container geometry updates. + } override fun close() { // The library may call close() off the main thread; WebView.destroy() (and the tabs mutation)