replace icon image with system SF Font

This commit is contained in:
ryanzhao 2023-03-07 13:54:21 +11:00
parent 1b744e9bc2
commit f3c79007d8
12 changed files with 10 additions and 641 deletions

View File

@ -630,8 +630,8 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
let hasUnread: Bool = (threadViewModel.threadUnreadCount ?? 0) > 0
let mark: UIContextualAction = UIContextualAction(
title: ((hasUnread) ? "mark_read_button_text".localized() : "mark_unread_button_text".localized()),
icon: ((hasUnread) ? UIImage(named: "icon_mark_read") : UIImage(named: "icon_mark_unread")),
iconHeight: Values.mediumFontSize,
icon: ((hasUnread) ? UIImage(systemName: "envelope.open") : UIImage(systemName: "envelope.badge")),
iconHeight: Values.smallFontSize,
themeTintColor: .textPrimary,
themeBackgroundColor: .conversationButton_swipeDestructive,
side: .trailing,
@ -689,7 +689,7 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
let pin: UIContextualAction = UIContextualAction(
title: (threadViewModel.threadIsPinned ? "UNPIN_BUTTON_TEXT".localized() : "PIN_BUTTON_TEXT".localized()),
icon: UIImage(named: "icon_pin"),
icon: UIImage(systemName: "pin"),
iconHeight: Values.mediumFontSize,
themeTintColor: .textPrimary,
themeBackgroundColor: .conversationButton_swipeDestructive,
@ -716,7 +716,7 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
let mute: UIContextualAction = UIContextualAction(
title: ((threadViewModel.threadMutedUntilTimestamp != nil) ? "unmute_button_text".localized() : "mute_button_text".localized()),
icon: UIImage(named: "icon_mute"),
icon: UIImage(systemName: "speaker.slash"),
iconHeight: Values.mediumFontSize,
themeTintColor: .textPrimary,
themeBackgroundColor: .conversationButton_swipeDestructive,
@ -759,8 +759,8 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
case .contact:
let delete: UIContextualAction = UIContextualAction(
title: "TXT_DELETE_TITLE".localized(),
icon: UIImage(named: "icon_bin"),
iconHeight: Values.smallFontSize,
icon: UIImage(named: "icon_bin")?.resizedImage(to: CGSize(width: Values.mediumFontSize, height: Values.mediumFontSize)),
iconHeight: Values.mediumFontSize,
themeTintColor: .textPrimary,
themeBackgroundColor: .conversationButton_swipeDestructive,
side: .trailing,
@ -801,7 +801,7 @@ final class HomeVC: BaseVC, UITableViewDataSource, UITableViewDelegate, SeedRemi
case .openGroup, .closedGroup:
let leave: UIContextualAction = UIContextualAction(
title: "LEAVE_BUTTON_TITLE".localized(),
icon: UIImage(named: "icon_leave"),
icon: UIImage(systemName: "rectangle.portrait.and.arrow.right"),
iconHeight: Values.mediumFontSize,
themeTintColor: .textPrimary,
themeBackgroundColor: .conversationButton_swipeDestructive,

View File

@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "Group 21.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,115 +0,0 @@
%PDF-1.7
1 0 obj
<< >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
-1.000000 0.000000 -0.000000 -1.000000 13.681108 22.054058 cm
1.000000 1.000000 1.000000 scn
0.000000 8.699632 m
0.000000 2.779560 l
0.000000 1.114012 1.164413 0.000002 2.902360 0.000002 c
10.825995 0.000002 l
12.538525 0.000002 13.681101 1.114012 13.681101 2.781368 c
13.681101 19.272701 l
13.681101 20.941874 12.538525 22.054058 10.825995 22.054058 c
2.902360 22.054058 l
1.164413 22.054058 0.000000 20.941874 0.000000 19.274517 c
0.000000 13.337048 l
1.977312 13.337048 l
1.977312 18.819965 l
1.977312 19.588516 2.433078 20.022297 3.241149 20.022297 c
10.451877 20.022297 l
11.249847 20.022297 11.705621 19.584885 11.705621 18.818157 c
11.705621 3.235851 l
11.705621 2.469200 11.249847 2.031755 10.451877 2.031755 c
3.241149 2.031755 l
2.433078 2.031755 1.977312 2.465502 1.977312 3.234045 c
1.977312 8.699632 l
0.000000 8.699632 l
h
f
n
Q
q
1.000000 -0.000000 0.000000 1.000000 6.456984 6.532265 cm
1.000000 1.000000 1.000000 scn
0.854047 3.650497 m
9.973925 3.650497 l
11.921844 3.749533 l
9.937829 1.989250 l
9.383045 1.430826 l
9.235626 1.271473 9.126730 1.047242 9.126730 0.808298 c
9.126730 0.331357 9.478227 0.000003 9.940446 0.000003 c
10.176593 0.000003 10.389956 0.087940 10.547450 0.247207 c
14.110446 3.806581 l
14.335536 4.023411 14.448080 4.265796 14.448080 4.493468 c
14.448080 4.722947 14.335536 4.980132 14.110446 5.190423 c
10.547450 8.741562 l
10.389956 8.900881 10.176593 8.988800 9.940446 8.988800 c
9.478227 8.988800 9.126730 8.657471 9.126730 8.186983 c
9.126730 7.939745 9.231996 7.725583 9.383045 7.566264 c
9.937829 6.997773 l
11.921844 5.245663 l
9.973925 5.346506 l
0.854047 5.346506 l
0.340408 5.346506 0.000000 4.944596 0.000000 4.493468 c
0.000000 4.044147 0.340408 3.650497 0.854047 3.650497 c
h
f
n
Q
endstream
endobj
3 0 obj
1767
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 20.905060 22.054062 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000034 00000 n
0000001857 00000 n
0000001880 00000 n
0000002053 00000 n
0000002127 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
2186
%%EOF

View File

@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "Vector.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,115 +0,0 @@
%PDF-1.7
1 0 obj
<< >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
1.000000 1.000000 1.000000 scn
2.855198 -0.000004 m
16.669914 -0.000004 l
18.550127 -0.000004 19.526665 0.969404 19.526665 2.826668 c
19.526665 11.389789 l
19.526665 12.870333 19.235811 13.360014 18.252293 14.098968 c
11.707531 19.132406 l
10.997782 19.677958 10.466211 20.000000 9.762552 20.000000 c
9.060527 20.000000 8.530442 19.677958 7.819207 19.132406 c
1.274408 14.098968 l
0.295581 13.363148 0.000000 12.870333 0.000000 11.389789 c
0.000000 2.826668 l
0.000000 0.962275 0.976567 -0.000004 2.855198 -0.000004 c
h
2.851544 1.613646 m
2.040694 1.613646 1.599581 2.032692 1.599581 2.881479 c
1.599581 11.580967 l
1.599581 12.240508 1.779054 12.556168 2.225032 12.890715 c
8.729047 17.882366 l
9.139924 18.197447 9.379602 18.366127 9.762552 18.366127 c
10.139932 18.366127 10.388373 18.195879 10.797616 17.882366 c
17.298483 12.890715 l
17.744492 12.552974 17.927126 12.240508 17.927126 11.580967 c
17.927126 2.881479 l
17.927126 2.032692 17.471687 1.613646 16.673553 1.613646 c
2.851544 1.613646 l
h
1.064996 1.914450 m
2.115197 0.869879 l
8.758162 7.423330 l
9.115859 7.786597 9.427136 7.942571 9.754902 7.942571 c
10.075537 7.942571 10.388373 7.786597 10.751641 7.423330 c
17.396152 0.869879 l
18.437677 1.914450 l
11.638903 8.596021 l
11.013972 9.219392 10.398623 9.481946 9.754902 9.481946 c
9.104050 9.481946 8.495831 9.221025 7.869340 8.596021 c
1.064996 1.914450 l
h
6.495846 6.892206 m
7.547591 7.929720 l
2.146882 13.280460 l
1.103819 12.235829 l
6.495846 6.892206 l
h
11.962213 7.929720 m
13.006858 6.892206 l
18.400393 12.235829 l
17.355822 13.280460 l
11.962213 7.929720 l
h
f
n
Q
endstream
endobj
3 0 obj
1685
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 19.526665 20.000000 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000034 00000 n
0000001775 00000 n
0000001798 00000 n
0000001971 00000 n
0000002045 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
2104
%%EOF

View File

@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "Group 1.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,119 +0,0 @@
%PDF-1.7
1 0 obj
<< >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
1.000000 1.000000 1.000000 scn
2.787199 -0.000020 m
16.486496 -0.000020 l
18.115294 -0.000020 19.061613 0.946370 19.061613 2.759328 c
19.061613 9.586817 l
18.574244 9.380354 18.049170 9.293177 17.500172 9.318328 c
17.500172 2.805877 l
17.500172 1.982740 17.055578 1.575270 16.276453 1.575270 c
2.783631 1.575270 l
1.992093 1.575270 1.561486 1.982742 1.561486 2.812838 c
1.561486 12.095173 l
1.561486 12.916785 1.992093 13.325809 2.783631 13.325809 c
13.469756 13.325809 l
13.425384 13.865679 13.517972 14.419136 13.721417 14.901062 c
2.573595 14.901062 l
0.946341 14.901062 0.000000 13.961681 0.000000 12.148694 c
0.000000 2.759328 l
0.000000 0.939410 0.953309 -0.000020 2.787199 -0.000020 c
h
9.543965 5.139557 m
10.172357 5.139557 10.773123 5.402818 11.383170 6.002787 c
15.382624 9.937387 l
14.974646 10.187351 14.615897 10.528234 14.331102 10.912272 c
10.517039 7.147622 l
10.162351 6.794528 9.856965 6.640747 9.543965 6.640747 c
9.224007 6.640747 8.927103 6.794528 8.570965 7.147622 c
1.860897 13.775782 l
0.852536 12.740739 l
7.703311 6.002787 l
8.314881 5.401222 8.908615 5.139557 9.543965 5.139557 c
h
17.196671 1.166564 m
18.221004 2.188725 l
12.303679 8.048771 l
11.291525 7.022915 l
17.196671 1.166564 l
h
1.986481 1.267200 m
7.645381 6.878778 l
6.625601 7.895498 l
0.966048 2.286241 l
1.986481 1.267200 l
h
f
n
Q
q
1.000000 0.000000 -0.000000 1.000000 14.652039 10.501404 cm
1.000000 1.000000 1.000000 scn
2.929153 0.000005 m
4.535837 0.000005 5.865195 1.329370 5.865195 2.936068 c
5.865195 4.542760 4.535837 5.872131 2.929153 5.872131 c
1.322396 5.872131 0.000000 4.542760 0.000000 2.936068 c
0.000000 1.329370 1.322396 0.000005 2.929153 0.000005 c
h
f
n
Q
endstream
endobj
3 0 obj
1758
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 20.517242 16.373535 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000034 00000 n
0000001848 00000 n
0000001871 00000 n
0000002044 00000 n
0000002118 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
2177
%%EOF

View File

@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "Group (1).pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,108 +0,0 @@
%PDF-1.7
1 0 obj
<< >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 1.777191 1.065613 cm
1.000000 1.000000 1.000000 scn
1.965486 4.165290 m
4.480973 4.165290 l
4.556003 4.165290 4.618963 4.140318 4.676248 4.090298 c
8.573530 0.603346 l
9.041570 0.191758 9.389591 0.000002 9.855134 0.000002 c
10.269597 0.000002 10.612472 0.202731 10.824432 0.550527 c
9.383916 1.983778 l
5.464605 5.521886 l
5.282459 5.686324 5.161677 5.726583 4.919939 5.726583 c
2.115349 5.726583 l
1.813488 5.726583 1.672305 5.869378 1.672305 6.162385 c
1.672305 9.702625 l
0.387879 10.985455 l
0.140821 10.674543 0.000000 10.221214 0.000000 9.624583 c
0.000000 6.215356 l
0.000000 4.840144 0.665267 4.165290 1.965486 4.165290 c
h
10.992882 5.767370 m
10.994472 14.682869 l
10.994472 15.337503 10.509784 15.863373 9.840604 15.863373 c
9.381418 15.863373 9.070704 15.660295 8.568763 15.214769 c
4.854671 11.916056 l
5.977557 10.789121 l
9.057764 13.588398 l
9.100519 13.631145 9.152128 13.654552 9.203737 13.654552 c
9.268968 13.654552 9.322166 13.608618 9.322166 13.527208 c
9.322166 7.441264 l
10.992882 5.767370 l
h
f
n
Q
q
1.000000 0.000000 -0.000000 1.000000 0.000107 -0.138275 cm
1.000000 1.000000 1.000000 scn
15.717578 0.344515 m
15.993180 0.070501 16.450928 0.068913 16.716087 0.344515 c
16.990101 0.625868 16.991690 1.067497 16.716087 1.341510 c
1.213316 16.844282 l
0.937698 17.119900 0.479934 17.119900 0.204318 16.844282 c
-0.068106 16.577534 -0.068106 16.112497 0.204318 15.845750 c
15.717578 0.344515 l
h
f
n
Q
endstream
endobj
3 0 obj
1493
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 16.922302 18.003113 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000034 00000 n
0000001583 00000 n
0000001606 00000 n
0000001779 00000 n
0000001853 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
1912
%%EOF

View File

@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "Group.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,108 +0,0 @@
%PDF-1.7
1 0 obj
<< >>
endobj
2 0 obj
<< /Length 3 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000061 0.000000 cm
1.000000 1.000000 1.000000 scn
5.862790 0.000008 m
6.062284 0.000008 6.593354 1.049471 6.593354 2.096780 c
6.593354 6.267460 l
5.127457 6.267460 l
5.127457 2.096780 l
5.127457 1.049471 5.658547 0.000008 5.862790 0.000008 c
h
1.157771 5.602798 m
10.563084 5.602798 l
11.267075 5.602798 11.720842 6.047764 11.720842 6.720025 c
11.720842 8.963408 9.209062 11.171642 5.862790 11.171642 c
2.511775 11.171642 0.000000 8.963408 0.000000 6.720025 c
0.000000 6.047764 0.453757 5.602798 1.157771 5.602798 c
h
1.497385 6.857010 m
1.346727 6.857010 1.281856 6.944154 1.308873 7.119138 c
1.488177 8.448398 3.233897 9.955872 5.862790 9.955872 c
8.486959 9.955872 10.232621 8.448398 10.411976 7.119138 c
10.438954 6.944154 10.374103 6.857010 10.223438 6.857010 c
1.497385 6.857010 l
h
0.942546 16.760296 m
0.942546 16.527699 1.038284 16.258003 1.240602 15.997648 c
1.617765 15.500992 2.499754 14.807369 3.452244 14.178015 c
3.174973 10.149855 l
4.498692 10.149855 l
4.777298 14.771296 l
4.784721 14.895235 4.761865 14.951048 4.667609 14.998844 c
3.659894 15.519547 2.877798 16.120106 2.762320 16.281898 c
2.701610 16.369028 2.752972 16.432411 2.831940 16.432411 c
8.888859 16.432411 l
8.967833 16.432411 9.019195 16.369028 8.958523 16.281898 c
8.843007 16.120106 8.060929 15.519547 7.053202 14.998844 c
6.965045 14.951048 6.936103 14.895235 6.949593 14.771296 c
7.222106 10.149855 l
8.545856 10.149855 l
8.268592 14.178015 l
9.227174 14.807369 10.103045 15.500992 10.480247 15.997648 c
10.688606 16.258003 10.784363 16.527699 10.784363 16.760296 c
10.784363 17.250416 10.407479 17.609772 9.853267 17.609772 c
1.873662 17.609772 l
1.313332 17.609772 0.942546 17.250416 0.942546 16.760296 c
h
f
n
Q
endstream
endobj
3 0 obj
1770
endobj
4 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 11.720917 18.003113 ]
/Resources 1 0 R
/Contents 2 0 R
/Parent 5 0 R
>>
endobj
5 0 obj
<< /Kids [ 4 0 R ]
/Count 1
/Type /Pages
>>
endobj
6 0 obj
<< /Pages 5 0 R
/Type /Catalog
>>
endobj
xref
0 7
0000000000 65535 f
0000000010 00000 n
0000000034 00000 n
0000001860 00000 n
0000001883 00000 n
0000002056 00000 n
0000002130 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 6 0 R
/Size 7
>>
startxref
2189
%%EOF

View File

@ -69,16 +69,10 @@ public extension UIContextualAction {
stackView.spacing = 4
if let icon: UIImage = icon {
let scale: Double = iconHeight / icon.size.height
let aspectRatio: CGFloat = (icon.size.width / icon.size.height)
let imageView: UIImageView = UIImageView(
image: icon.resizedImage(
to: CGSize(
width: iconHeight * aspectRatio,
height: iconHeight
)
)
)
imageView.frame = CGRect(x: 0, y: 0, width: (iconHeight * aspectRatio), height: iconHeight)
let imageView: UIImageView = UIImageView(image: icon)
imageView.frame = CGRect(x: 0, y: 0, width: iconHeight * aspectRatio, height: iconHeight)
imageView.contentMode = .scaleAspectFit
imageView.themeTintColor = themeTintColor
stackView.addArrangedSubview(imageView)