Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

feat(ios): Face to Face gets its own row under Start listening, with its languages, and the language no longer gets cut off

wqugurue1d14e2934a0
diff --git a/ios/Sources/Cicada/FaceView.swift b/ios/Sources/Cicada/FaceView.swift
index ff7265b..e6af83e 100644
--- a/ios/Sources/Cicada/FaceView.swift
+++ b/ios/Sources/Cicada/FaceView.swift
@@ -204,33 +204,50 @@ private struct HoldButton: View {
}
/// 面对面 beside 开始听 on the home screen.
-struct FaceButton: View {
+/// 面对面 under 开始听, a row of its own as tall as it: the icon and the name at full size, and
+/// the languages and what happens (the phone reads it out), so it doesn't pass for another 开始听.
+struct FaceRow: View {
@EnvironmentObject var model: AppModel
+ @ObservedObject var face: FaceToFace
var onGlass = false
var body: some View {
Button { model.openFace() } label: {
- VStack(spacing: 1) {
- Image(systemName: "bubble.left.and.text.bubble.right").font(.system(size: 19, weight: .medium))
- Text("面对面").font(.system(size: 10, weight: .semibold)).lineLimit(1).minimumScaleFactor(0.7).padding(.horizontal, 4)
+ HStack(spacing: 12) {
+ Image(systemName: "bubble.left.and.text.bubble.right")
+ .font(.system(size: 19, weight: .medium)).foregroundStyle(Ink.ink)
+ .frame(width: 44, height: 44)
+ .background(Ink.ground, in: Circle())
+ VStack(alignment: .leading, spacing: 1) {
+ Text("面对面").font(.headline).foregroundStyle(Ink.ink).lineLimit(1)
+ // Narrow (the iPad sidebar, English): the languages only, never a clipped sentence.
+ let pair = "\(Pref.name(of: face.mine)) ⇄ \(Pref.name(of: face.theirs))"
+ ViewThatFits(in: .horizontal) {
+ Text(verbatim: pair + " · " + L("手机念给对方听"))
+ Text(verbatim: pair)
+ }
+ .font(.footnote).foregroundStyle(Ink.secondary).lineLimit(1)
+ }
+ Spacer(minLength: 4)
+ Image(systemName: "chevron.right").font(.footnote.weight(.semibold)).foregroundStyle(Ink.tertiary)
}
- .foregroundStyle(Ink.ink)
- .frame(width: 58, height: 58)
+ .padding(.leading, 7).padding(.trailing, 18)
+ .frame(height: 58)
.background {
- if onGlass { Circle().fill(Color.white).shadow(color: Ink.ink.opacity(0.08), radius: 2, y: 1) }
+ if onGlass { Capsule().fill(Color.white).shadow(color: Ink.ink.opacity(0.08), radius: 2, y: 1) }
}
- .contentShape(Circle())
+ .contentShape(Capsule())
}
.buttonStyle(.plain)
- .modifier(GlassCircle(on: !onGlass))
+ .modifier(GlassRow(on: !onGlass))
.accessibilityLabel(Text("面对面同声传译"))
}
}
-private struct GlassCircle: ViewModifier {
+private struct GlassRow: ViewModifier {
let on: Bool
func body(content: Content) -> some View {
- if on { content.glassEffect(.regular.interactive(), in: Circle()) } else { content }
+ if on { content.glassEffect(.regular.interactive(), in: Capsule()) } else { content }
}
}
diff --git a/ios/Sources/Cicada/LiveViews.swift b/ios/Sources/Cicada/LiveViews.swift
index 00ec75e..066cc2f 100644
--- a/ios/Sources/Cicada/LiveViews.swift
+++ b/ios/Sources/Cicada/LiveViews.swift
@@ -31,7 +31,9 @@ struct HomeTitle: View {
.lineLimit(1).minimumScaleFactor(0.7)
} else {
Text(dateText(Date(), "MMMdEEEE")).font(.footnote).foregroundStyle(Ink.secondary)
+ // iPad's narrow sidebar: "Meetings" shrinks rather than breaking in two.
Text("会议记录").font(.system(size: titleSize, weight: .bold)).foregroundStyle(Ink.ink)
+ .lineLimit(1).minimumScaleFactor(0.7)
}
}
Spacer(minLength: 0)
diff --git a/ios/Sources/Cicada/RecordsView.swift b/ios/Sources/Cicada/RecordsView.swift
index c4a0107..fbb93d5 100644
--- a/ios/Sources/Cicada/RecordsView.swift
+++ b/ios/Sources/Cicada/RecordsView.swift
@@ -24,9 +24,9 @@ struct RecordsSplit: View {
HomeTitle(trailing: AnyView(
ImportMenu { GlassIcon(systemName: "arrow.down.to.line") }))
.padding(.top, 6)
- HStack(spacing: 10) {
+ VStack(spacing: 10) {
ListenBar()
- if !room.isRunning { FaceButton() }
+ if !room.isRunning { FaceRow(face: model.face) }
}
.padding(.top, 16)
ImportCard(importer: model.importer)
@@ -106,9 +106,9 @@ struct PadRoot: View {
.buttonStyle(.plain).accessibilityLabel(Text("设置"))
}))
.padding(.horizontal, 4)
- HStack(spacing: 8) {
+ VStack(spacing: 8) {
ListenBar(onGlass: true)
- if !room.isRunning { FaceButton(onGlass: true) }
+ if !room.isRunning { FaceRow(face: model.face, onGlass: true) }
}
.padding(.top, 14).padding(.bottom, 12)
ImportCard(importer: model.importer).padding(.top, -22).padding(.bottom, 12)