Mercurial > public > lazybear
changeset 228:74686b4a0fde
Add new logos
line wrap: on
line diff
--- a/LazyBear/Assets.xcassets/Alternative icon/angryIcon.imageset/Contents.json Sun Feb 28 18:38:48 2021 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "angry.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Assets.xcassets/Alternative icon/blueIcon.imageset/Contents.json Mon Mar 01 18:42:03 2021 +0000 @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "blue.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Assets.xcassets/Alternative icon/graffitiIcon.imageset/Contents.json Mon Mar 01 18:42:03 2021 +0000 @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "graffiti.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
Binary file LazyBear/Assets.xcassets/Alternative icon/graffitiIcon.imageset/graffiti.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Assets.xcassets/Alternative icon/greenIcon.imageset/Contents.json Mon Mar 01 18:42:03 2021 +0000 @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "green.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Assets.xcassets/Alternative icon/matteBlackIcon.imageset/Contents.json Mon Mar 01 18:42:03 2021 +0000 @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "matteBlack.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
Binary file LazyBear/Assets.xcassets/Alternative icon/matteBlackIcon.imageset/matteBlack.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Assets.xcassets/Alternative icon/matteWhiteIcon.imageset/Contents.json Mon Mar 01 18:42:03 2021 +0000 @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "matteWhite.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
Binary file LazyBear/Assets.xcassets/Alternative icon/matteWhiteIcon.imageset/matteWhite.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Assets.xcassets/Alternative icon/pinkIcon.imageset/Contents.json Mon Mar 01 18:42:03 2021 +0000 @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "pink.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Assets.xcassets/Alternative icon/redIcon.imageset/Contents.json Mon Mar 01 18:42:03 2021 +0000 @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "red.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- a/LazyBear/Info.plist Sun Feb 28 18:38:48 2021 +0000 +++ b/LazyBear/Info.plist Mon Mar 01 18:42:03 2021 +0000 @@ -12,15 +12,69 @@ <dict> <key>CFBundleAlternateIcons</key> <dict> - <key>angryIcon</key> + <key>blueIcon</key> <dict> <key>CFBundleIconFiles</key> <array> - <string>angry.png</string> + <string>blue.png</string> </array> <key>UIPrerenderedIcon</key> <false/> </dict> + <key>greenIcon</key> + <dict> + <key>CFBundleIconFiles</key> + <array> + <string>green.png</string> + </array> + <key>UIPrerenderedIcon</key> + <false/> + </dict> + <key>pinkIcon</key> + <dict> + <key>CFBundleIconFiles</key> + <array> + <string>pink.png</string> + </array> + <key>UIPrerenderedIcon</key> + <false/> + </dict> + <key>redIcon</key> + <dict> + <key>CFBundleIconFiles</key> + <array> + <string>red.png</string> + </array> + <key>UIPrerenderedIcon</key> + <false/> + </dict> + <key>matteBlackIcon</key> + <dict> + <key>CFBundleIconFiles</key> + <array> + <string>matteBlack.png</string> + </array> + <key>UIPrerenderedIcon</key> + <false/> + </dict> + <key>matteWhiteIcon</key> + <dict> + <key>CFBundleIconFiles</key> + <array> + <string>matteWhite.png</string> + </array> + <key>UIPrerenderedIcon</key> + <false/> + </dict> + <key>graffitiIcon</key> + <dict> + <key>CFBundleIconFiles</key> + <array> + <string>graffiti.png</string> + </array> + <key>UIPrerenderedIcon</key> + <false/> + </dict> </dict> <key>CFBundlePrimaryIcon</key> <dict>
--- a/LazyBear/Models/IconModel.swift Sun Feb 28 18:38:48 2021 +0000 +++ b/LazyBear/Models/IconModel.swift Mon Mar 01 18:42:03 2021 +0000 @@ -10,4 +10,5 @@ struct IconModel: Codable, Hashable { var name: String var file: String + var background: Bool }
--- a/LazyBear/Resources/alternativeIcons.json Sun Feb 28 18:38:48 2021 +0000 +++ b/LazyBear/Resources/alternativeIcons.json Mon Mar 01 18:42:03 2021 +0000 @@ -1,10 +1,42 @@ [ { "name": "Default", - "file": "defaultIcon" + "file": "defaultIcon", + "background": false + }, + { + "name": "Blue", + "file": "blueIcon", + "background": false + }, + { + "name": "Green", + "file": "greenIcon", + "background": false + }, + { + "name": "Pink", + "file": "pinkIcon", + "background": false }, { - "name": "Angry bear", - "file": "angryIcon" + "name": "Red", + "file": "redIcon", + "background": false + }, + { + "name": "Matte black", + "file": "matteBlackIcon", + "background": true + }, + { + "name": "Matte white", + "file": "matteWhiteIcon", + "background": false + }, + { + "name": "Graffiti", + "file": "graffitiIcon", + "background": false } ]
--- a/LazyBear/UI/IconPicker.swift Sun Feb 28 18:38:48 2021 +0000 +++ b/LazyBear/UI/IconPicker.swift Mon Mar 01 18:42:03 2021 +0000 @@ -9,21 +9,44 @@ struct IconPicker: View { var body: some View { - List(icons, id:\.name) { icon in - Button(action: { changeIcon(key: icon.file) }) { - HStack { - Image(icon.file) - .resizable() - .cornerRadius(20) - .frame(width: 70, height: 70) - - Text(icon.name) + List { + Section(header: Text("Without background")) { + ForEach(icons, id: \.name) { icon in + if !icon.background { + IconRow(icon: icon) + } + } + } + + Section(header: Text("With background")) { + ForEach(icons, id: \.name) { icon in + if icon.background { + IconRow(icon: icon) + } } } - .buttonStyle(PlainButtonStyle()) } .listStyle(GroupedListStyle()) } +} + +struct IconRow: View { + @Environment(\.colorScheme) var colorScheme // Detect dark mode + var icon: IconModel + + var body: some View { + Button(action: { changeIcon(key: icon.file) }) { + HStack { + Image(icon.file) + .resizable() + .cornerRadius(20) + .frame(width: 70, height: 70) + + Text(icon.name) + .foregroundColor(colorScheme == .dark ? .white: .black) + } + } + } private func changeIcon(key: String) { if key != "defaultIcon" {