Skip to content
Merged
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
19 changes: 19 additions & 0 deletions iosApp/Flare.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
0646B2622E7151A700535A3E /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 0646B2612E7151A700535A3E /* Kingfisher */; };
068923482E82A80700981D8E /* Flow in Frameworks */ = {isa = PBXBuildFile; productRef = 068923472E82A80700981D8E /* Flow */; };
068F7CD12E75405A00B5FB40 /* MarkdownUI in Frameworks */ = {isa = PBXBuildFile; productRef = 068F7CD02E75405A00B5FB40 /* MarkdownUI */; };
06C7FC172E7D474900A0D01A /* LazyPager in Frameworks */ = {isa = PBXBuildFile; productRef = 06C7FC162E7D474900A0D01A /* LazyPager */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -42,6 +43,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
068923482E82A80700981D8E /* Flow in Frameworks */,
06C7FC172E7D474900A0D01A /* LazyPager in Frameworks */,
068F7CD12E75405A00B5FB40 /* MarkdownUI in Frameworks */,
0646B2622E7151A700535A3E /* Kingfisher in Frameworks */,
Expand Down Expand Up @@ -91,6 +93,7 @@
0646B2612E7151A700535A3E /* Kingfisher */,
068F7CD02E75405A00B5FB40 /* MarkdownUI */,
06C7FC162E7D474900A0D01A /* LazyPager */,
068923472E82A80700981D8E /* Flow */,
);
productName = flare;
productReference = 06E433FE2E6A9A2600CD0826 /* Flare.app */;
Expand Down Expand Up @@ -125,6 +128,7 @@
068F7CCF2E75405A00B5FB40 /* XCRemoteSwiftPackageReference "swift-markdown-ui" */,
06791BD42E7AA40000FF2050 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */,
06C7FC152E7D474900A0D01A /* XCRemoteSwiftPackageReference "LazyPager" */,
068923462E82A80700981D8E /* XCRemoteSwiftPackageReference "SwiftUI-Flow" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 06E433FF2E6A9A2600CD0826 /* Products */;
Expand Down Expand Up @@ -317,6 +321,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = flare/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Flare;
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down Expand Up @@ -355,6 +360,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = flare/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Flare;
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down Expand Up @@ -419,6 +425,14 @@
version = 0.61.0;
};
};
068923462E82A80700981D8E /* XCRemoteSwiftPackageReference "SwiftUI-Flow" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/tevelee/SwiftUI-Flow";
requirement = {
kind = exactVersion;
version = 3.1.1;
};
};
068F7CCF2E75405A00B5FB40 /* XCRemoteSwiftPackageReference "swift-markdown-ui" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/gonzalezreal/swift-markdown-ui";
Expand All @@ -443,6 +457,11 @@
package = 0646B2602E7151A700535A3E /* XCRemoteSwiftPackageReference "Kingfisher" */;
productName = Kingfisher;
};
068923472E82A80700981D8E /* Flow */ = {
isa = XCSwiftPackageProductDependency;
package = 068923462E82A80700981D8E /* XCRemoteSwiftPackageReference "SwiftUI-Flow" */;
productName = Flow;
};
068F7CD02E75405A00B5FB40 /* MarkdownUI */ = {
isa = XCSwiftPackageProductDependency;
package = 068F7CCF2E75405A00B5FB40 /* XCRemoteSwiftPackageReference "swift-markdown-ui" */;
Expand Down
36 changes: 36 additions & 0 deletions iosApp/flare/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"strings" : {
"" : {

},
"#loading" : {

},
"%@" : {

Expand All @@ -21,6 +24,18 @@
},
"ai_config_title" : {

},
"all_feeds_section_explore_feeds" : {

},
"all_feeds_section_my_feeds" : {

},
"all_feeds_title" : {

},
"all_lists_title" : {

},
"ALT" : {

Expand Down Expand Up @@ -96,6 +111,18 @@
}
}
}
},
"discover_status" : {

},
"discover_tags" : {

},
"discover_title" : {

},
"discover_users" : {

},
"dm_list_title" : {
"localizations" : {
Expand Down Expand Up @@ -913,6 +940,15 @@
}
}
}
},
"search_status" : {

},
"search_title" : {

},
"search_users" : {

},
"sensitive_button_show" : {
"comment" : "Button to show sensitive media"
Expand Down
6 changes: 3 additions & 3 deletions iosApp/flare/UI/Component/AdaptiveGrid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ struct AdaptiveGrid: Layout {
}
}

