diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png index 0ebf0f3f..31b87f4a 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/10.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/10.png index b815e8fa..554b0d87 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/10.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/10.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png index 31b87f4a..add728d5 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png index 8952f12a..8b3a00b9 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png index e0cb2713..7ef8ab1d 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png index 72b481a2..9b427886 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png index e52ea228..0ebf0f3f 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/9.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/9.png index 6e825945..b815e8fa 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/9.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/9.png differ diff --git a/lib/main.dart b/lib/main.dart index 93780d4c..46a13daf 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -330,25 +330,42 @@ class HackiApp extends StatelessWidget { theme: state.isHackerNewsThemeEnabled ? HackerNewsTheme.theme : ThemeData( - colorScheme: colorScheme, - fontFamily: state.font.name, - canvasColor: isDarkModeEnabled && - state.isTrueDarkModeEnabled - ? Palette.black - : null, - scaffoldBackgroundColor: isDarkModeEnabled && - state.isTrueDarkModeEnabled - ? Palette.black - : null, appBarTheme: AppBarTheme( foregroundColor: colorScheme.onSurface, iconTheme: IconThemeData( color: colorScheme.onSurface, ), ), + bottomSheetTheme: BottomSheetThemeData( + modalElevation: Dimens.pt8, + clipBehavior: Clip.hardEdge, + shadowColor: Palette.black, + backgroundColor: isDarkModeEnabled && + state.isTrueDarkModeEnabled + ? Palette.black + : null, + ), + canvasColor: isDarkModeEnabled && + state.isTrueDarkModeEnabled + ? Palette.black + : null, + colorScheme: colorScheme, dividerTheme: DividerThemeData( color: Palette.grey.withValues(alpha: 0.2), ), + elevatedButtonTheme: + const ElevatedButtonThemeData( + style: ButtonStyle(enableFeedback: false), + ), + floatingActionButtonTheme: + const FloatingActionButtonThemeData( + enableFeedback: false, + ), + fontFamily: state.font.name, + scaffoldBackgroundColor: isDarkModeEnabled && + state.isTrueDarkModeEnabled + ? Palette.black + : null, switchTheme: SwitchThemeData( trackColor: WidgetStateProperty.resolveWith( (Set states) { @@ -365,21 +382,13 @@ class HackiApp extends StatelessWidget { ), textButtonTheme: TextButtonThemeData( style: ButtonStyle( + enableFeedback: false, foregroundColor: WidgetStateProperty.resolveWith( (_) => colorScheme.primary, ), ), ), - bottomSheetTheme: BottomSheetThemeData( - modalElevation: 8, - clipBehavior: Clip.hardEdge, - shadowColor: Palette.black, - backgroundColor: isDarkModeEnabled && - state.isTrueDarkModeEnabled - ? Palette.black - : null, - ), inputDecorationTheme: InputDecorationTheme( enabledBorder: UnderlineInputBorder( borderSide: BorderSide( @@ -402,14 +411,9 @@ class HackiApp extends StatelessWidget { ), ), ), - sliderTheme: SliderThemeData( - inactiveTrackColor: colorScheme.primary - .withValues(alpha: 0.5), - activeTrackColor: colorScheme.primary, - thumbColor: colorScheme.primary, - ), outlinedButtonTheme: OutlinedButtonThemeData( style: ButtonStyle( + enableFeedback: false, side: WidgetStateBorderSide.resolveWith( (_) => const BorderSide( color: Palette.grey, @@ -417,6 +421,12 @@ class HackiApp extends StatelessWidget { ), ), ), + sliderTheme: SliderThemeData( + inactiveTrackColor: colorScheme.primary + .withValues(alpha: 0.5), + activeTrackColor: colorScheme.primary, + thumbColor: colorScheme.primary, + ), ), routerConfig: router, builder: state.isDevModeEnabled diff --git a/lib/screens/item/widgets/custom_floating_action_button.dart b/lib/screens/item/widgets/custom_floating_action_button.dart index 6252d4c3..002f39c4 100644 --- a/lib/screens/item/widgets/custom_floating_action_button.dart +++ b/lib/screens/item/widgets/custom_floating_action_button.dart @@ -38,8 +38,11 @@ class FloatingSkipButtons extends StatelessWidget { color: Theme.of(context).colorScheme.onPrimary, ), child: InkWell( - onLongPress: () => - context.read().scrollTo(index: 0), + enableFeedback: false, + onLongPress: () { + HapticFeedbackUtils.light(); + context.read().scrollTo(index: 0); + }, child: FloatingActionButton( enableFeedback: false, backgroundColor: Theme.of(context) @@ -70,7 +73,9 @@ class FloatingSkipButtons extends StatelessWidget { color: Theme.of(context).colorScheme.onPrimary, ), child: InkWell( + enableFeedback: false, onLongPress: () { + HapticFeedbackUtils.light(); final CommentsCubit cubit = context.read(); cubit.scrollTo(index: cubit.state.comments.length - 1); }, diff --git a/lib/screens/item/widgets/item_screen_background.dart b/lib/screens/item/widgets/item_screen_background.dart index d8f43408..957aa10c 100644 --- a/lib/screens/item/widgets/item_screen_background.dart +++ b/lib/screens/item/widgets/item_screen_background.dart @@ -30,31 +30,26 @@ class ItemScreenBackground extends StatefulWidget { class _ItemScreenBackgroundState extends State { int _shineIndex = 0; - bool _isVisible = false; bool _overrideCommentsStatus = false; - Timer? _visibilityTimer; + Timer? _animationTimer; Timer? _overrideTimer; @override void initState() { super.initState(); - _visibilityTimer = Timer(AppDurations.oneSecond, () { - if (mounted) { - setState(() => _isVisible = true); - } - }); _overrideTimer = Timer(AppDurations.fiveSeconds, () { if (mounted) { setState(() => _overrideCommentsStatus = true); } + _overrideTimer?.cancel(); }); } @override void dispose() { - _visibilityTimer?.cancel(); + _animationTimer?.cancel(); _overrideTimer?.cancel(); super.dispose(); } @@ -68,8 +63,8 @@ class _ItemScreenBackgroundState extends State { previous.status != current.status, listener: (BuildContext context, CommentsState state) { if (state.status == CommentsStatus.allLoaded && isEyeCandyEnabled) { - _visibilityTimer?.cancel(); - _visibilityTimer = + _animationTimer?.cancel(); + _animationTimer = Timer.periodic(const Duration(milliseconds: 1200), (_) { setState(() { _shineIndex = (_shineIndex + 1) % (state.maxLevel + 1); @@ -81,12 +76,14 @@ class _ItemScreenBackgroundState extends State { previous.maxLevel != current.maxLevel || previous.status != current.status, builder: (BuildContext context, CommentsState state) { - if (!_isVisible || state.comments.isEmpty) { - return const SizedBox.shrink(); - } else if (!_overrideCommentsStatus && - state.status == CommentsStatus.inProgress) { - return FadeIn( - child: Stack( + return FadeIn( + child: AnimatedCrossFade( + duration: AppDurations.ms400, + crossFadeState: !_overrideCommentsStatus && + state.status == CommentsStatus.inProgress + ? CrossFadeState.showFirst + : CrossFadeState.showSecond, + firstChild: Stack( children: [ Positioned( left: Dimens.zero, @@ -96,75 +93,80 @@ class _ItemScreenBackgroundState extends State { quarterTurns: 1, child: LinearProgressIndicator( minHeight: widget.indentLineWidth, + color: Theme.of(context).colorScheme.primaryContainer, + backgroundColor: Theme.of(context) + .colorScheme + .primaryContainer + .withValues(alpha: 0.2), ), ), ), ], ), - ); - } - return FadeIn( - child: Stack( - children: [ - if (widget.shouldShowRootLevelLine) - Padding( - padding: EdgeInsets.zero, - child: SizedBox( - height: MediaQuery.of(context).size.height, - width: widget.indentLineWidth, - child: isEyeCandyEnabled - ? AnimatedIndentLine( - color: - Theme.of(context).colorScheme.primaryContainer, - width: widget.indentLineWidth, - isShining: _shineIndex == 0, - ) - : Container( - width: widget.indentLineWidth, - height: MediaQuery.of(context).size.height, - color: - Theme.of(context).colorScheme.primaryContainer, - ), - ), - ), - if (state.maxLevel > 0) - for (final int i in 1.to( - state.maxLevel, - )) + secondChild: Stack( + children: [ + if (widget.shouldShowRootLevelLine) Padding( - padding: EdgeInsets.only( - left: widget.shouldShowRootLevelLine - ? widget.indentPadding * i - : widget.indentPadding * i - widget.indentLineWidth, - ), + padding: EdgeInsets.zero, child: SizedBox( height: MediaQuery.of(context).size.height, width: widget.indentLineWidth, child: isEyeCandyEnabled ? AnimatedIndentLine( - color: ColorUtils.getRainbowColor( - i, - Theme.of(context).canvasColor, - ).$1, + color: Theme.of(context) + .colorScheme + .primaryContainer, width: widget.indentLineWidth, - isShining: _shineIndex == i, + isShining: _shineIndex == 0, ) : Container( width: widget.indentLineWidth, height: MediaQuery.of(context).size.height, - color: ColorUtils.getRainbowColor( - i, - Theme.of(context).canvasColor, - ).$1.withValues( - alpha: Theme.of(context).brightness == - Brightness.dark - ? 0.6 - : 1, - ), + color: Theme.of(context) + .colorScheme + .primaryContainer, ), ), ), - ], + if (state.maxLevel > 0) + for (final int i in 1.to( + state.maxLevel, + )) + Padding( + padding: EdgeInsets.only( + left: widget.shouldShowRootLevelLine + ? widget.indentPadding * i + : widget.indentPadding * i - widget.indentLineWidth, + ), + child: SizedBox( + height: MediaQuery.of(context).size.height, + width: widget.indentLineWidth, + child: isEyeCandyEnabled + ? AnimatedIndentLine( + color: ColorUtils.getRainbowColor( + i, + Theme.of(context).canvasColor, + ).$1, + width: widget.indentLineWidth, + isShining: _shineIndex == i, + ) + : Container( + width: widget.indentLineWidth, + height: MediaQuery.of(context).size.height, + color: ColorUtils.getRainbowColor( + i, + Theme.of(context).canvasColor, + ).$1.withValues( + alpha: Theme.of(context).brightness == + Brightness.dark + ? 0.6 + : 1, + ), + ), + ), + ), + ], + ), ), ); }, diff --git a/lib/screens/item/widgets/main_view.dart b/lib/screens/item/widgets/main_view.dart index c6d59987..2e675126 100644 --- a/lib/screens/item/widgets/main_view.dart +++ b/lib/screens/item/widgets/main_view.dart @@ -446,6 +446,7 @@ class _ParentItemSection extends StatelessWidget { children: [ if (item is Story) InkWell( + enableFeedback: false, onTap: () => LinkUtils.launch( item.url, context, diff --git a/lib/screens/widgets/custom_linkify/custom_linkify.dart b/lib/screens/widgets/custom_linkify/custom_linkify.dart index 2985c98d..3d5f7ad3 100644 --- a/lib/screens/widgets/custom_linkify/custom_linkify.dart +++ b/lib/screens/widgets/custom_linkify/custom_linkify.dart @@ -383,6 +383,7 @@ TextSpan buildTextSpan( } else { return WidgetSpan( child: InkWell( + enableFeedback: false, onLongPress: () { final String url = element.url; if (url.isNotEmpty) { diff --git a/lib/screens/widgets/items_list_view.dart b/lib/screens/widgets/items_list_view.dart index b0904d7b..6eba3acd 100644 --- a/lib/screens/widgets/items_list_view.dart +++ b/lib/screens/widgets/items_list_view.dart @@ -109,6 +109,7 @@ class ItemsListView extends StatelessWidget { if (shouldUseMinimalTileForStory) FadeIn( child: InkWell( + enableFeedback: false, onTap: () => onTap(e), /// If swipe gesture is enabled on home screen, use diff --git a/lib/styles/theme.dart b/lib/styles/theme.dart index 69faf266..574172b7 100644 --- a/lib/styles/theme.dart +++ b/lib/styles/theme.dart @@ -3,7 +3,7 @@ import 'package:hacki/models/font.dart'; import 'package:hacki/styles/dimens.dart'; extension ThemeDataExtension on ThemeData { - Color get readGrey => colorScheme.onSurface.withValues(alpha: 0.6); + Color get readGrey => hintColor; Color get metadataColor => colorScheme.onSurface.withValues(alpha: 0.8); }