Skip to content

Commit fdb9242

Browse files
committed
Fixed missing PlaceholderAvatarImage.
1 parent e70b782 commit fdb9242

File tree

2 files changed

+47
-4
lines changed

2 files changed

+47
-4
lines changed

ElementX.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
/* Begin PBXBuildFile section */
1010
182BC48127C4EBBB00A30C33 /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 182BC48027C4EBBB00A30C33 /* Kingfisher */; };
11-
183E023227E4A3CF00903BED /* PlaceholderAvatarImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183E023127E4A3CF00903BED /* PlaceholderAvatarImage.swift */; };
1211
183E023427E4A73C00903BED /* MemberDetailsProviderProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183E023327E4A73C00903BED /* MemberDetailsProviderProtocol.swift */; };
1312
183E023627E4A79D00903BED /* RoomTimelineProviderProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 183E023527E4A79D00903BED /* RoomTimelineProviderProtocol.swift */; };
1413
184B31DF27D898960075A669 /* Introspect in Frameworks */ = {isa = PBXBuildFile; productRef = 184B31DE27D898960075A669 /* Introspect */; };
@@ -21,6 +20,7 @@
2120
1850257127B6A135002E6B18 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1850256927B6A135002E6B18 /* LaunchScreen.storyboard */; };
2221
1863A3FC27BA5A9100B52E4D /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = 1863A3FB27BA5A9100B52E4D /* KeychainAccess */; };
2322
1863A40627BA6DFC00B52E4D /* SwiftyBeaver in Frameworks */ = {isa = PBXBuildFile; productRef = 1863A40527BA6DFC00B52E4D /* SwiftyBeaver */; };
23+
18ADC7D527E4B20300A8C953 /* PlaceholderAvatarImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18ADC7D427E4B20300A8C953 /* PlaceholderAvatarImage.swift */; };
2424
18C5744627E11F1900D70937 /* MatrixRustSDK in Frameworks */ = {isa = PBXBuildFile; productRef = 18C5744527E11F1900D70937 /* MatrixRustSDK */; };
2525
18C5744C27E1D84000D70937 /* RoomProxyProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18C5744827E1D84000D70937 /* RoomProxyProtocol.swift */; };
2626
18C5744D27E1D84000D70937 /* RoomProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18C5744A27E1D84000D70937 /* RoomProxy.swift */; };
@@ -124,7 +124,6 @@
124124

125125
/* Begin PBXFileReference section */
126126
181716DC27E11EF1002B8E3F /* matrix-rust-components-swift */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "matrix-rust-components-swift"; path = "../matrix-rust-components-swift"; sourceTree = "<group>"; };
127-
183E023127E4A3CF00903BED /* PlaceholderAvatarImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PlaceholderAvatarImage.swift; path = ../../../../../../../../Desktop/PlaceholderAvatarImage.swift; sourceTree = "<group>"; };
128127
183E023327E4A73C00903BED /* MemberDetailsProviderProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberDetailsProviderProtocol.swift; sourceTree = "<group>"; };
129128
183E023527E4A79D00903BED /* RoomTimelineProviderProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineProviderProtocol.swift; sourceTree = "<group>"; };
130129
1850252427B6918C002E6B18 /* ElementX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ElementX.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -138,6 +137,7 @@
138137
1850256727B6A135002E6B18 /* ElementX.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = ElementX.entitlements; sourceTree = "<group>"; };
139138
1850256827B6A135002E6B18 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
140139
1850256A27B6A135002E6B18 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
140+
18ADC7D427E4B20300A8C953 /* PlaceholderAvatarImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlaceholderAvatarImage.swift; sourceTree = "<group>"; };
141141
18C5744827E1D84000D70937 /* RoomProxyProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RoomProxyProtocol.swift; sourceTree = "<group>"; };
142142
18C5744A27E1D84000D70937 /* RoomProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RoomProxy.swift; sourceTree = "<group>"; };
143143
18C5744B27E1D84000D70937 /* MockRoomProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockRoomProxy.swift; sourceTree = "<group>"; };
@@ -391,7 +391,7 @@
391391
18DF7C3D27E4670600291672 /* Views */ = {
392392
isa = PBXGroup;
393393
children = (
394-
183E023127E4A3CF00903BED /* PlaceholderAvatarImage.swift */,
394+
18ADC7D427E4B20300A8C953 /* PlaceholderAvatarImage.swift */,
395395
18DF7C4F27E46A7A00291672 /* EventBasedTimelineView.swift */,
396396
18DF7C4027E4670600291672 /* TextRoomTimelineView.swift */,
397397
18DF7C3E27E4670600291672 /* ImageRoomTimelineView.swift */,
@@ -860,6 +860,7 @@
860860
18F2BADE27D25B4000DD1988 /* KeychainControllerProtocol.swift in Sources */,
861861
18C5745027E1D87800D70937 /* RoomMessageProtocol.swift in Sources */,
862862
18DF7C4C27E4672C00291672 /* EventBasedTimelineItemProtocol.swift in Sources */,
863+
18ADC7D527E4B20300A8C953 /* PlaceholderAvatarImage.swift in Sources */,
863864
18F2BAED27D25B4000DD1988 /* FullscreenLoadingActivityPresenter.swift in Sources */,
864865
18DF7C4127E4670600291672 /* RoomTimelineViewProvider.swift in Sources */,
865866
18F2BB0F27D25B4000DD1988 /* RoomScreen.swift in Sources */,
@@ -870,7 +871,6 @@
870871
18F2BAEB27D25B4000DD1988 /* LabelledActivityIndicatorView.swift in Sources */,
871872
18F2BAE427D25B4000DD1988 /* Presentable.swift in Sources */,
872873
18DF7C4427E4670600291672 /* RoomTimelineViewFactory.swift in Sources */,
873-
183E023227E4A3CF00903BED /* PlaceholderAvatarImage.swift in Sources */,
874874
18F2BAF927D25B4000DD1988 /* SplashViewController.swift in Sources */,
875875
18F2BAE327D25B4000DD1988 /* RootRouter.swift in Sources */,
876876
18F2BAE527D25B4000DD1988 /* NavigationModule.swift in Sources */,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//
2+
// Copyright 2022 New Vector Ltd
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
import SwiftUI
18+
19+
struct PlaceholderAvatarImage: View {
20+
21+
let firstCharacter: String
22+
23+
var body: some View {
24+
ZStack {
25+
Color(.sRGB, red: 0.05, green: 0.74, blue: 0.55, opacity: 1.0)
26+
Text(firstCharacter)
27+
.padding(4)
28+
.foregroundColor(.white)
29+
// Make the text resizable (i.e. Make it large and then allow it to scale down)
30+
.font(.system(size: 200))
31+
.minimumScaleFactor(0.001)
32+
}
33+
.aspectRatio(1, contentMode: .fill)
34+
}
35+
}
36+
37+
struct PlaceholderAvatarImage_Previews: PreviewProvider {
38+
static var previews: some View {
39+
PlaceholderAvatarImage(firstCharacter: "X")
40+
.clipShape(Circle())
41+
.frame(width: 150, height: 100)
42+
}
43+
}

0 commit comments

Comments
 (0)