Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Render legacy kit listing icon without asset lookup

Neeraj Gupta6796ea003873
diff --git a/mobile/apps/locker/assets/legacy_kit_favourite_circle.svg b/mobile/apps/locker/assets/legacy_kit_favourite_circle.svg
deleted file mode 100644
index 9d18a08729..0000000000
--- a/mobile/apps/locker/assets/legacy_kit_favourite_circle.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
- <g transform="translate(2.25 1.5)">
- <path d="M8.25 15.7501L6.54546 15.7501C4.09955 15.7501 2.8766 15.7501 2.0273 15.1517C1.78397 14.9802 1.56794 14.7769 1.38578 14.5479C0.750001 13.7486 0.750001 12.5976 0.750001 10.2955L0.750001 8.38643C0.750001 6.16405 0.750002 5.05287 1.1017 4.16538C1.66711 2.73864 2.86285 1.61323 4.37877 1.08108C5.32172 0.750071 6.50236 0.75007 8.86364 0.750071C10.2129 0.750071 10.8876 0.750071 11.4264 0.939222C12.2927 1.24331 12.9759 1.88639 13.299 2.70168C13.5 3.20881 13.5 3.84378 13.5 5.11371L13.5 6.75007" stroke="#1071FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="M0.75 8.25007C0.750001 6.86936 1.86929 5.75007 3.25 5.75007C3.74934 5.75007 4.33803 5.83757 4.82352 5.70748C5.25489 5.59189 5.59182 5.25496 5.70741 4.82359C5.8375 4.3381 5.75 3.74941 5.75 3.25007C5.75 1.86936 6.86929 0.750071 8.25 0.750071" stroke="#1071FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
- </g>
- <path d="M9.85601 10.0817C10.7611 9.53338 11.551 9.75434 12.0255 10.1063C12.2201 10.2506 12.3174 10.3228 12.3746 10.3228C12.4319 10.3228 12.5291 10.2506 12.7237 10.1063C13.1983 9.75434 13.9882 9.53338 14.8932 10.0817C16.081 10.8013 16.3498 13.1753 13.61 15.1781C13.0882 15.5596 12.8273 15.7503 12.3746 15.7503C11.922 15.7503 11.6611 15.5596 11.1392 15.1781C8.39945 13.1753 8.66822 10.8013 9.85601 10.0817Z" stroke="#1071FF" stroke-width="1.5" stroke-linecap="round"/>
-</svg>
diff --git a/mobile/packages/legacy/lib/pages/emergency_page.dart b/mobile/packages/legacy/lib/pages/emergency_page.dart
index a526adf398..d942298f07 100644
--- a/mobile/packages/legacy/lib/pages/emergency_page.dart
+++ b/mobile/packages/legacy/lib/pages/emergency_page.dart
@@ -30,7 +30,6 @@ import "package:ente_ui/theme/text_style.dart";
import "package:ente_ui/utils/toast_util.dart";
import "package:flutter/foundation.dart";
import "package:flutter/material.dart";
-import "package:flutter_svg/flutter_svg.dart";
import "package:intl/intl.dart";
import "package:logging/logging.dart";
@@ -1044,16 +1043,84 @@ class _LegacyKitLeadingIcon extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return Center(
- child: SvgPicture.asset(
- "assets/legacy_kit_favourite_circle.svg",
- width: 18,
- height: 18,
+ return const Center(
+ child: CustomPaint(
+ size: Size.square(18),
+ painter: _LegacyKitLeadingIconPainter(),
),
);
}
}
+class _LegacyKitLeadingIconPainter extends CustomPainter {
+ const _LegacyKitLeadingIconPainter();
+
+ static const _color = Color(0xFF1071FF);
+
+ @override
+ void paint(Canvas canvas, Size size) {
+ final scale = size.width / 18;
+ final strokePaint = Paint()
+ ..color = _color
+ ..style = PaintingStyle.stroke
+ ..strokeWidth = 1.5 * scale
+ ..strokeCap = StrokeCap.round
+ ..strokeJoin = StrokeJoin.round;
+
+ canvas.save();
+ canvas.scale(scale);
+ canvas.translate(2.25, 1.5);
+ canvas.drawPath(
+ Path()
+ ..moveTo(8.25, 15.7501)
+ ..lineTo(6.54546, 15.7501)
+ ..cubicTo(4.09955, 15.7501, 2.8766, 15.7501, 2.0273, 15.1517)
+ ..cubicTo(1.78397, 14.9802, 1.56794, 14.7769, 1.38578, 14.5479)
+ ..cubicTo(0.750001, 13.7486, 0.750001, 12.5976, 0.750001, 10.2955)
+ ..lineTo(0.750001, 8.38643)
+ ..cubicTo(0.750001, 6.16405, 0.750002, 5.05287, 1.1017, 4.16538)
+ ..cubicTo(1.66711, 2.73864, 2.86285, 1.61323, 4.37877, 1.08108)
+ ..cubicTo(5.32172, 0.750071, 6.50236, 0.75007, 8.86364, 0.750071)
+ ..cubicTo(10.2129, 0.750071, 10.8876, 0.750071, 11.4264, 0.939222)
+ ..cubicTo(12.2927, 1.24331, 12.9759, 1.88639, 13.299, 2.70168)
+ ..cubicTo(13.5, 3.20881, 13.5, 3.84378, 13.5, 5.11371)
+ ..lineTo(13.5, 6.75007),
+ strokePaint,
+ );
+ canvas.drawPath(
+ Path()
+ ..moveTo(0.75, 8.25007)
+ ..cubicTo(0.750001, 6.86936, 1.86929, 5.75007, 3.25, 5.75007)
+ ..cubicTo(3.74934, 5.75007, 4.33803, 5.83757, 4.82352, 5.70748)
+ ..cubicTo(5.25489, 5.59189, 5.59182, 5.25496, 5.70741, 4.82359)
+ ..cubicTo(5.8375, 4.3381, 5.75, 3.74941, 5.75, 3.25007)
+ ..cubicTo(5.75, 1.86936, 6.86929, 0.750071, 8.25, 0.750071),
+ strokePaint,
+ );
+ canvas.restore();
+
+ canvas.save();
+ canvas.scale(scale);
+ canvas.drawPath(
+ Path()
+ ..moveTo(9.85601, 10.0817)
+ ..cubicTo(10.7611, 9.53338, 11.551, 9.75434, 12.0255, 10.1063)
+ ..cubicTo(12.2201, 10.2506, 12.3174, 10.3228, 12.3746, 10.3228)
+ ..cubicTo(12.4319, 10.3228, 12.5291, 10.2506, 12.7237, 10.1063)
+ ..cubicTo(13.1983, 9.75434, 13.9882, 9.53338, 14.8932, 10.0817)
+ ..cubicTo(16.081, 10.8013, 16.3498, 13.1753, 13.61, 15.1781)
+ ..cubicTo(13.0882, 15.5596, 12.8273, 15.7503, 12.3746, 15.7503)
+ ..cubicTo(11.922, 15.7503, 11.6611, 15.5596, 11.1392, 15.1781)
+ ..cubicTo(8.39945, 13.1753, 8.66822, 10.8013, 9.85601, 10.0817),
+ strokePaint,
+ );
+ canvas.restore();
+ }
+
+ @override
+ bool shouldRepaint(_LegacyKitLeadingIconPainter oldDelegate) => false;
+}
+
class _WarningBanner extends StatelessWidget {
final String text;