From 81532d014ea0c9643dbd6dfabecd3bc6f7b84cc7 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Tue, 30 Jul 2024 19:53:11 +0800 Subject: [PATCH] chore: use light haptic feedback (#5838) * chore: use light haptic feedback * chore: optimize tabbar & side action animation --- .../lib/mobile/presentation/base/gesture.dart | 2 +- .../presentation/home/space/mobile_space.dart | 13 +++++++------ .../lib/mobile/presentation/home/tab/_tab_bar.dart | 2 ++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/base/gesture.dart b/frontend/appflowy_flutter/lib/mobile/presentation/base/gesture.dart index ba4ab3b1db..ac81ba2122 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/base/gesture.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/base/gesture.dart @@ -36,7 +36,7 @@ class _AnimatedGestureDetectorState extends State { onTapUp: (details) { setState(() => scale = 1.0); - HapticFeedbackType.vibrate.call(); + HapticFeedbackType.light.call(); widget.onTapUp(); }, diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/home/space/mobile_space.dart b/frontend/appflowy_flutter/lib/mobile/presentation/home/space/mobile_space.dart index 296d305a81..ef46489c0d 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/home/space/mobile_space.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/home/space/mobile_space.dart @@ -167,15 +167,16 @@ class _Pages extends StatelessWidget { onSelected: context.pushView, endActionPane: (context) { final view = context.read().state.view; + final actions = [ + MobilePaneActionType.more, + if (view.layout == ViewLayoutPB.Document) + MobilePaneActionType.add, + ]; return buildEndActionPane( context, - [ - MobilePaneActionType.more, - if (view.layout == ViewLayoutPB.Document) - MobilePaneActionType.add, - ], + actions, spaceType: spaceType, - spaceRatio: 4, + spaceRatio: actions.length == 1 ? 3 : 4, ); }, ), diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/home/tab/_tab_bar.dart b/frontend/appflowy_flutter/lib/mobile/presentation/home/tab/_tab_bar.dart index 5602f46f89..fe7ea1e7e9 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/home/tab/_tab_bar.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/home/tab/_tab_bar.dart @@ -23,10 +23,12 @@ class MobileSpaceTabBar extends StatelessWidget { final labelStyle = baseStyle?.copyWith( fontWeight: FontWeight.w600, fontSize: 16.0, + height: 20 / 16, ); final unselectedLabelStyle = baseStyle?.copyWith( fontWeight: FontWeight.w400, fontSize: 15.0, + height: 20 / 15, ); return Container(