Remove custom indicators

This commit is contained in:
Marcin Czachurski 2023-10-22 12:33:43 +02:00
parent a05e9bee48
commit a510d0d0c2
11 changed files with 17 additions and 126 deletions

View File

@ -8785,98 +8785,6 @@
}
}
},
"thirdparty.loaders.address" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "https://github.com/exyte/ActivityIndicatorView"
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "https://github.com/exyte/ActivityIndicatorView"
}
},
"eu" : {
"stringUnit" : {
"state" : "translated",
"value" : "https://github.com/exyte/ActivityIndicatorView"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "https://github.com/exyte/ActivityIndicatorView"
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
"value" : "https://github.com/exyte/ActivityIndicatorView"
}
}
}
},
"thirdparty.loaders.description" : {
"comment" : "A number of preset loading indicators created with SwiftUI.",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "A number of preset loading indicators created with SwiftUI."
}
},
"es" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "Una serie de indicadores de carga preestablecidos creados con SwiftUI."
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
"value" : "Szereg gotowych animacji ładowania utworzonych za pomocą SwiftUI."
}
}
}
},
"thirdparty.loaders.title" : {
"comment" : "Loaders section title",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "ActivityIndicatorView"
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"value" : "ActivityIndicatorView"
}
},
"eu" : {
"stringUnit" : {
"state" : "translated",
"value" : "ActivityIndicatorView"
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "ActivityIndicatorView"
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
"value" : "ActivityIndicatorView"
}
}
}
},
"thirdParty.navigationBar.title" : {
"comment" : "Third party view.",
"localizations" : {

View File

@ -1,14 +1,5 @@
{
"pins" : [
{
"identity" : "activityindicatorview",
"kind" : "remoteSourceControl",
"location" : "https://github.com/exyte/ActivityIndicatorView.git",
"state" : {
"revision" : "9970fd0bb7a05dad0b6566ae1f56937716686b24",
"version" : "1.1.1"
}
},
{
"identity" : "brightfutures",
"kind" : "remoteSourceControl",

View File

@ -82,6 +82,7 @@ struct VernissageApp: App {
self.theme = newValue.colorScheme()
}
.onChange(of: applicationState.tintColor) { oldValue, newValue in
UIRefreshControl.appearance().tintColor = self.applicationState.tintColor.uiColor()
self.tintColor = newValue.color()
}
.onChange(of: applicationState.account) { oldValue, newValue in
@ -108,6 +109,7 @@ struct VernissageApp: App {
private func onApplicationStart() async {
UIPageControl.appearance().currentPageIndicatorTintColor = UIColor.white.withAlphaComponent(0.7)
UIPageControl.appearance().pageIndicatorTintColor = UIColor.white.withAlphaComponent(0.4)
UIRefreshControl.appearance().tintColor = self.applicationState.tintColor.uiColor()
// Configure TipKit.
try? Tips.configure([.displayFrequency(.daily), .datastoreLocation(.applicationDefault)])

View File

@ -123,7 +123,9 @@ struct EditProfileView: View {
UserAvatar(accountAvatar: account.avatar, size: .large)
}
LoadingIndicator(isVisible: $saveDisabled)
if saveDisabled {
LoadingIndicator()
}
BottomRight {
Button {

View File

@ -61,16 +61,6 @@ struct ThirdPartyView: View {
.font(.footnote)
}
Section("thirdparty.loaders.title") {
VStack(alignment: .leading) {
Link("thirdparty.loaders.address",
destination: URL(string: "https://github.com/exyte/ActivityIndicatorView")!)
.padding(.bottom, 4)
Text("thirdparty.loaders.description", comment: "A number of preset loading indicators created with SwiftUI.")
}
.font(.footnote)
}
Section("thirdparty.htmlstring.title") {
VStack(alignment: .leading) {
Link("thirdparty.htmlstring.address",

View File

@ -17,7 +17,6 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/exyte/ActivityIndicatorView.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/divadretlaw/EmojiText", .upToNextMajor(from: "2.6.0")),
.package(url: "https://github.com/kean/Nuke", .upToNextMajor(from: "12.0.0")),
.package(name: "PixelfedKit", path: "../PixelfedKit"),
@ -31,7 +30,6 @@ let package = Package(
.target(
name: "WidgetsKit",
dependencies: [
.product(name: "ActivityIndicatorView", package: "ActivityIndicatorView"),
.product(name: "Nuke", package: "Nuke"),
.product(name: "NukeUI", package: "Nuke"),
.product(name: "EmojiText", package: "EmojiText"),

View File

@ -51,7 +51,7 @@ public struct ImageUploadView: View {
} else if photoAttachment.uploadedAttachment == nil {
ZStack {
self.imageView(showAccessories: false, blur: true)
LoadingIndicator(isVisible: Binding.constant(true))
LoadingIndicator()
}
} else {
self.imageView(showAccessories: true, blur: false)

View File

@ -62,7 +62,7 @@ public struct PlaceSelectorView: View {
if self.showLoader {
HStack(alignment: .center) {
Spacer()
LoadingIndicator(isVisible: Binding.constant(true))
LoadingIndicator()
Spacer()
}
}

View File

@ -46,7 +46,7 @@ public struct ActionButton<Label>: View where Label: View {
@ViewBuilder
private func withLoader() -> some View {
if isDuringAction {
LoadingIndicator(isVisible: .constant(true))
LoadingIndicator()
.transition(.opacity)
} else {
label()

View File

@ -25,7 +25,7 @@ public struct ActionMenu<Label: View, Content: View>: View {
content()
} label: {
if isDuringAction {
LoadingIndicator(isVisible: .constant(true))
LoadingIndicator()
.transition(.opacity)
} else {
label()

View File

@ -5,26 +5,26 @@
//
import SwiftUI
import ActivityIndicatorView
import EnvironmentKit
public struct LoadingIndicator: View {
@Environment(ApplicationState.self) var applicationState
@Binding var isVisible: Bool
public init(isVisible: Binding<Bool> = .constant(true)) {
self._isVisible = isVisible
private let controlSize: ControlSize
public init(controlSize: ControlSize = .regular) {
self.controlSize = controlSize
}
public var body: some View {
ActivityIndicatorView(isVisible: $isVisible, type: .equalizer(count: 5))
.frame(width: 24.0, height: 16.0)
.foregroundColor(applicationState.tintColor.color())
ProgressView()
.tint(applicationState.tintColor.color())
.controlSize(self.controlSize)
}
}
struct LoadingIndicator_Previews: PreviewProvider {
static var previews: some View {
LoadingIndicator(isVisible: .constant(true))
LoadingIndicator()
}
}