mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
message bubble & file info
This commit is contained in:
parent
86bf0f6cbd
commit
4f774e6251
2 changed files with 178 additions and 6 deletions
|
@ -2055,6 +2055,13 @@
|
|||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
AA3B45F13C99CAEE72D01DAA /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
C331FF182558F9D300070591 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
@ -4673,6 +4680,7 @@
|
|||
buildConfigurationList = FD9BDDFC2A5D2294005F1EBC /* Build configuration list for PBXNativeTarget "SessionUtil" */;
|
||||
buildPhases = (
|
||||
FD9BDDFF2A5D229B005F1EBC /* Build libSessionUtil if Needed */,
|
||||
AA3B45F13C99CAEE72D01DAA /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
|
|
|
@ -9,7 +9,7 @@ struct MessageInfoView: View {
|
|||
var messageViewModel: MessageViewModel
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
ZStack (alignment: .topLeading) {
|
||||
if #available(iOS 14.0, *) {
|
||||
Color.black.ignoresSafeArea()
|
||||
} else {
|
||||
|
@ -17,13 +17,160 @@ struct MessageInfoView: View {
|
|||
}
|
||||
|
||||
VStack(
|
||||
alignment: .center,
|
||||
alignment: .leading,
|
||||
spacing: 10
|
||||
) {
|
||||
// Message bubble snapshot
|
||||
Image("snapshot")
|
||||
|
||||
if let body: String = messageViewModel.body {
|
||||
ZStack {
|
||||
RoundedRectangle(cornerRadius: 18)
|
||||
.fill(Color(red: 49.0/255, green: 241.0/255, blue: 150.0/255))
|
||||
|
||||
Text(body)
|
||||
.padding(
|
||||
EdgeInsets(
|
||||
top: 8,
|
||||
leading: 16,
|
||||
bottom: 8,
|
||||
trailing: 16
|
||||
)
|
||||
)
|
||||
}
|
||||
.frame(
|
||||
maxWidth: .infinity,
|
||||
maxHeight: .infinity,
|
||||
alignment: .topLeading
|
||||
)
|
||||
.fixedSize(horizontal: true, vertical: true)
|
||||
.padding(
|
||||
EdgeInsets(
|
||||
top: 10,
|
||||
leading: 30,
|
||||
bottom: 10,
|
||||
trailing: 30
|
||||
)
|
||||
)
|
||||
}
|
||||
// TODO: Attachment carousel view
|
||||
|
||||
// Attachment Info
|
||||
if (messageViewModel.attachments?.isEmpty != false) {
|
||||
ZStack {
|
||||
RoundedRectangle(cornerRadius: 17)
|
||||
.fill(Color(red: 27.0/255, green: 27.0/255, blue: 27.0/255))
|
||||
|
||||
VStack(
|
||||
alignment: .leading,
|
||||
spacing: 16
|
||||
) {
|
||||
VStack(
|
||||
alignment: .leading,
|
||||
spacing: 4
|
||||
) {
|
||||
Text("ATTACHMENT_INFO_FILE_ID".localized() + ":")
|
||||
.bold()
|
||||
.font(.system(size: 18))
|
||||
.foregroundColor(.white)
|
||||
Text("12378965485235985214")
|
||||
.font(.system(size: 16))
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
|
||||
HStack(
|
||||
alignment: .center,
|
||||
spacing: 48
|
||||
) {
|
||||
VStack(
|
||||
alignment: .leading,
|
||||
spacing: 4
|
||||
) {
|
||||
Text("ATTACHMENT_INFO_FILE_TYPE".localized() + ":")
|
||||
.bold()
|
||||
.font(.system(size: 18))
|
||||
.foregroundColor(.white)
|
||||
Text(".PNG")
|
||||
.font(.system(size: 16))
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
VStack(
|
||||
alignment: .leading,
|
||||
spacing: 4
|
||||
) {
|
||||
Text("ATTACHMENT_INFO_FILE_SIZE".localized() + ":")
|
||||
.bold()
|
||||
.font(.system(size: 18))
|
||||
.foregroundColor(.white)
|
||||
Text("6mb")
|
||||
.font(.system(size: 16))
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
|
||||
HStack(
|
||||
alignment: .center,
|
||||
spacing: 48
|
||||
) {
|
||||
VStack(
|
||||
alignment: .leading,
|
||||
spacing: 4
|
||||
) {
|
||||
Text("ATTACHMENT_INFO_RESOLUTION".localized() + ":")
|
||||
.bold()
|
||||
.font(.system(size: 18))
|
||||
.foregroundColor(.white)
|
||||
Text("550×550")
|
||||
.font(.system(size: 16))
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
VStack(
|
||||
alignment: .leading,
|
||||
spacing: 4
|
||||
) {
|
||||
Text("ATTACHMENT_INFO_DURATION".localized() + ":")
|
||||
.bold()
|
||||
.font(.system(size: 18))
|
||||
.foregroundColor(.white)
|
||||
Text("N/A")
|
||||
.font(.system(size: 16))
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.frame(
|
||||
maxWidth: .infinity,
|
||||
maxHeight: .infinity,
|
||||
alignment: .topLeading
|
||||
)
|
||||
.padding(
|
||||
EdgeInsets(
|
||||
top: 16,
|
||||
leading: 16,
|
||||
bottom: 16,
|
||||
trailing: 16
|
||||
)
|
||||
)
|
||||
}
|
||||
.frame(maxHeight: .infinity)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.padding(
|
||||
EdgeInsets(
|
||||
top: 10,
|
||||
leading: 30,
|
||||
bottom: 10,
|
||||
trailing: 30
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// Message Info
|
||||
ZStack {
|
||||
|
@ -32,7 +179,7 @@ struct MessageInfoView: View {
|
|||
|
||||
VStack(
|
||||
alignment: .leading,
|
||||
spacing: 10
|
||||
spacing: 16
|
||||
) {
|
||||
VStack(
|
||||
alignment: .leading,
|
||||
|
@ -40,8 +187,10 @@ struct MessageInfoView: View {
|
|||
) {
|
||||
Text("Sent:")
|
||||
.bold()
|
||||
.font(.system(size: 18))
|
||||
.foregroundColor(.white)
|
||||
Text(messageViewModel.dateForUI.fromattedForMessageInfo)
|
||||
.font(.system(size: 16))
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
|
||||
|
@ -51,8 +200,10 @@ struct MessageInfoView: View {
|
|||
) {
|
||||
Text("Received:")
|
||||
.bold()
|
||||
.font(.system(size: 18))
|
||||
.foregroundColor(.white)
|
||||
Text(messageViewModel.receivedDateForUI.fromattedForMessageInfo)
|
||||
.font(.system(size: 16))
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
|
||||
|
@ -62,18 +213,31 @@ struct MessageInfoView: View {
|
|||
) {
|
||||
Text("From:")
|
||||
.bold()
|
||||
.font(.system(size: 18))
|
||||
.foregroundColor(.white)
|
||||
HStack(
|
||||
spacing: 5
|
||||
spacing: 10
|
||||
) {
|
||||
Circle()
|
||||
.frame(
|
||||
width: 46,
|
||||
height: 46,
|
||||
alignment: .topLeading
|
||||
)
|
||||
.foregroundColor(Color(red: 49.0/255, green: 241.0/255, blue: 150.0/255))
|
||||
// ProfilePictureSwiftUI(size: .message)
|
||||
|
||||
|
||||
VStack(
|
||||
alignment: .leading,
|
||||
spacing: 4
|
||||
) {
|
||||
Text(messageViewModel.senderName ?? "Tester")
|
||||
.bold()
|
||||
.font(.system(size: 18))
|
||||
.foregroundColor(.white)
|
||||
Text(messageViewModel.authorId)
|
||||
.font(.system(size: 16))
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue