Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 47 additions & 27 deletions SubscriberCount/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,43 @@
"ar" : {
"stringUnit" : {
"state" : "translated",
"value" : "- أضف قناة في التطبيق، ثم انقر على هذه الواجهة أثناء التحرير"
"value" : "- أضف قناة في التطبيق، ثم اضغط على هذه الأداة أثناء تعديلها"
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "- Fügen Sie einen Kanal in der App hinzu und tippen Sie dann auf dieses Widget, während Sie es bearbeiten"
"value" : "- Fügen Sie zuerst in der App einen Kanal hinzu und tippen Sie dann beim Bearbeiten auf dieses Widget"
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "- Agrega un canal en la aplicación, luego toca este widget mientras lo editas"
"value" : "- Agrega un canal en la app y luego toca este widget mientras lo editas"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "- Ajoutez une chaîne dans l'application, puis touchez ce widget en cours de modification"
"value" : "- Ajoutez d’abord une chaîne dans l’app, puis touchez ce widget pendant sa modification"
}
},
"hi" : {
"stringUnit" : {
"state" : "translated",
"value" : "- ऐप में एक चैनल जोड़ें, फिर संपादन के दौरान इस विजेट को टैप करें"
"value" : "- पहले ऐप में एक चैनल जोड़ें, फिर एडिट करते समय इस विजेट पर टैप करें"
}
},
"pt-BR" : {
"stringUnit" : {
"state" : "translated",
"value" : "- Adicione um canal no aplicativo e depois toque neste widget enquanto edita"
"value" : "- Adicione um canal no app e depois toque neste widget enquanto o estiver editando"
}
},
"ta" : {
"stringUnit" : {
"state" : "translated",
"value" : "- செயலியில் ஒரு சேனலைச் சேர்க்கவும், பின்னர் இந்த விஜெட்டை திருத்தும்போது தட்டவும்"
"value" : "- முதலில் செயலியில் ஒரு சேனலைச் சேர்க்கவும், பின்னர் திருத்தும் போது இந்த விட்ஜெட்டைத் தட்டவும்"
}
}
}
Expand Down Expand Up @@ -239,25 +239,25 @@
"ar" : {
"stringUnit" : {
"state" : "translated",
"value" : "أضف قناة في التطبيق"
"value" : "أضف قناة داخل التطبيق"
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Fügen Sie einen Kanal in der App hinzu"
"value" : "Fügen Sie in der App einen Kanal hinzu"
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "Agrega un canal en la aplicación"
"value" : "Agrega un canal en la app"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Ajoutez une chaîne dans l'application"
"value" : "Ajoutez une chaîne dans l’app"
}
},
"hi" : {
Expand All @@ -269,7 +269,7 @@
"pt-BR" : {
"stringUnit" : {
"state" : "translated",
"value" : "Adicione um canal no aplicativo"
"value" : "Adicione um canal no app"
}
},
"ta" : {
Expand All @@ -281,6 +281,7 @@
}
},
"Currently, you can add up to 10 channels. If you would like to add more, please contact me using the link in Settings and I will increase the limit." : {
"extractionState" : "stale",
"localizations" : {
"ar" : {
"stringUnit" : {
Expand Down Expand Up @@ -377,13 +378,13 @@
"ar" : {
"stringUnit" : {
"state" : "translated",
"value" : "احصل على SubWidget Pro لاستخدام هذا الودجت"
"value" : "احصل على SubWidget Pro لاستخدام هذه الأداة"
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Hol dir SubWidget Pro, um dieses Widget zu nutzen"
"value" : "Hol dir SubWidget Pro, um dieses Widget zu verwenden"
}
},
"es" : {
Expand All @@ -395,13 +396,13 @@
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Obtenez SubWidget Pro pour utiliser ce widget"
"value" : "Passez à SubWidget Pro pour utiliser ce widget"
}
},
"hi" : {
"stringUnit" : {
"state" : "translated",
"value" : "इस विजेट का उपयोग करने के लिए SubWidget Pro लें"
"value" : "इस विजेट का उपयोग करने के लिए SubWidget Pro प्राप्त करें"
}
},
"pt-BR" : {
Expand All @@ -413,7 +414,7 @@
"ta" : {
"stringUnit" : {
"state" : "translated",
"value" : "இந்த விட்ஜெட்டை பயன்படுத்த SubWidget Pro பெறுங்கள்"
"value" : "இந்த விட்ஜெட்டை பயன்படுத்த SubWidget Pro ஐப் பெறுங்கள்"
}
}
}
Expand All @@ -423,13 +424,13 @@
"ar" : {
"stringUnit" : {
"state" : "translated",
"value" : "استمر في الضغط وانقر على 'تحرير الواجهة'"
"value" : "اضغط مطولاً ثم اضغط على 'تحرير الأداة'"
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Halten und tippen Sie auf 'Widget bearbeiten'"
"value" : "Gedrückt halten und auf 'Widget bearbeiten' tippen"
}
},
"es" : {
Expand All @@ -450,7 +451,7 @@
"other" : {
"stringUnit" : {
"state" : "translated",
"value" : "Maintenez enfoncé et appuyez sur 'Modifier le widget'"
"value" : "Maintenez le doigt puis touchez « Modifier le widget »"
}
}
}
Expand All @@ -459,19 +460,19 @@
"hi" : {
"stringUnit" : {
"state" : "translated",
"value" : "'एडिट विजेट' पर टैप करके रखें"
"value" : "दबाकर रखें, फिर 'एडिट विजेट' पर टैप करें"
}
},
"pt-BR" : {
"stringUnit" : {
"state" : "translated",
"value" : "Segure e toque em 'Editar Widget'"
"value" : "Toque e segure, depois toque em 'Editar Widget'"
}
},
"ta" : {
"stringUnit" : {
"state" : "translated",
"value" : "'விஜெட்டை திருத்து' என்று தட்டி அழுத்தவும்"
"value" : "அழுத்திப் பிடித்து, பின்னர் 'விட்ஜெட்டைத் திருத்து' என்பதைத் தட்டவும்"
}
}
}
Expand Down Expand Up @@ -567,6 +568,9 @@
}
}
}
},
"How do I delete a channel?" : {

},
"How many channels can I add?" : {
"localizations" : {
Expand Down Expand Up @@ -637,7 +641,7 @@
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Choisissez la fréquence de mise à jour du nombre d'abonnés"
"value" : "À quelle fréquence le nombre d'abonnés est-il mis à jour ?"
}
},
"hi" : {
Expand Down Expand Up @@ -751,6 +755,12 @@
}
}
}
},
"My question is not listed here." : {

},
"Please contact me from the settings screen and I will answer any question you have. I typically respond within a few hours!." : {

},
"Please remove the widget from your homescreen and add it back." : {
"localizations" : {
Expand Down Expand Up @@ -797,8 +807,12 @@
}
}
}
},
"Restores the widget's colors to the defaults - White in light mode and black in dark mode." : {

},
"Restores the widget's colors to the defaults." : {
"extractionState" : "stale",
"localizations" : {
"ar" : {
"stringUnit" : {
Expand Down Expand Up @@ -879,7 +893,7 @@
"pt-BR" : {
"stringUnit" : {
"state" : "translated",
"value" : "Selecione Seu Canal"
"value" : "Selecione seu canal"
}
},
"ta" : {
Expand Down Expand Up @@ -981,6 +995,9 @@
}
}
}
},
"Swipe right on the channel to delete it" : {

},
"Tap and hold anywhere on your homescreen and tap the plus button in the top left. Look for SubWidget and add it to your homescreen. Finally, tap and hold on the widget and select your channel." : {
"localizations" : {
Expand Down Expand Up @@ -1355,7 +1372,7 @@
"ar" : {
"stringUnit" : {
"state" : "translated",
"value" : "فتح القفل"
"value" : "افتح"
}
},
"de" : {
Expand Down Expand Up @@ -1391,7 +1408,7 @@
"ta" : {
"stringUnit" : {
"state" : "translated",
"value" : "திறக்கவும்"
"value" : "திற"
}
}
}
Expand Down Expand Up @@ -1671,6 +1688,9 @@
}
}
}
},
"With SubWidget Pro, you can add up to 10 channels. If you would like to add more, please contact me using the link in Settings and I will increase the limit." : {

},
"You can request a feature using the Wishlist tab below." : {
"localizations" : {
Expand Down
15 changes: 13 additions & 2 deletions SubscriberCount/SubWidgetIntentTimelineProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ struct SimpleEntry: TimelineEntry {
let channelImage: UIImage
let widgetType: WidgetType

init(channel: YouTubeChannel?, channelImage: UIImage = UIImage(systemName: "person.circle")!, widgetType: WidgetType) {
init(
channel: YouTubeChannel?,
channelImage: UIImage = UIImage(systemName: "person.circle")!,
widgetType: WidgetType
) {
self.channel = channel
self.channelImage = channelImage
self.widgetType = widgetType
Expand Down Expand Up @@ -54,7 +58,14 @@ struct SubWidgetIntentTimelineProvider: IntentTimelineProvider {
if configuration.channel == nil {
// Show first channel in add widget screen if exists
let channels = channelStorageService.getChannels()
if !channels.isEmpty {
if channels.isEmpty {
let entry = SimpleEntry(
channel: nil,
widgetType: widgetType
)

completion(entry)
} else {
let entry = SimpleEntry(
channel: channels[0],
channelImage: await getImageForUrl(channels[0].profileImage),
Expand Down
25 changes: 18 additions & 7 deletions SubscriberCount/Views/LockscreenWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ struct LockscreenWidget: View {
entry?.channel
}

private var usesLocalPreviewImage: Bool {
channel?.profileImage.hasPrefix("OnboardingAvatar-") == true
}

var count: String {
switch entry?.widgetType {
case .subscribers:
Expand All @@ -33,13 +37,20 @@ struct LockscreenWidget: View {
if let entry = entry,
let channel = channel {
HStack {
Image(uiImage: entry.channelImage)
.resizable()
.widgetAccentedRenderingMode(.desaturated)
.aspectRatio(contentMode: .fill)
.frame(width: 40, height: 40)
.clipShape(Circle())
.shadow(radius: 2)
if Utils.isInWidget() || usesLocalPreviewImage {
Image(uiImage: entry.channelImage)
.resizable()
.widgetAccentedRenderingMode(.desaturated)
.aspectRatio(contentMode: .fill)
.frame(width: 40, height: 40)
.clipShape(Circle())
.shadow(radius: 2)
} else {
AsyncImageView(url: URL(string: channel.profileImage))
.frame(width: 40, height: 40)
.clipShape(Circle())
.shadow(radius: 2)
}

VStack(alignment: .leading) {
Text(channel.channelName)
Expand Down
6 changes: 5 additions & 1 deletion SubscriberCount/Views/MediumWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ struct MediumWidget: View {
return .youtubeRed
}

private var usesLocalPreviewImage: Bool {
channel?.profileImage.hasPrefix("OnboardingAvatar-") == true
}

var body: some View {
ZStack {
if let entry = entry,
let channel = channel {
HStack {
if Utils.isInWidget() {
if Utils.isInWidget() || usesLocalPreviewImage {
Image(uiImage: entry.channelImage)
.resizable()
.widgetAccentedRenderingMode(.desaturated)
Expand Down
6 changes: 5 additions & 1 deletion SubscriberCount/Views/SmallWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ struct SmallWidget: View {
return .youtubeRed
}

private var usesLocalPreviewImage: Bool {
channel?.profileImage.hasPrefix("OnboardingAvatar-") == true
}

var body: some View {
ZStack {
if let entry = entry,
Expand All @@ -63,7 +67,7 @@ struct SmallWidget: View {

VStack(alignment: .leading) {
HStack {
if Utils.isInWidget() {
if Utils.isInWidget() || usesLocalPreviewImage {
Image(uiImage: entry.channelImage)
.resizable()
.widgetAccentedRenderingMode(.desaturated)
Expand Down
Loading