fix(flutter): 精修首页 feed 交互与底色
This commit is contained in:
1 parent
435fbbbbb1
commit
321c62664c
17 files changed
+427
-448
No files matched your search
@@ -9,6 +9,7 @@ import '../../../core/formatting/count_format.dart';
|
||||
import '../../../core/formatting/localized_content.dart';
|
||||
import '../../../core/theme/app_colors.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
import 'interaction_rail.dart';
|
||||
|
||||
part 'home_feed_overlay_parts.dart';
|
||||
|
||||
@@ -16,7 +17,6 @@ const Color _overlayPill = Color(0x66000000);
|
||||
const Color _fullBarColor = Color(0xCC000000);
|
||||
const double _topIconSize = 36;
|
||||
const double _topIconGlyph = 22;
|
||||
const double _pillHeight = 34;
|
||||
const double _tabGap = 22;
|
||||
const double _tabFontSize = 15;
|
||||
const double _underlineWidth = 18;
|
||||
@@ -24,9 +24,9 @@ const double _underlineHeight = 2;
|
||||
const double _titleFontSize = 17;
|
||||
const double _metaFontSize = 12;
|
||||
const double _tagFontSize = 11;
|
||||
const double _railIconSize = 22;
|
||||
const double _fullBarHeight = 48;
|
||||
const double _progressHeight = 2;
|
||||
const double _progressHitHeight = 20;
|
||||
const int _maxTags = 4;
|
||||
final RegExp _tagSplitter = RegExp(r'[,/、·]');
|
||||
|
||||
@@ -46,10 +46,13 @@ class HomeFeedOverlay extends StatefulWidget {
|
||||
required this.onShare,
|
||||
required this.onEpisodes,
|
||||
required this.onDetail,
|
||||
required this.onFullscreen,
|
||||
required this.onOpenFullPlayer,
|
||||
required this.onRefreshFeed,
|
||||
required this.onDownload,
|
||||
required this.onClear,
|
||||
required this.onSearch,
|
||||
this.onScrubStart,
|
||||
this.onSeek,
|
||||
this.likeCount,
|
||||
this.favoriteCount,
|
||||
this.commentCount,
|
||||
@@ -73,11 +76,14 @@ class HomeFeedOverlay extends StatefulWidget {
|
||||
final VoidCallback onShare;
|
||||
final VoidCallback onEpisodes;
|
||||
final VoidCallback onDetail;
|
||||
final VoidCallback onFullscreen;
|
||||
final VoidCallback onOpenFullPlayer;
|
||||
final VoidCallback onRefreshFeed;
|
||||
final VoidCallback onDownload;
|
||||
final VoidCallback onClear;
|
||||
final VoidCallback onSearch;
|
||||
final VoidCallback? onPip;
|
||||
final VoidCallback? onScrubStart;
|
||||
final ValueChanged<Duration>? onSeek;
|
||||
|
||||
@override
|
||||
State<HomeFeedOverlay> createState() => _HomeFeedOverlayState();
|
||||
@@ -145,13 +151,12 @@ class _HomeFeedOverlayState extends State<HomeFeedOverlay> {
|
||||
padding: const EdgeInsets.fromLTRB(8, 6, 8, 4),
|
||||
child: Row(
|
||||
children: [
|
||||
_TopIconButton(
|
||||
key: const Key('home-feed-menu'),
|
||||
tooltip: widget.l10n.more,
|
||||
icon: Icons.menu_rounded,
|
||||
_RefreshButton(
|
||||
tooltip: widget.l10n.retry,
|
||||
dimension: _topIconSize,
|
||||
glyphSize: _topIconGlyph,
|
||||
onPressed: () => _openMore(context),
|
||||
onTap: widget.onRefreshFeed,
|
||||
onLongPress: () => _openMore(context),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
@@ -205,45 +210,42 @@ class _HomeFeedOverlayState extends State<HomeFeedOverlay> {
|
||||
}
|
||||
|
||||
Widget _rail() {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_FeedRailItem(
|
||||
return InteractionRail(
|
||||
items: [
|
||||
InteractionRailItem(
|
||||
key: const Key('rail-save'),
|
||||
icon: widget.saved ? Icons.star_rounded : Icons.star_border_rounded,
|
||||
icon: Icons.star_border_rounded,
|
||||
activeIcon: Icons.star_rounded,
|
||||
label: widget.l10n.favorite,
|
||||
count: widget.favoriteCount,
|
||||
countKey: const Key('rail-save-count'),
|
||||
label: widget.l10n.favorite,
|
||||
selected: widget.saved,
|
||||
iconSize: _railIconSize,
|
||||
onTap: widget.onSave,
|
||||
),
|
||||
_FeedRailItem(
|
||||
InteractionRailItem(
|
||||
key: const Key('rail-comments'),
|
||||
icon: Icons.chat_bubble_outline_rounded,
|
||||
activeIcon: Icons.chat_bubble_rounded,
|
||||
label: widget.l10n.comments,
|
||||
count: widget.commentCount,
|
||||
countKey: const Key('rail-comments-count'),
|
||||
label: widget.l10n.comments,
|
||||
iconSize: _railIconSize,
|
||||
onTap: widget.onComments,
|
||||
),
|
||||
_FeedRailItem(
|
||||
InteractionRailItem(
|
||||
key: const Key('rail-like'),
|
||||
icon: widget.liked
|
||||
? Icons.favorite_rounded
|
||||
: Icons.favorite_border_rounded,
|
||||
icon: Icons.favorite_border_rounded,
|
||||
activeIcon: Icons.favorite_rounded,
|
||||
label: widget.l10n.like,
|
||||
count: widget.likeCount,
|
||||
countKey: const Key('rail-like-count'),
|
||||
label: widget.l10n.like,
|
||||
selected: widget.liked,
|
||||
iconSize: _railIconSize,
|
||||
onTap: widget.onLike,
|
||||
),
|
||||
_FeedRailItem(
|
||||
InteractionRailItem(
|
||||
key: const Key('rail-share'),
|
||||
icon: Icons.ios_share_rounded,
|
||||
activeIcon: Icons.ios_share_rounded,
|
||||
label: widget.l10n.share,
|
||||
iconSize: _railIconSize,
|
||||
onTap: widget.onShare,
|
||||
),
|
||||
],
|
||||
@@ -257,28 +259,6 @@ class _HomeFeedOverlayState extends State<HomeFeedOverlay> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: _DanmakuPill(
|
||||
l10n: widget.l10n,
|
||||
height: _pillHeight,
|
||||
background: _overlayPill,
|
||||
onTap: _showComingSoon,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Flexible(
|
||||
child: _FullscreenPill(
|
||||
l10n: widget.l10n,
|
||||
height: _pillHeight,
|
||||
background: _overlayPill,
|
||||
onTap: widget.onFullscreen,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_seriesMetaRow(),
|
||||
const SizedBox(height: 2),
|
||||
_titleRow(),
|
||||
@@ -405,7 +385,7 @@ class _HomeFeedOverlayState extends State<HomeFeedOverlay> {
|
||||
Widget _fullSeriesBar() {
|
||||
return GestureDetector(
|
||||
key: const Key('home-feed-full-series'),
|
||||
onTap: widget.onEpisodes,
|
||||
onTap: widget.onOpenFullPlayer,
|
||||
child: Container(
|
||||
height: _fullBarHeight,
|
||||
color: _fullBarColor,
|
||||
@@ -447,9 +427,12 @@ class _HomeFeedOverlayState extends State<HomeFeedOverlay> {
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: _FeedProgressTrack(
|
||||
child: _FeedProgressBar(
|
||||
controller: widget.controller,
|
||||
height: _progressHeight,
|
||||
hitHeight: _progressHitHeight,
|
||||
onScrubStart: widget.onScrubStart,
|
||||
onSeek: widget.onSeek,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user