From 4d748f95af29b4a9f7ecda0038c3bed3185859d3 Mon Sep 17 00:00:00 2001 From: dom Date: Sun, 10 May 2026 09:54:51 +0800 Subject: [PATCH] drop Signed-off-by: dom --- .../com/example/piliplus/MainActivity.kt | 56 ------ lib/common/skeleton/dynamic_card.dart | 175 +++++++++--------- lib/common/skeleton/fav_pgc_item.dart | 99 +++++----- lib/common/skeleton/media_bangumi.dart | 115 ++++++------ lib/common/skeleton/msg_feed_sys_msg_.dart | 73 ++++---- lib/common/skeleton/msg_feed_top.dart | 41 ++-- lib/common/skeleton/skeleton.dart | 65 ------- lib/common/skeleton/space_opus.dart | 71 ++++--- lib/common/skeleton/video_card_h.dart | 117 ++++++------ lib/common/skeleton/video_card_v.dart | 95 +++++----- lib/common/skeleton/video_reply.dart | 143 +++++++------- lib/common/skeleton/whisper_item.dart | 47 +++-- .../widgets/video_card/video_card_h.dart | 2 - lib/pages/live/view.dart | 43 ++--- lib/pages/rcmd/view.dart | 34 ++-- .../video/reply/widgets/reply_item_grpc.dart | 1 + 16 files changed, 511 insertions(+), 666 deletions(-) delete mode 100644 lib/common/skeleton/skeleton.dart diff --git a/android/app/src/main/kotlin/com/example/piliplus/MainActivity.kt b/android/app/src/main/kotlin/com/example/piliplus/MainActivity.kt index 06e93e4a9..73fce2f4d 100644 --- a/android/app/src/main/kotlin/com/example/piliplus/MainActivity.kt +++ b/android/app/src/main/kotlin/com/example/piliplus/MainActivity.kt @@ -34,45 +34,6 @@ class MainActivity : AudioServiceActivity() { when (call.method) { "back" -> back(); - "biliSendCommAntifraud" -> { - try { - val action = call.argument("action") ?: 0 - val oid = call.argument("oid") ?: 0L - val type = call.argument("type") ?: 0 - val rpid = call.argument("rpid") ?: 0L - val root = call.argument("root") ?: 0L - val parent = call.argument("parent") ?: 0L - val ctime = call.argument("ctime") ?: 0L - val commentText = call.argument("comment_text") ?: "" - val pictures = call.argument("pictures") - val sourceId = call.argument("source_id") ?: "" - val uid = call.argument("uid") ?: 0L - val cookies = call.argument>("cookies") ?: emptyList() - - val intent = Intent().apply { - component = ComponentName( - "icu.freedomIntrovert.biliSendCommAntifraud", - "icu.freedomIntrovert.biliSendCommAntifraud.ByXposedLaunchedActivity" - ) - putExtra("action", action) - putExtra("oid", oid.toLong()) - putExtra("type", type) - putExtra("rpid", rpid.toLong()) - putExtra("root", root.toLong()) - putExtra("parent", parent.toLong()) - putExtra("ctime", ctime.toLong()) - putExtra("comment_text", commentText) - if (pictures != null) - putExtra("pictures", pictures) - putExtra("source_id", sourceId) - putExtra("uid", uid.toLong()) - putStringArrayListExtra("cookies", ArrayList(cookies)) - } - startActivity(intent) - } catch (_: Exception) { - } - } - "linkVerifySettings" -> { val uri = ("package:" + context.packageName).toUri() try { @@ -131,15 +92,6 @@ class MainActivity : AudioServiceActivity() { result.success(false) } - "setPipAutoEnterEnabled" -> { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { - val params = PictureInPictureParams.Builder() - .setAutoEnterEnabled(call.argument("autoEnable") ?: false) - .build() - setPictureInPictureParams(params) - } - } - "createShortcut" -> { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { try { @@ -189,14 +141,6 @@ class MainActivity : AudioServiceActivity() { startActivity(intent) } - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { - window.attributes.layoutInDisplayCutoutMode = - LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES - } - } - override fun onDestroy() { stopService(Intent(this, com.ryanheise.audioservice.AudioService::class.java)) super.onDestroy() diff --git a/lib/common/skeleton/dynamic_card.dart b/lib/common/skeleton/dynamic_card.dart index 98eff05ad..33796f101 100644 --- a/lib/common/skeleton/dynamic_card.dart +++ b/lib/common/skeleton/dynamic_card.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/common/skeleton/skeleton.dart'; import 'package:PiliPlus/utils/global_data.dart'; import 'package:flutter/material.dart'; @@ -16,99 +15,97 @@ class DynamicCardSkeleton extends StatelessWidget { alpha: 0.2, ), ); - return Skeleton( - child: Container( - padding: const EdgeInsets.only(left: 12, right: 12, top: 12), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 8, - color: theme.dividerColor.withValues(alpha: 0.05), - ), + return Container( + padding: const EdgeInsets.only(left: 12, right: 12, top: 12), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 8, + color: theme.dividerColor.withValues(alpha: 0.05), ), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - width: 40, - height: 40, - decoration: BoxDecoration( + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: color, + borderRadius: const BorderRadius.all(Radius.circular(20)), + ), + ), + const SizedBox(width: 10), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( color: color, - borderRadius: const BorderRadius.all(Radius.circular(20)), + width: 100, + height: 13, + margin: const EdgeInsets.only(bottom: 5), ), - ), - const SizedBox(width: 10), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - color: color, - width: 100, - height: 13, - margin: const EdgeInsets.only(bottom: 5), + Container( + color: color, + width: 50, + height: 11, + ), + ], + ), + ], + ), + const SizedBox(height: 10), + Container( + color: color, + width: double.infinity, + height: 13, + margin: const EdgeInsets.only(bottom: 7), + ), + Container( + color: color, + width: double.infinity, + height: 13, + margin: const EdgeInsets.only(bottom: 7), + ), + Container( + color: color, + width: 300, + height: 13, + margin: const EdgeInsets.only(bottom: 7), + ), + Container( + color: color, + width: 250, + height: 13, + margin: const EdgeInsets.only(bottom: 7), + ), + Container( + color: color, + width: 100, + height: 13, + margin: const EdgeInsets.only(bottom: 7), + ), + if (GlobalData.dynamicsWaterfallFlow) const Spacer(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: const ['转发', '评论', '点赞'] + .map( + (e) => TextButton.icon( + onPressed: () {}, + icon: const Icon( + Icons.radio_button_unchecked_outlined, + size: 20, ), - Container( - color: color, - width: 50, - height: 11, - ), - ], - ), - ], - ), - const SizedBox(height: 10), - Container( - color: color, - width: double.infinity, - height: 13, - margin: const EdgeInsets.only(bottom: 7), - ), - Container( - color: color, - width: double.infinity, - height: 13, - margin: const EdgeInsets.only(bottom: 7), - ), - Container( - color: color, - width: 300, - height: 13, - margin: const EdgeInsets.only(bottom: 7), - ), - Container( - color: color, - width: 250, - height: 13, - margin: const EdgeInsets.only(bottom: 7), - ), - Container( - color: color, - width: 100, - height: 13, - margin: const EdgeInsets.only(bottom: 7), - ), - if (GlobalData.dynamicsWaterfallFlow) const Spacer(), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: const ['转发', '评论', '点赞'] - .map( - (e) => TextButton.icon( - onPressed: () {}, - icon: const Icon( - Icons.radio_button_unchecked_outlined, - size: 20, - ), - style: buttonStyle, - label: Text(e), - ), - ) - .toList(), - ), - ], - ), + style: buttonStyle, + label: Text(e), + ), + ) + .toList(), + ), + ], ), ); } diff --git a/lib/common/skeleton/fav_pgc_item.dart b/lib/common/skeleton/fav_pgc_item.dart index 2704b3ee0..845e37292 100644 --- a/lib/common/skeleton/fav_pgc_item.dart +++ b/lib/common/skeleton/fav_pgc_item.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/common/skeleton/skeleton.dart'; import 'package:PiliPlus/common/style.dart'; import 'package:PiliPlus/common/widgets/flutter/layout_builder.dart'; import 'package:flutter/material.dart' hide LayoutBuilder; @@ -9,58 +8,56 @@ class FavPgcItemSkeleton extends StatelessWidget { @override Widget build(BuildContext context) { final color = Theme.of(context).colorScheme.onInverseSurface; - return Skeleton( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: Style.safeSpace, - vertical: 5, - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: 3 / 4, - child: LayoutBuilder( - builder: (context, boxConstraints) { - return Container( - decoration: BoxDecoration( - color: color, - borderRadius: const BorderRadius.all(Radius.circular(4)), - ), - width: boxConstraints.maxWidth, - height: boxConstraints.maxHeight, - ); - }, - ), + return Padding( + padding: const EdgeInsets.symmetric( + horizontal: Style.safeSpace, + vertical: 5, + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: 3 / 4, + child: LayoutBuilder( + builder: (context, boxConstraints) { + return Container( + decoration: BoxDecoration( + color: color, + borderRadius: const BorderRadius.all(Radius.circular(4)), + ), + width: boxConstraints.maxWidth, + height: boxConstraints.maxHeight, + ); + }, ), - const SizedBox(width: 10), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 175, - height: 12, - color: color, - ), - const SizedBox(height: 10), - Container( - width: 55, - height: 11, - color: color, - ), - const SizedBox(height: 5), - Container( - width: 35, - height: 11, - color: color, - ), - ], - ), + ), + const SizedBox(width: 10), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 175, + height: 12, + color: color, + ), + const SizedBox(height: 10), + Container( + width: 55, + height: 11, + color: color, + ), + const SizedBox(height: 5), + Container( + width: 35, + height: 11, + color: color, + ), + ], ), - ], - ), + ), + ], ), ); } diff --git a/lib/common/skeleton/media_bangumi.dart b/lib/common/skeleton/media_bangumi.dart index eeeabcfda..c2ec5888c 100644 --- a/lib/common/skeleton/media_bangumi.dart +++ b/lib/common/skeleton/media_bangumi.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/common/skeleton/skeleton.dart'; import 'package:PiliPlus/common/style.dart'; import 'package:flutter/material.dart'; @@ -13,69 +12,67 @@ class _MediaPgcSkeletonState extends State { @override Widget build(BuildContext context) { Color bgColor = Theme.of(context).colorScheme.onInverseSurface; - return Skeleton( - child: Padding( - padding: const .symmetric( - horizontal: Style.safeSpace, - vertical: 7, - ), - child: Row( - children: [ - Container( - width: 111, + return Padding( + padding: const .symmetric( + horizontal: Style.safeSpace, + vertical: 7, + ), + child: Row( + children: [ + Container( + width: 111, + height: 148, + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(Radius.circular(6)), + color: bgColor, + ), + ), + const SizedBox(width: 10), + Expanded( + child: SizedBox( height: 148, - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(6)), - color: bgColor, - ), - ), - const SizedBox(width: 10), - Expanded( - child: SizedBox( - height: 148, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - color: bgColor, - width: 200, - height: 20, - margin: const EdgeInsets.only(bottom: 15), - ), - Container( - color: bgColor, - width: 150, - height: 13, - margin: const EdgeInsets.only(bottom: 5), - ), - Container( - color: bgColor, - width: 150, - height: 13, - margin: const EdgeInsets.only(bottom: 5), - ), - Container( - color: bgColor, - width: 150, - height: 13, - ), - const Spacer(), - Container( - width: 90, - height: 35, - decoration: BoxDecoration( - borderRadius: const BorderRadius.all( - Radius.circular(20), - ), - color: bgColor, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: bgColor, + width: 200, + height: 20, + margin: const EdgeInsets.only(bottom: 15), + ), + Container( + color: bgColor, + width: 150, + height: 13, + margin: const EdgeInsets.only(bottom: 5), + ), + Container( + color: bgColor, + width: 150, + height: 13, + margin: const EdgeInsets.only(bottom: 5), + ), + Container( + color: bgColor, + width: 150, + height: 13, + ), + const Spacer(), + Container( + width: 90, + height: 35, + decoration: BoxDecoration( + borderRadius: const BorderRadius.all( + Radius.circular(20), ), + color: bgColor, ), - ], - ), + ), + ], ), ), - ], - ), + ), + ], ), ); } diff --git a/lib/common/skeleton/msg_feed_sys_msg_.dart b/lib/common/skeleton/msg_feed_sys_msg_.dart index 613547455..8df8f3963 100644 --- a/lib/common/skeleton/msg_feed_sys_msg_.dart +++ b/lib/common/skeleton/msg_feed_sys_msg_.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/common/skeleton/skeleton.dart'; import 'package:flutter/material.dart'; class MsgFeedSysMsgSkeleton extends StatelessWidget { @@ -7,46 +6,44 @@ class MsgFeedSysMsgSkeleton extends StatelessWidget { @override Widget build(BuildContext context) { final color = Theme.of(context).colorScheme.onInverseSurface; - return Skeleton( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 125, - height: 16, - color: color, - ), - const SizedBox(height: 6), - Container( - width: double.infinity, - height: 12, - color: color, - ), - const SizedBox(height: 4), - Container( - width: double.infinity, - height: 12, - color: color, - ), - const SizedBox(height: 4), - Container( + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 125, + height: 16, + color: color, + ), + const SizedBox(height: 6), + Container( + width: double.infinity, + height: 12, + color: color, + ), + const SizedBox(height: 4), + Container( + width: double.infinity, + height: 12, + color: color, + ), + const SizedBox(height: 4), + Container( + width: 100, + height: 12, + color: color, + ), + const SizedBox(height: 4), + Align( + alignment: Alignment.centerRight, + child: Container( width: 100, - height: 12, + height: 10, color: color, ), - const SizedBox(height: 4), - Align( - alignment: Alignment.centerRight, - child: Container( - width: 100, - height: 10, - color: color, - ), - ), - ], - ), + ), + ], ), ); } diff --git a/lib/common/skeleton/msg_feed_top.dart b/lib/common/skeleton/msg_feed_top.dart index 012b7f19f..f4a272ffc 100644 --- a/lib/common/skeleton/msg_feed_top.dart +++ b/lib/common/skeleton/msg_feed_top.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/common/skeleton/skeleton.dart'; import 'package:flutter/material.dart'; class MsgFeedTopSkeleton extends StatelessWidget { @@ -7,30 +6,28 @@ class MsgFeedTopSkeleton extends StatelessWidget { @override Widget build(BuildContext context) { final color = Theme.of(context).colorScheme.onInverseSurface; - return Skeleton( - child: ListTile( - leading: Container( - width: 45, - height: 45, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: color, - ), - ), - title: UnconstrainedBox( - alignment: Alignment.centerLeft, - child: Container( - width: 100, - height: 11, - color: color, - ), - ), - subtitle: Container( + return ListTile( + leading: Container( + width: 45, + height: 45, + decoration: BoxDecoration( + shape: BoxShape.circle, color: color, - width: 125, - height: 11, ), ), + title: UnconstrainedBox( + alignment: Alignment.centerLeft, + child: Container( + width: 100, + height: 11, + color: color, + ), + ), + subtitle: Container( + color: color, + width: 125, + height: 11, + ), ); } } diff --git a/lib/common/skeleton/skeleton.dart b/lib/common/skeleton/skeleton.dart deleted file mode 100644 index d8b75fd81..000000000 --- a/lib/common/skeleton/skeleton.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'dart:ui' as ui; - -import 'package:flutter/material.dart'; - -class Skeleton extends StatefulWidget { - final Widget child; - - const Skeleton({super.key, required this.child}); - - @override - State createState() => _SkeletonState(); -} - -class _SkeletonState extends State - with SingleTickerProviderStateMixin { - late final AnimationController _controller; - late Color color; - final matrix = Matrix4.identity(); - - @override - void initState() { - super.initState(); - _controller = AnimationController.unbounded(vsync: this) - ..repeat(min: -0.5, max: 1.5, period: const Duration(milliseconds: 1000)) - ..addListener(_setState); - } - - @override - void dispose() { - _controller.dispose(); - super.dispose(); - } - - void _setState() { - setState(() {}); - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - color = ColorScheme.of(context).surface.withAlpha(10); - } - - @override - Widget build(BuildContext context) { - final colors = [Colors.transparent, color, color, Colors.transparent]; - return ShaderMask( - blendMode: BlendMode.srcATop, - shaderCallback: (Rect bounds) { - final width = bounds.width; - final height = bounds.height; - matrix[12] = width * _controller.value; - return ui.Gradient.linear( - Offset(0, 0.35 * height), - Offset(width, 0.95 * height), - colors, - const [0.1, 0.3, 0.5, 0.7], - TileMode.clamp, - matrix.storage, - ); - }, - child: widget.child, - ); - } -} diff --git a/lib/common/skeleton/space_opus.dart b/lib/common/skeleton/space_opus.dart index 2d34fea8e..761b91e71 100644 --- a/lib/common/skeleton/space_opus.dart +++ b/lib/common/skeleton/space_opus.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/common/skeleton/skeleton.dart'; import 'package:PiliPlus/common/widgets/flutter/layout_builder.dart'; import 'package:PiliPlus/utils/utils.dart'; import 'package:flutter/material.dart' hide LayoutBuilder; @@ -9,43 +8,41 @@ class SpaceOpusSkeleton extends StatelessWidget { @override Widget build(BuildContext context) { final surface = Theme.of(context).colorScheme.onInverseSurface; - return Skeleton( - child: Card( - clipBehavior: Clip.hardEdge, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(6)), - ), - child: LayoutBuilder( - builder: (context, constraints) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - height: - (0.68 + 0.82 * Utils.random.nextDouble()) * - constraints.maxWidth, - color: surface, + return Card( + clipBehavior: Clip.hardEdge, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(6)), + ), + child: LayoutBuilder( + builder: (context, constraints) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: + (0.68 + 0.82 * Utils.random.nextDouble()) * + constraints.maxWidth, + color: surface, + ), + Container( + height: 10, + color: surface, + margin: const EdgeInsets.all(10), + width: constraints.maxWidth * 0.7, + ), + Container( + height: 10, + color: surface, + margin: const EdgeInsets.only( + left: 10, + right: 10, + bottom: 10, ), - Container( - height: 10, - color: surface, - margin: const EdgeInsets.all(10), - width: constraints.maxWidth * 0.7, - ), - Container( - height: 10, - color: surface, - margin: const EdgeInsets.only( - left: 10, - right: 10, - bottom: 10, - ), - width: constraints.maxWidth, - ), - ], - ); - }, - ), + width: constraints.maxWidth, + ), + ], + ); + }, ), ); } diff --git a/lib/common/skeleton/video_card_h.dart b/lib/common/skeleton/video_card_h.dart index e328a6cd1..6228979d4 100644 --- a/lib/common/skeleton/video_card_h.dart +++ b/lib/common/skeleton/video_card_h.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/common/skeleton/skeleton.dart'; import 'package:PiliPlus/common/style.dart'; import 'package:flutter/material.dart'; @@ -8,69 +7,67 @@ class VideoCardHSkeleton extends StatelessWidget { @override Widget build(BuildContext context) { final color = Theme.of(context).colorScheme.onInverseSurface; - return Skeleton( - child: Padding( - padding: const .symmetric( - horizontal: Style.safeSpace, - vertical: 5, - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: Style.aspectRatio, - child: DecoratedBox( - decoration: BoxDecoration( - color: color, - borderRadius: Style.mdRadius, - ), + return Padding( + padding: const .symmetric( + horizontal: Style.safeSpace, + vertical: 5, + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: Style.aspectRatio, + child: DecoratedBox( + decoration: BoxDecoration( + color: color, + borderRadius: Style.mdRadius, ), ), - Expanded( - child: Padding( - padding: const .fromLTRB(10, 4, 6, 4), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - color: color, - width: 200, - height: 11, - margin: const EdgeInsets.only(bottom: 5), - ), - Container( - color: color, - width: 150, - height: 13, - ), - const Spacer(), - Container( - color: color, - width: 100, - height: 13, - margin: const EdgeInsets.only(bottom: 5), - ), - Row( - children: [ - Container( - color: color, - width: 40, - height: 13, - margin: const EdgeInsets.only(right: 8), - ), - Container( - color: color, - width: 40, - height: 13, - ), - ], - ), - ], - ), + ), + Expanded( + child: Padding( + padding: const .fromLTRB(10, 4, 6, 4), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: color, + width: 200, + height: 11, + margin: const EdgeInsets.only(bottom: 5), + ), + Container( + color: color, + width: 150, + height: 13, + ), + const Spacer(), + Container( + color: color, + width: 100, + height: 13, + margin: const EdgeInsets.only(bottom: 5), + ), + Row( + children: [ + Container( + color: color, + width: 40, + height: 13, + margin: const EdgeInsets.only(right: 8), + ), + Container( + color: color, + width: 40, + height: 13, + ), + ], + ), + ], ), ), - ], - ), + ), + ], ), ); } diff --git a/lib/common/skeleton/video_card_v.dart b/lib/common/skeleton/video_card_v.dart index 7a36f4d6c..ba50bb041 100644 --- a/lib/common/skeleton/video_card_v.dart +++ b/lib/common/skeleton/video_card_v.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/common/skeleton/skeleton.dart'; import 'package:PiliPlus/common/style.dart'; import 'package:flutter/material.dart'; @@ -8,57 +7,55 @@ class VideoCardVSkeleton extends StatelessWidget { @override Widget build(BuildContext context) { final color = Theme.of(context).colorScheme.onInverseSurface; - return Skeleton( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: Style.aspectRatio, - child: DecoratedBox( - decoration: BoxDecoration( + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: Style.aspectRatio, + child: DecoratedBox( + decoration: BoxDecoration( + color: color, + borderRadius: Style.mdRadius, + ), + ), + ), + Padding( + // 多列 + padding: const EdgeInsets.fromLTRB(4, 5, 6, 6), + // 单列 + // padding: const EdgeInsets.fromLTRB(14, 10, 4, 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // const SizedBox(height: 6), + Container( + width: 200, + height: 13, + margin: const EdgeInsets.only(bottom: 5), color: color, - borderRadius: Style.mdRadius, ), - ), + Container( + width: 150, + height: 13, + margin: const EdgeInsets.only(bottom: 12), + color: color, + ), + Container( + width: 110, + height: 13, + margin: const EdgeInsets.only(bottom: 5), + color: color, + ), + Container( + width: 75, + height: 13, + color: color, + ), + ], ), - Padding( - // 多列 - padding: const EdgeInsets.fromLTRB(4, 5, 6, 6), - // 单列 - // padding: const EdgeInsets.fromLTRB(14, 10, 4, 8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // const SizedBox(height: 6), - Container( - width: 200, - height: 13, - margin: const EdgeInsets.only(bottom: 5), - color: color, - ), - Container( - width: 150, - height: 13, - margin: const EdgeInsets.only(bottom: 12), - color: color, - ), - Container( - width: 110, - height: 13, - margin: const EdgeInsets.only(bottom: 5), - color: color, - ), - Container( - width: 75, - height: 13, - color: color, - ), - ], - ), - ), - ], - ), + ), + ], ); } } diff --git a/lib/common/skeleton/video_reply.dart b/lib/common/skeleton/video_reply.dart index 849064bd4..6774b0010 100644 --- a/lib/common/skeleton/video_reply.dart +++ b/lib/common/skeleton/video_reply.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/common/skeleton/skeleton.dart'; import 'package:flutter/material.dart'; class VideoReplySkeleton extends StatelessWidget { @@ -7,81 +6,79 @@ class VideoReplySkeleton extends StatelessWidget { @override Widget build(BuildContext context) { Color bgColor = Theme.of(context).colorScheme.onInverseSurface; - return Skeleton( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(12, 8, 8, 2), - child: Row( - children: [ - ClipOval( - child: Container( - width: 34, - height: 34, + return Column( + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(12, 8, 8, 2), + child: Row( + children: [ + ClipOval( + child: Container( + width: 34, + height: 34, + color: bgColor, + ), + ), + const SizedBox(width: 12), + Container( + width: 80, + height: 13, + color: bgColor, + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.only( + top: 4, + left: 57, + right: 6, + bottom: 6, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 300, + height: 14, + margin: const EdgeInsets.only(bottom: 4), + color: bgColor, + ), + Container( + width: 180, + height: 14, + margin: const EdgeInsets.only(bottom: 10), + color: bgColor, + ), + Row( + children: [ + Container( + width: 40, + height: 14, + margin: const EdgeInsets.only(bottom: 4), color: bgColor, ), - ), - const SizedBox(width: 12), - Container( - width: 80, - height: 13, - color: bgColor, - ), - ], - ), + const Spacer(), + Container( + width: 30, + height: 14, + margin: const EdgeInsets.only(bottom: 4), + color: bgColor, + ), + const SizedBox(width: 8), + Container( + width: 30, + height: 14, + margin: const EdgeInsets.only(bottom: 4), + color: bgColor, + ), + const SizedBox(width: 8), + ], + ), + ], ), - Padding( - padding: const EdgeInsets.only( - top: 4, - left: 57, - right: 6, - bottom: 6, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 300, - height: 14, - margin: const EdgeInsets.only(bottom: 4), - color: bgColor, - ), - Container( - width: 180, - height: 14, - margin: const EdgeInsets.only(bottom: 10), - color: bgColor, - ), - Row( - children: [ - Container( - width: 40, - height: 14, - margin: const EdgeInsets.only(bottom: 4), - color: bgColor, - ), - const Spacer(), - Container( - width: 30, - height: 14, - margin: const EdgeInsets.only(bottom: 4), - color: bgColor, - ), - const SizedBox(width: 8), - Container( - width: 30, - height: 14, - margin: const EdgeInsets.only(bottom: 4), - color: bgColor, - ), - const SizedBox(width: 8), - ], - ), - ], - ), - ), - ], - ), + ), + ], ); } } diff --git a/lib/common/skeleton/whisper_item.dart b/lib/common/skeleton/whisper_item.dart index dfb9275c1..f02fa89e4 100644 --- a/lib/common/skeleton/whisper_item.dart +++ b/lib/common/skeleton/whisper_item.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/common/skeleton/skeleton.dart'; import 'package:flutter/material.dart'; class WhisperItemSkeleton extends StatelessWidget { @@ -7,35 +6,33 @@ class WhisperItemSkeleton extends StatelessWidget { @override Widget build(BuildContext context) { final color = Theme.of(context).colorScheme.onInverseSurface; - return Skeleton( - child: ListTile( - leading: Container( - width: 45, - height: 45, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: color, - ), - ), - title: UnconstrainedBox( - alignment: Alignment.centerLeft, - child: Container( - width: 100, - height: 11, - color: color, - ), - ), - subtitle: Container( + return ListTile( + leading: Container( + width: 45, + height: 45, + decoration: BoxDecoration( + shape: BoxShape.circle, color: color, - width: 125, - height: 11, ), - trailing: Container( + ), + title: UnconstrainedBox( + alignment: Alignment.centerLeft, + child: Container( + width: 100, + height: 11, color: color, - width: 50, - height: 11, ), ), + subtitle: Container( + color: color, + width: 125, + height: 11, + ), + trailing: Container( + color: color, + width: 50, + height: 11, + ), ); } } diff --git a/lib/common/widgets/video_card/video_card_h.dart b/lib/common/widgets/video_card/video_card_h.dart index 5cd1f01ce..4387ada78 100644 --- a/lib/common/widgets/video_card/video_card_h.dart +++ b/lib/common/widgets/video_card/video_card_h.dart @@ -21,12 +21,10 @@ class VideoCardH extends StatelessWidget { super.key, required this.videoItem, this.onTap, - this.onViewLater, this.onRemove, }); final HorizontalVideoModel videoItem; final VoidCallback? onTap; - final ValueChanged? onViewLater; final VoidCallback? onRemove; @override diff --git a/lib/pages/live/view.dart b/lib/pages/live/view.dart index 36df3ce0d..db3733c88 100644 --- a/lib/pages/live/view.dart +++ b/lib/pages/live/view.dart @@ -50,30 +50,27 @@ class _LivePageState extends State Widget build(BuildContext context) { super.build(context); final ThemeData theme = Theme.of(context); - return Container( - clipBehavior: Clip.hardEdge, - margin: const EdgeInsets.symmetric(horizontal: Style.safeSpace), - decoration: const BoxDecoration(borderRadius: Style.mdRadius), - child: refreshIndicator( - onRefresh: controller.onRefresh, - child: CustomScrollView( - controller: controller.scrollController, - physics: const AlwaysScrollableScrollPhysics(), - slivers: [ - SliverPadding( - padding: const EdgeInsets.only( - top: Style.cardSpace, - bottom: 100, - ), - sliver: SliverMainAxisGroup( - slivers: [ - Obx(() => _buildTop(theme, controller.topState.value)), - Obx(() => _buildBody(theme, controller.loadingState.value)), - ], - ), + return refreshIndicator( + onRefresh: controller.onRefresh, + child: CustomScrollView( + controller: controller.scrollController, + physics: const AlwaysScrollableScrollPhysics(), + slivers: [ + SliverPadding( + padding: const .only( + left: Style.cardSpace, + top: Style.cardSpace, + right: Style.cardSpace, + bottom: 100, ), - ], - ), + sliver: SliverMainAxisGroup( + slivers: [ + Obx(() => _buildTop(theme, controller.topState.value)), + Obx(() => _buildBody(theme, controller.loadingState.value)), + ], + ), + ), + ], ), ); } diff --git a/lib/pages/rcmd/view.dart b/lib/pages/rcmd/view.dart index a31633691..5b8aa7293 100644 --- a/lib/pages/rcmd/view.dart +++ b/lib/pages/rcmd/view.dart @@ -29,24 +29,24 @@ class _RcmdPageState extends State Widget build(BuildContext context) { super.build(context); final colorScheme = ColorScheme.of(context); - return Container( - clipBehavior: .hardEdge, - margin: const .symmetric(horizontal: Style.safeSpace), - decoration: const BoxDecoration(borderRadius: Style.mdRadius), - child: refreshIndicator( - onRefresh: controller.onRefresh, - child: CustomScrollView( - controller: controller.scrollController, - physics: const AlwaysScrollableScrollPhysics(), - slivers: [ - SliverPadding( - padding: const .only(top: Style.cardSpace, bottom: 100), - sliver: Obx( - () => _buildBody(colorScheme, controller.loadingState.value), - ), + return refreshIndicator( + onRefresh: controller.onRefresh, + child: CustomScrollView( + controller: controller.scrollController, + physics: const AlwaysScrollableScrollPhysics(), + slivers: [ + SliverPadding( + padding: const .only( + left: Style.safeSpace, + top: Style.cardSpace, + right: Style.safeSpace, + bottom: 100, ), - ], - ), + sliver: Obx( + () => _buildBody(colorScheme, controller.loadingState.value), + ), + ), + ], ), ); } diff --git a/lib/pages/video/reply/widgets/reply_item_grpc.dart b/lib/pages/video/reply/widgets/reply_item_grpc.dart index 6e39165fb..233d95659 100644 --- a/lib/pages/video/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/reply/widgets/reply_item_grpc.dart @@ -291,6 +291,7 @@ class ReplyItemGrpc extends StatelessWidget { padding: padding, child: custom_text.Text.rich( primary: theme.colorScheme.primary, + maxLines: replyLevel == 1 ? 6 : null, style: TextStyle( height: 1.75, fontSize: theme.textTheme.bodyMedium!.fontSize,