private func heightForGridFillLastRow(width width: CGFloat, count n: Int, cols: Int, spacing s: CGFloat) -> CGFloat {
private func heightForGridFillLastRow(width: CGFloat, count n: Int, cols: Int, spacing: CGFloat) -> CGFloat {
let rowsTotal = Int(ceil(Double(n) / Double(cols)))
let columnWidth = (width - CGFloat(cols - 1) * s) / CGFloat(cols)
return CGFloat(rowsTotal) * columnWidth + CGFloat(max(0, rowsTotal - 1)) * s
let columnWidth = (width - CGFloat(cols - 1) * spacing) / CGFloat(cols)
return CGFloat(rowsTotal) * columnWidth + CGFloat(max(0, rowsTotal - 1)) * spacing
}
}
2 changes: 2 additions & 0 deletions iosApp/flare/UI/Component/CommonProfileHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ struct MatrixView: View {
Text("matrix_followers")
}
.font(.caption)
.foregroundStyle(.secondary)
}
}

Expand All @@ -159,6 +160,7 @@ struct FieldsView: View {
let key = keys[index]
Text(key)
.font(.caption)
.foregroundStyle(.secondary)
if let richText = fields[key] {
RichText(text: richText)
.font(.body)
Expand Down
52 changes: 9 additions & 43 deletions iosApp/flare/UI/Component/PagingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,20 @@ struct PagingView<T: AnyObject, EmptyContent: View, ErrorContent: View, LoadingC
case .empty: emptyContent()
case .error(let error): errorContent(error.error)
case .loading: ForEach(0..<5) { index in
ListCardView(index: index, totalCount: 5) {
loadingContent()
.padding()
}
loadingContent()
}
case .success(let success):
ForEach(0..<success.itemCount, id: \.self) { index in
if let item = success.peek(index: index) {
ListCardView(index: Int(index), totalCount: Int(success.itemCount)) {
successContent(item)
.padding()
.onAppear {
_ = success.get(index: index)
}
}
successContent(item)
.onAppear {
_ = success.get(index: index)
}
} else {
ListCardView(index: Int(index), totalCount: Int(success.itemCount)) {
loadingContent()
.padding()
.onAppear {
_ = success.get(index: index)
}
}
loadingContent()
.onAppear {
_ = success.get(index: index)
}
}
}
}
Expand All @@ -54,29 +45,4 @@ extension PagingView {
) where ErrorContent == EmptyView, LoadingContent == EmptyView, EmptyContent == EmptyView {
self.init(data: data, emptyContent: { EmptyView() }, errorContent: {_ in EmptyView()}, loadingContent: {EmptyView()}, successContent: successContent)
}

init(
data: PagingState<UiTimeline>,
) where ErrorContent == EmptyView, EmptyContent == EmptyView, LoadingContent == TimelinePlaceholderView, SuccessContent == TimelineView, T == UiTimeline {
self.init(
data: data,
emptyContent: { EmptyView() },
errorContent: { _ in EmptyView() },
loadingContent: { TimelinePlaceholderView() },
successContent: { item in TimelineView(data: item) }
)
}

init(
data: PagingState<UiTimeline>,
detailStatusKey: MicroBlogKey?
) where ErrorContent == EmptyView, EmptyContent == EmptyView, LoadingContent == TimelinePlaceholderView, SuccessContent == TimelineView, T == UiTimeline {
self.init(
data: data,
emptyContent: { EmptyView() },
errorContent: { _ in EmptyView() },
loadingContent: { TimelinePlaceholderView() },
successContent: { item in TimelineView(data: item, detailStatusKey: detailStatusKey) }
)
}
}
1 change: 1 addition & 0 deletions iosApp/flare/UI/Component/Status/FeedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct FeedView: View {
if let desc = data.description_ {
Text(desc)
.font(.caption)
.foregroundStyle(.secondary)
}
HStack {
NetworkImage(data: data.sourceIcon)
Expand Down
2 changes: 2 additions & 0 deletions iosApp/flare/UI/Component/Status/StatusCardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ struct StatusCardView: View {
Text(desc)
.frame(maxWidth: .infinity, alignment: .leading)
.font(.caption)
.foregroundStyle(.secondary)
.lineLimit(2)
} else {
Text(data.url)
.frame(maxWidth: .infinity, alignment: .leading)
.font(.caption)
.foregroundStyle(.secondary)
.lineLimit(2)
}
}
Expand Down
2 changes: 2 additions & 0 deletions iosApp/flare/UI/Component/Status/StatusTopMessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct StatusTopMessageView: View {
.lineLimit(1)
.markdownTextStyle(\.text) {
FontSize(12)
ForegroundColor(.secondary)
}
}
if let text = topMessage.type.localizedText {
Expand All @@ -21,6 +22,7 @@ struct StatusTopMessageView: View {
}
.frame(maxWidth: .infinity, alignment: .leading)
.font(.caption)
.foregroundStyle(.secondary)
}
}

