Skip to content

Commit

Permalink
Merge pull request #136 from makinosp/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
makinosp authored Sep 25, 2024
2 parents 9e4714f + 4aa13ed commit 5534684
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 27 deletions.
4 changes: 2 additions & 2 deletions Harmonie.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.7.3;
MARKETING_VERSION = 0.7.4;
PRODUCT_BUNDLE_IDENTIFIER = jp.mknn.harmonie;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -506,7 +506,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.7.3;
MARKETING_VERSION = 0.7.4;
PRODUCT_BUNDLE_IDENTIFIER = jp.mknn.harmonie;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"location" : "https://github.com/makinosp/vrckit",
"state" : {
"branch" : "develop",
"revision" : "bc261c16c86f2738501799f3c86d1d581f5f2cb9"
"revision" : "0182daeb833a4f1481f383b5a1a3a70cdcae896d"
}
},
{
Expand Down
4 changes: 4 additions & 0 deletions harmonie/ViewModels/Friend/FriendViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ final class FriendViewModel {
onlineFriends + offlineFriends
}

var friendsInPrivate: [Friend] {
friendsLocations.first(where: { $0.location == .private })?.friends ?? []
}

func getFriend(id: String) -> Friend? {
allFriends.first { $0.id == id }
}
Expand Down
7 changes: 4 additions & 3 deletions harmonie/Views/Favorite/FavoritesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@ struct FavoritesView: View {
var body: some View {
@Bindable var favoriteVM = favoriteVM
NavigationSplitView(columnVisibility: .constant(.all)) {
VStack {
VStack(spacing: .zero) {
Picker("", selection: $favoriteVM.segment) {
ForEach(Segment.allCases) { segment in
Text(segment.description).tag(segment)
}
}
.pickerStyle(.segmented)
.padding(.horizontal, 20)
.padding(.horizontal, 16)
Group {
if favoriteVM.segment == .friend {
FavoriteFriendListView(selected: $selected)
} else if favoriteVM.segment == .world {
FavoriteWorldListView(selected: $selected)
}
}
.contentMargins(.top, 0)
.contentMargins(.top, 8)
}
.background(Color(.systemGroupedBackground))
.navigationTitle("Favorites")
} detail: {
if let selected = selected {
Expand Down
2 changes: 1 addition & 1 deletion harmonie/Views/Location/LocationCardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct LocationCardView: View, InstanceServicePresentable {
}
}
ScrollView(.horizontal) {
HStack(spacing: -8) {
LazyHStack(spacing: -8) {
ForEach(location.friends) { friend in
CircleURLImage(
imageUrl: friend.imageUrl(.x256),
Expand Down
43 changes: 41 additions & 2 deletions harmonie/Views/Location/LocationsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,43 @@ struct LocationsView: View, FriendServicePresentable, InstanceServicePresentable
}

private var locationList: some View {
List(friendVM.friendsLocations, selection: $selectedInstance) { location in
if location.isVisible {
List(selection: $selectedInstance) {
ForEach(friendVM.friendsLocations.filter(\.location.isVisible)) { location in
LocationCardView(
selected: $selectedInstance,
location: location
)
}
Section("Private") {
HStack(spacing: 16) {
SquareURLImage(imageUrl: Const.privateWorldImageUrl)
VStack(spacing: 4) {
HStack {
VStack(alignment: .leading) {
Text("Private World")
.font(.body)
Text(friendVM.friendsInPrivate.count.description)
.font(.footnote)
.foregroundStyle(Color.gray)
}
.frame(maxWidth: .infinity, alignment: .leading)
if UIDevice.current.userInterfaceIdiom == .phone {
Constants.Icon.forward
}
}
ScrollView(.horizontal) {
LazyHStack(spacing: -8) {
ForEach(friendVM.friendsInPrivate) { friend in
CircleURLImage(
imageUrl: friend.imageUrl(.x256),
size: Constants.IconSize.thumbnail
)
}
}
}
}
}
}
}
.overlay {
if friendVM.isRequesting {
Expand All @@ -89,6 +119,15 @@ struct LocationsView: View, FriendServicePresentable, InstanceServicePresentable
}
}

extension Location {
var isVisible: Bool {
switch self {
case .id: true
default: false
}
}
}

fileprivate extension View {
func setColumn() -> some View {
self.navigationSplitViewColumnWidth(
Expand Down
22 changes: 9 additions & 13 deletions harmonie/Views/UserDetail/UserDetailView+LocationSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ extension UserDetailView {
instance.world.name
} else if user.platform == .web {
"On website"
} else if user.location == .offline {
"Offline"
} else if user.location == .private {
"Private World"
} else if user.location == .offline {
"Offline"
} else if isRequesting {
String(repeating: " ", count: 15)
} else {
Expand All @@ -27,17 +27,13 @@ extension UserDetailView {
}

private var locationImageUrl: URL? {
if user.isVisible {
return instance?.imageUrl(.x256)
}
if user.platform == .web {
return Const.locationOnWebImageUrl
} else if user.location == .offline {
return Const.offlineImageUrl
} else if user.location == .offline || user.location == .offline || user.location == .offline {
return Const.privateWorldImageUrl
} else {
return nil
switch user.location {
case .id:
user.platform == .web ? Const.locationOnWebImageUrl : instance?.imageUrl(.x256)
case .private, .traveling:
Const.privateWorldImageUrl
case .offline:
Const.offlineImageUrl
}
}

Expand Down
6 changes: 1 addition & 5 deletions harmonie/Views/UserDetail/UserDetailView+OverlayViews.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import SwiftUI
import VRCKit

extension UserDetailView {
var statusColor: Color {
user.state == .offline ? UserStatus.offline.color : user.status.color
}

var topOverlay: some View {
HStack {
Spacer()
Expand Down Expand Up @@ -48,7 +44,7 @@ extension UserDetailView {
Text(user.statusDescription.isEmpty ? user.status.description : user.statusDescription)
} icon: {
StatusIndicator(
user.status.color,
user.location != .offline ? user.status.color : UserStatus.offline.color,
size: Constants.IconSize.indicator,
isCutOut: user.platform == .web
)
Expand Down

0 comments on commit 5534684

Please sign in to comment.