style(player): 播放页与首页浮层的控件样式统一
播放页顶部按钮与选集条去掉底色、进度条不再画滑块圆点并压到最底部; 剧名与简介收在互动栏左侧,清屏后只留右下角退出按钮。 首页观看条与进度条共用 20pt 页边距,进度槽底色与播放页一致。
This commit is contained in:
1 parent
d5bcda54d3
commit
543d0aadd5
12 files changed
+298
-297
No files matched your search
@@ -293,7 +293,10 @@ void main() {
|
||||
expect(find.byKey(const Key('home-feed-synopsis-more')), findsOneWidget);
|
||||
await tester.tap(find.byKey(const Key('home-feed-synopsis-more')));
|
||||
await tester.pump();
|
||||
expect(find.byKey(const Key('home-feed-synopsis-expanded')), findsOneWidget);
|
||||
expect(
|
||||
find.byKey(const Key('home-feed-synopsis-expanded')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
tester
|
||||
.widget<Text>(find.byKey(const Key('home-feed-synopsis-expanded')))
|
||||
@@ -371,7 +374,7 @@ void main() {
|
||||
find.byKey(const Key('home-feed-progress-inactive')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.byKey(const Key('home-feed-progress-thumb')), findsNothing);
|
||||
expect(find.byKey(const Key('home-feed-progress-played')), findsNothing);
|
||||
await tester.tap(find.byKey(const Key('rail-share')));
|
||||
expect(shares, 1);
|
||||
});
|
||||
@@ -575,26 +578,36 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final bar = tester.getRect(find.byKey(const Key('home-feed-full-series')));
|
||||
expect(bar.height, 44);
|
||||
expect(bar.height, 38);
|
||||
final overlayRect = tester.getRect(
|
||||
find.byKey(const Key('home-feed-gesture')),
|
||||
);
|
||||
// 通栏观看条铺满浮层宽度,不再左右内缩。
|
||||
expect(bar.left, closeTo(overlayRect.left, 0.1));
|
||||
expect(bar.width, closeTo(overlayRect.width, 0.1));
|
||||
// 进度线中心比观看条顶沿高 8pt。
|
||||
// 观看条与底部进度条共用同一组左右边距(各 20pt),宽度一致。
|
||||
expect(bar.left, closeTo(overlayRect.left + 20, 0.1));
|
||||
expect(bar.width, closeTo(overlayRect.width - 40, 0.1));
|
||||
expect(
|
||||
bar.top -
|
||||
tester
|
||||
.getCenter(find.byKey(const Key('home-feed-progress-track')))
|
||||
.dy,
|
||||
closeTo(8, 0.1),
|
||||
bar.left,
|
||||
closeTo(
|
||||
tester.getRect(find.byKey(const Key('home-feed-progress'))).left,
|
||||
0.1,
|
||||
),
|
||||
);
|
||||
expect(
|
||||
bar.width,
|
||||
closeTo(
|
||||
tester.getRect(find.byKey(const Key('home-feed-progress'))).width,
|
||||
0.1,
|
||||
),
|
||||
);
|
||||
// 进度线贴着浮层底部(线心距底 4pt),且位于观看条下方。
|
||||
final trackCenter = tester.getCenter(
|
||||
find.byKey(const Key('home-feed-progress-track')),
|
||||
);
|
||||
expect(overlayRect.bottom - trackCenter.dy, closeTo(4, 0.1));
|
||||
expect(trackCenter.dy, greaterThan(bar.bottom));
|
||||
expect(
|
||||
tester
|
||||
.widget<Material>(
|
||||
find.byKey(const Key('home-feed-full-series-bg')),
|
||||
)
|
||||
.widget<Material>(find.byKey(const Key('home-feed-full-series-bg')))
|
||||
.color,
|
||||
AppColors.textPrimary.withValues(alpha: 0.15),
|
||||
);
|
||||
@@ -602,13 +615,9 @@ void main() {
|
||||
tester.getRect(find.textContaining('Watch full series')).center.dy,
|
||||
closeTo(bar.center.dy, 2),
|
||||
);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('home-feed-progress-thumb'))),
|
||||
const Size(6, 6),
|
||||
);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('home-feed-progress'))).height,
|
||||
greaterThanOrEqualTo(32),
|
||||
greaterThanOrEqualTo(16),
|
||||
);
|
||||
expect(
|
||||
tester
|
||||
@@ -620,19 +629,6 @@ void main() {
|
||||
.getRect(find.byKey(const Key('home-feed-progress-track')))
|
||||
.center
|
||||
.dy;
|
||||
expect(
|
||||
tester
|
||||
.getRect(find.byKey(const Key('home-feed-progress-thumb')))
|
||||
.center
|
||||
.dy,
|
||||
closeTo(
|
||||
tester
|
||||
.getRect(find.byKey(const Key('home-feed-progress-track')))
|
||||
.center
|
||||
.dy,
|
||||
0.5,
|
||||
),
|
||||
);
|
||||
|
||||
final gesture = await tester.startGesture(
|
||||
tester.getCenter(find.byKey(const Key('home-feed-progress'))),
|
||||
@@ -704,10 +700,6 @@ void main() {
|
||||
closeTo(trackRect.right - 12, 0.1),
|
||||
);
|
||||
await tester.pump(const Duration(milliseconds: 130));
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('home-feed-progress-thumb'))),
|
||||
const Size(14, 14),
|
||||
);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('home-feed-progress-track'))).height,
|
||||
6,
|
||||
@@ -719,19 +711,6 @@ void main() {
|
||||
.dy,
|
||||
closeTo(idleTrackCenter, 0.1),
|
||||
);
|
||||
expect(
|
||||
tester
|
||||
.getRect(find.byKey(const Key('home-feed-progress-thumb')))
|
||||
.center
|
||||
.dy,
|
||||
closeTo(
|
||||
tester
|
||||
.getRect(find.byKey(const Key('home-feed-progress-track')))
|
||||
.center
|
||||
.dy,
|
||||
0.5,
|
||||
),
|
||||
);
|
||||
await gesture.up();
|
||||
await tester.pumpAndSettle();
|
||||
expect(scrubVisibility.last, isFalse);
|
||||
@@ -746,10 +725,6 @@ void main() {
|
||||
);
|
||||
expect(seeked, isNotNull);
|
||||
expect(seeked!.inSeconds, greaterThan(0));
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('home-feed-progress-thumb'))),
|
||||
const Size(6, 6),
|
||||
);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('home-feed-progress-track'))).height,
|
||||
2,
|
||||
@@ -825,11 +800,11 @@ void main() {
|
||||
isBuffering: true,
|
||||
);
|
||||
await tester.pump(const Duration(milliseconds: 200));
|
||||
expect(find.byKey(const Key('home-feed-progress-thumb')), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-feed-progress-played')), findsOneWidget);
|
||||
expect(find.byKey(const Key('progress-loading')), findsNothing);
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 200));
|
||||
expect(find.byKey(const Key('home-feed-progress-thumb')), findsNothing);
|
||||
expect(find.byKey(const Key('home-feed-progress-played')), findsNothing);
|
||||
expect(find.byKey(const Key('progress-loading')), findsOneWidget);
|
||||
|
||||
controller.value = const VideoPlayerValue(
|
||||
@@ -838,7 +813,7 @@ void main() {
|
||||
isInitialized: true,
|
||||
);
|
||||
await tester.pump();
|
||||
expect(find.byKey(const Key('home-feed-progress-thumb')), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-feed-progress-played')), findsOneWidget);
|
||||
|
||||
final gesture = await tester.startGesture(
|
||||
tester.getCenter(find.byKey(const Key('home-feed-progress'))),
|
||||
@@ -853,7 +828,7 @@ void main() {
|
||||
);
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
|
||||
expect(find.byKey(const Key('home-feed-progress-thumb')), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-feed-progress-played')), findsOneWidget);
|
||||
expect(find.byKey(const Key('progress-loading')), findsNothing);
|
||||
|
||||
controller.value = const VideoPlayerValue(
|
||||
@@ -872,7 +847,7 @@ void main() {
|
||||
isBuffering: true,
|
||||
);
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
expect(find.byKey(const Key('home-feed-progress-thumb')), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-feed-progress-played')), findsOneWidget);
|
||||
expect(find.byKey(const Key('progress-loading')), findsNothing);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user