Merge pull request #1159 from MrSpoony/feat/configure-reply-swipe-direction

feat: add option to configure reply swipe direction
pull/1181/head
Krille-chan 1 year ago committed by GitHub
commit cc82841124
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -180,6 +180,8 @@
}, },
"sendTypingNotifications": "Send typing notifications", "sendTypingNotifications": "Send typing notifications",
"@sendTypingNotifications": {}, "@sendTypingNotifications": {},
"swipeRightToLeftToReply": "Swipe right to left to reply",
"@swipeRightToLeftToReply": {},
"sendOnEnter": "Send on enter", "sendOnEnter": "Send on enter",
"@sendOnEnter": {}, "@sendOnEnter": {},
"badServerVersionsException": "The homeserver supports the Spec versions:\n{serverVersions}\nBut this app supports only {supportedVersions}", "badServerVersionsException": "The homeserver supports the Spec versions:\n{serverVersions}\nBut this app supports only {supportedVersions}",

@ -48,6 +48,7 @@ abstract class AppConfig {
static bool autoplayImages = true; static bool autoplayImages = true;
static bool sendTypingNotifications = true; static bool sendTypingNotifications = true;
static bool sendPublicReadReceipts = true; static bool sendPublicReadReceipts = true;
static bool swipeRightToLeftToReply = true;
static bool? sendOnEnter; static bool? sendOnEnter;
static bool showPresences = true; static bool showPresences = true;
static bool experimentalVoip = false; static bool experimentalVoip = false;

@ -26,6 +26,8 @@ abstract class SettingKeys {
static const String sendPublicReadReceipts = static const String sendPublicReadReceipts =
'chat.fluffy.send_public_read_receipts'; 'chat.fluffy.send_public_read_receipts';
static const String sendOnEnter = 'chat.fluffy.send_on_enter'; 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 experimentalVoip = 'chat.fluffy.experimental_voip';
static const String showPresences = 'chat.fluffy.show_presences'; static const String showPresences = 'chat.fluffy.show_presences';
static const String displayChatDetailsColumn = static const String displayChatDetailsColumn =

@ -515,7 +515,9 @@ class Message extends StatelessWidget {
child: Icon(Icons.check_outlined), child: Icon(Icons.check_outlined),
), ),
), ),
direction: SwipeDirection.endToStart, direction: AppConfig.swipeRightToLeftToReply
? SwipeDirection.endToStart
: SwipeDirection.startToEnd,
onSwipe: (_) => onSwipe(), onSwipe: (_) => onSwipe(),
child: Container( child: Container(
constraints: const BoxConstraints( constraints: const BoxConstraints(

@ -65,6 +65,12 @@ class SettingsChatView extends StatelessWidget {
storeKey: SettingKeys.sendOnEnter, storeKey: SettingKeys.sendOnEnter,
defaultValue: AppConfig.sendOnEnter ?? !PlatformInfos.isMobile, defaultValue: AppConfig.sendOnEnter ?? !PlatformInfos.isMobile,
), ),
SettingsSwitchListTile.adaptive(
title: L10n.of(context)!.swipeRightToLeftToReply,
onChanged: (b) => AppConfig.swipeRightToLeftToReply = b,
storeKey: SettingKeys.swipeRightToLeftToReply,
defaultValue: AppConfig.swipeRightToLeftToReply,
),
Divider( Divider(
height: 1, height: 1,
color: Theme.of(context).dividerColor, color: Theme.of(context).dividerColor,

@ -417,6 +417,10 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
AppConfig.renderHtml = AppConfig.renderHtml =
store.getBool(SettingKeys.renderHtml) ?? AppConfig.renderHtml; store.getBool(SettingKeys.renderHtml) ?? AppConfig.renderHtml;
AppConfig.swipeRightToLeftToReply =
store.getBool(SettingKeys.swipeRightToLeftToReply) ??
AppConfig.swipeRightToLeftToReply;
AppConfig.hideRedactedEvents = AppConfig.hideRedactedEvents =
store.getBool(SettingKeys.hideRedactedEvents) ?? store.getBool(SettingKeys.hideRedactedEvents) ??
AppConfig.hideRedactedEvents; AppConfig.hideRedactedEvents;

Loading…
Cancel
Save