Expand Down
9 changes: 8 additions & 1 deletion iosApp/flare/UI/Component/Status/StatusView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ struct StatusView: View {
switch onEnum(of: data.topEndContent) {
case .visibility(let visibility):
StatusVisibilityView(data: visibility.visibility)
.font(.caption)
.foregroundStyle(.secondary)
case .none:
EmptyView()
}
if !isDetail {
DateTimeText(data: data.createdAt)
.font(.caption)
.foregroundStyle(.secondary)
}
}
}
Expand All @@ -55,12 +58,15 @@ struct StatusView: View {
switch onEnum(of: data.topEndContent) {
case .visibility(let visibility):
StatusVisibilityView(data: visibility.visibility)
.font(.caption)
.foregroundStyle(.secondary)
case .none:
EmptyView()
}
if !isDetail {
DateTimeText(data: data.createdAt)
.font(.caption)
.foregroundStyle(.secondary)
}
}
}
Expand All @@ -78,10 +84,10 @@ struct StatusView: View {
case .replyTo(let replyTo):
HStack {
Image("fa-reply")
.foregroundStyle(Color(.label))
Text("Reply to \(replyTo.handle)")
}
.font(.caption)
.foregroundStyle(.secondary)
}
}
if let contentWarning = data.contentWarning, !contentWarning.isEmpty {
Expand Down Expand Up @@ -147,6 +153,7 @@ struct StatusView: View {
if isDetail {
DateTimeText(data: data.createdAt, fullTime: true)
.font(.caption)
.foregroundStyle(.secondary)
}

if !isQuote {
Expand Down
2 changes: 2 additions & 0 deletions iosApp/flare/UI/Component/UserCompatView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct UserCompatView<TrailingContent: View>: View {
RichText(text: data.name)
Text(data.handle)
.font(.caption)
.foregroundStyle(.secondary)
}
.frame(maxWidth: .infinity, alignment: .leading)
trailing()
Expand Down Expand Up @@ -45,6 +46,7 @@ struct UserLoadingView: View {
Text("user name")
Text("user handle")
.font(.caption)
.foregroundStyle(.secondary)
}
.frame(maxWidth: .infinity, alignment: .leading)
}
Expand Down
1 change: 1 addition & 0 deletions iosApp/flare/UI/Component/UserOnelineView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct UserOnelineView<TrailingContent: View>: View {
RichText(text: data.name)
Text(data.handle)
.font(.caption)
.foregroundStyle(.secondary)
}
.frame(maxWidth: .infinity, alignment: .leading)
trailing()
Expand Down
2 changes: 2 additions & 0 deletions iosApp/flare/UI/Route/Route.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ enum Route: Hashable {
tabItem.view(onNavigate: onNavigate)
case .accountManagement:
AccountManagementScreen()
case .search(let accountType, let query):
SearchScreen(accountType: accountType, initialQuery: query)
default:
Text("Not done yet for \(self)")
}
Expand Down
6 changes: 6 additions & 0 deletions iosApp/flare/UI/Route/TabItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ extension TabItem {
NotificationScreen(accountType: self.account)
case .settingsTabItem:
SettingsScreen()
case .discoverTabItem(let discoverTabItem):
DiscoverScreen(accountType: discoverTabItem.account)
case .allListTabItem(let allListTabItem):
AllListScreen(accountType: allListTabItem.account)
case .feedsTabItem(let feedsTabItem):
AllFeedScreen(accountType: feedsTabItem.account)
default:
Text("Not done yet for \(self)")
}
Expand Down
Loading