From 1d8f6bed6b6886537a986c39db7e00c416783317 Mon Sep 17 00:00:00 2001 From: PaperCube Date: Fri, 16 Feb 2024 13:48:57 +0000 Subject: [PATCH] Experimental support for haptic feedback --- android/app/src/main/AndroidManifest.xml | 1 + lib/core/utils/platform/base.dart | 1 + lib/view/page/ssh/page.dart | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4fe2fdbf3..be725c757 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@ + with AutomaticKeepAliveClientMixin { _terminalTheme = _isDark ? TerminalThemes.dark : TerminalThemes.light; // Because the virtual keyboard only displayed on mobile devices - if (isMobile) { + if (isMobile || isDebuggingMobileLayoutOnDesktop) { _virtKeyWidth = _media.size.width / 7; _virtKeysHeight = _media.size.height * 0.043 * _virtKeysList.length; } @@ -118,7 +118,9 @@ class _SSHPageState extends State with AutomaticKeepAliveClientMixin { Widget child = Scaffold( backgroundColor: _terminalTheme.background, body: _buildBody(), - bottomNavigationBar: isDesktop ? null : _buildBottom(), + bottomNavigationBar: isDesktop && !isDebuggingMobileLayoutOnDesktop + ? null + : _buildBottom(), ); if (isIOS) { child = AnnotatedRegion( @@ -232,10 +234,12 @@ class _SSHPageState extends State with AutomaticKeepAliveClientMixin { void _doVirtualKey(VirtKey item) { if (item.func != null) { + HapticFeedback.mediumImpact(); _doVirtualKeyFunc(item.func!); return; } if (item.key != null) { + HapticFeedback.mediumImpact(); _doVirtualKeyInput(item.key!); } }