diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index f5fbd1926..b687dc863 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -180,6 +180,8 @@ }, "sendTypingNotifications": "Send typing notifications", "@sendTypingNotifications": {}, + "swipeRightToLeftToReply": "Swipe right to left to reply", + "@swipeRightToLeftToReply": {}, "sendOnEnter": "Send on enter", "@sendOnEnter": {}, "badServerVersionsException": "The homeserver supports the Spec versions:\n{serverVersions}\nBut this app supports only {supportedVersions}", diff --git a/lib/config/app_config.dart b/lib/config/app_config.dart index 56c4a6a2f..841d810ec 100644 --- a/lib/config/app_config.dart +++ b/lib/config/app_config.dart @@ -48,6 +48,7 @@ abstract class AppConfig { static bool autoplayImages = true; static bool sendTypingNotifications = true; static bool sendPublicReadReceipts = true; + static bool swipeRightToLeftToReply = true; static bool? sendOnEnter; static bool showPresences = true; static bool experimentalVoip = false; diff --git a/lib/config/setting_keys.dart b/lib/config/setting_keys.dart index 5fbccc4aa..7c0e50df8 100644 --- a/lib/config/setting_keys.dart +++ b/lib/config/setting_keys.dart @@ -26,6 +26,8 @@ abstract class SettingKeys { static const String sendPublicReadReceipts = 'chat.fluffy.send_public_read_receipts'; static const String sendOnEnter = 'chat.fluffy.send_on_enter'; + static const String swipeRightToLeftToReply = + 'chat.fluffy.swipeRightToLeftToReply'; static const String experimentalVoip = 'chat.fluffy.experimental_voip'; static const String showPresences = 'chat.fluffy.show_presences'; static const String displayChatDetailsColumn = diff --git a/lib/pages/chat/events/message.dart b/lib/pages/chat/events/message.dart index 9cfdaaf42..6a4ec3f2e 100644 --- a/lib/pages/chat/events/message.dart +++ b/lib/pages/chat/events/message.dart @@ -515,7 +515,9 @@ class Message extends StatelessWidget { child: Icon(Icons.check_outlined), ), ), - direction: SwipeDirection.endToStart, + direction: AppConfig.swipeRightToLeftToReply + ? SwipeDirection.endToStart + : SwipeDirection.startToEnd, onSwipe: (_) => onSwipe(), child: Container( constraints: const BoxConstraints( diff --git a/lib/pages/settings_chat/settings_chat_view.dart b/lib/pages/settings_chat/settings_chat_view.dart index 1b7722b38..c3abe990e 100644 --- a/lib/pages/settings_chat/settings_chat_view.dart +++ b/lib/pages/settings_chat/settings_chat_view.dart @@ -65,6 +65,12 @@ class SettingsChatView extends StatelessWidget { storeKey: SettingKeys.sendOnEnter, defaultValue: AppConfig.sendOnEnter ?? !PlatformInfos.isMobile, ), + SettingsSwitchListTile.adaptive( + title: L10n.of(context)!.swipeRightToLeftToReply, + onChanged: (b) => AppConfig.swipeRightToLeftToReply = b, + storeKey: SettingKeys.swipeRightToLeftToReply, + defaultValue: AppConfig.swipeRightToLeftToReply, + ), Divider( height: 1, color: Theme.of(context).dividerColor, diff --git a/lib/widgets/matrix.dart b/lib/widgets/matrix.dart index 96eaeb00a..4de23a2f5 100644 --- a/lib/widgets/matrix.dart +++ b/lib/widgets/matrix.dart @@ -417,6 +417,10 @@ class MatrixState extends State with WidgetsBindingObserver { AppConfig.renderHtml = store.getBool(SettingKeys.renderHtml) ?? AppConfig.renderHtml; + AppConfig.swipeRightToLeftToReply = + store.getBool(SettingKeys.swipeRightToLeftToReply) ?? + AppConfig.swipeRightToLeftToReply; + AppConfig.hideRedactedEvents = store.getBool(SettingKeys.hideRedactedEvents) ?? AppConfig.hideRedactedEvents;