Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07b5636bac | ||
|
|
88d3aa48e7 | ||
|
|
d6da47db9d | ||
|
|
4dfcfbf434 | ||
|
|
56c92e8b93 | ||
|
|
639b5368ff | ||
|
|
cfaedd06cf | ||
|
|
8f3a10df2f |
No files matched your search
@@ -139,7 +139,17 @@ final class Ui {
|
|||||||
/// Split (unfolded) goes landscape at once. Portrait waits a moment and checks again, so a
|
/// Split (unfolded) goes landscape at once. Portrait waits a moment and checks again, so a
|
||||||
/// frame without a hinge reading mid-rotation can't throw an unfolded phone back upright.
|
/// frame without a hinge reading mid-rotation can't throw an unfolded phone back upright.
|
||||||
/// Back in the foreground: the phone may have been folded or unfolded meanwhile.
|
/// Back in the foreground: the phone may have been folded or unfolded meanwhile.
|
||||||
func resumed() { lockOrientation() }
|
/// The split/unfolded flags are from before the app left, so locking on them at once can force
|
||||||
|
/// landscape on a phone folded meanwhile. Free the rotation while away and decide again once
|
||||||
|
/// the window has settled to the screen it came back on.
|
||||||
|
func resumed() {
|
||||||
|
Task { @MainActor in
|
||||||
|
try? await Task.sleep(for: .milliseconds(300))
|
||||||
|
self.lockOrientation()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func backgrounded() { Orientation.lock(.allButUpsideDown) }
|
||||||
|
|
||||||
private func lockOrientation() {
|
private func lockOrientation() {
|
||||||
if split || unfolded { Orientation.lock(.landscape); return }
|
if split || unfolded { Orientation.lock(.landscape); return }
|
||||||
|
|||||||
@@ -19,9 +19,21 @@ struct RootView: View {
|
|||||||
.onGeometryChange(for: CGFloat.self) { $0.safeAreaInsets.trailing } action: { ui.sawInsets(trailing: $0, upright: vSize == .regular) }
|
.onGeometryChange(for: CGFloat.self) { $0.safeAreaInsets.trailing } action: { ui.sawInsets(trailing: $0, upright: vSize == .regular) }
|
||||||
.background(p.bg.ignoresSafeArea())
|
.background(p.bg.ignoresSafeArea())
|
||||||
.onChange(of: ui.tabs) { _, _ in ui.ensureValidTab() }
|
.onChange(of: ui.tabs) { _, _ in ui.ensureValidTab() }
|
||||||
.onChange(of: phase) { _, ph in if ph == .active { ui.resumed() } }
|
.onChange(of: phase) { _, ph in
|
||||||
|
if ph == .active { ui.resumed() } else if ph == .background { ui.backgrounded() }
|
||||||
|
}
|
||||||
.fullScreenCover(isPresented: Binding(get: { ui.nowPlayingOpen }, set: { ui.nowPlayingOpen = $0 })) {
|
.fullScreenCover(isPresented: Binding(get: { ui.nowPlayingOpen }, set: { ui.nowPlayingOpen = $0 })) {
|
||||||
NowPlayingScreen()
|
NowPlayingScreen()
|
||||||
|
// The panes underneath stop reporting while this covers them, so watch for the
|
||||||
|
// hinge here too: unfolding hands over to the split (docked) layout.
|
||||||
|
.background(GeometryReader { geo in
|
||||||
|
let c = DuoPane<EmptyView>.cut(geo)
|
||||||
|
Color.clear.onChange(of: c == nil ? 0 : c!.vertical ? 2 : 1, initial: true) { _, k in
|
||||||
|
guard k > 0 else { return }
|
||||||
|
ui.setUnfolded(true)
|
||||||
|
ui.setSplit(k == 2)
|
||||||
|
}
|
||||||
|
})
|
||||||
.overlayHost(ui.overlays, level: 1)
|
.overlayHost(ui.overlays, level: 1)
|
||||||
.environment(ui)
|
.environment(ui)
|
||||||
.environment(\.palette, p)
|
.environment(\.palette, p)
|
||||||
@@ -198,6 +210,7 @@ private struct DuoPane<Content: View>: View {
|
|||||||
@Environment(Ui.self) private var ui
|
@Environment(Ui.self) private var ui
|
||||||
@AppStorage("duoSwap") private var swap = false
|
@AppStorage("duoSwap") private var swap = false
|
||||||
@Environment(\.palette) private var p
|
@Environment(\.palette) private var p
|
||||||
|
@State private var shown = false
|
||||||
private var g: AppGraph { .shared }
|
private var g: AppGraph { .shared }
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@@ -229,15 +242,19 @@ private struct DuoPane<Content: View>: View {
|
|||||||
// The hinge gap shows whatever is behind; paint it so the two sides read as one.
|
// The hinge gap shows whatever is behind; paint it so the two sides read as one.
|
||||||
.background(p.bg.ignoresSafeArea())
|
.background(p.bg.ignoresSafeArea())
|
||||||
.animation(.spring(duration: 0.4, bounce: 0.1), value: flip)
|
.animation(.spring(duration: 0.4, bounce: 0.1), value: flip)
|
||||||
.onChange(of: hinge != nil, initial: true) { _, on in ui.setUnfolded(on) }
|
// Every tab has its own pane and TabView keeps hidden ones alive, so only the one on
|
||||||
.onChange(of: cut != nil, initial: true) { _, on in ui.setSplit(on) }
|
// screen reports; a hidden one's stale size used to turn split off under the visible one.
|
||||||
|
.onChange(of: hinge != nil) { _, on in if shown { ui.setUnfolded(on) } }
|
||||||
|
.onChange(of: cut != nil) { _, on in if shown { ui.setSplit(on) } }
|
||||||
|
.onAppear { shown = true; ui.setUnfolded(hinge != nil); ui.setSplit(cut != nil) }
|
||||||
|
.onDisappear { shown = false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Where the hinge cuts the view: sizes of the two sides and the gap between them.
|
/// Where the hinge cuts the view: sizes of the two sides and the gap between them.
|
||||||
private struct Cut { var vertical: Bool; var first: CGFloat; var gap: CGFloat; var second: CGFloat }
|
fileprivate struct Cut { var vertical: Bool; var first: CGFloat; var gap: CGFloat; var second: CGFloat }
|
||||||
|
|
||||||
private static func cut(_ geo: GeometryProxy) -> Cut? {
|
fileprivate static func cut(_ geo: GeometryProxy) -> Cut? {
|
||||||
let size = geo.size
|
let size = geo.size
|
||||||
var c: Cut?
|
var c: Cut?
|
||||||
// The hinge reports inactive while the phone lies flat, so ask for inactive regions too.
|
// The hinge reports inactive while the phone lies flat, so ask for inactive regions too.
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ struct NowPlayingScreen: View {
|
|||||||
Spacer(minLength: 8)
|
Spacer(minLength: 8)
|
||||||
EllipsisButton(items: ui.menu.track(track))
|
EllipsisButton(items: ui.menu.track(track))
|
||||||
}
|
}
|
||||||
.padding(.top, tight || snug ? 8 : 14)
|
.padding(.top, snug && !docked ? 20 : tight ? 8 : 14)
|
||||||
.transition(.opacity.combined(with: .move(edge: .top)))
|
.transition(.opacity.combined(with: .move(edge: .top)))
|
||||||
}
|
}
|
||||||
ProgressVolumeBar(played: g.settings.albumTheme ? c.accent : c.label, unplayed: c.label3, centerLabel: badge(track))
|
ProgressVolumeBar(played: g.settings.albumTheme ? c.accent : c.label, unplayed: c.label3, centerLabel: badge(track))
|
||||||
|
|||||||
+3
-3
@@ -7,9 +7,9 @@ settings:
|
|||||||
base:
|
base:
|
||||||
SWIFT_VERSION: "5.0"
|
SWIFT_VERSION: "5.0"
|
||||||
# iOS needs a plain number for the bundle version; the label is what the app and releases show.
|
# iOS needs a plain number for the bundle version; the label is what the app and releases show.
|
||||||
MARKETING_VERSION: "0.10.0"
|
MARKETING_VERSION: "0.10.1"
|
||||||
VERSION_LABEL: "0.10.0"
|
VERSION_LABEL: "0.10.1"
|
||||||
CURRENT_PROJECT_VERSION: "46"
|
CURRENT_PROJECT_VERSION: "49"
|
||||||
# Dev builds override these (build-ipa.sh dev) so they install next to the release app.
|
# Dev builds override these (build-ipa.sh dev) so they install next to the release app.
|
||||||
APP_ID: org.cdnutter.stemify
|
APP_ID: org.cdnutter.stemify
|
||||||
APP_NAME: Stemify
|
APP_NAME: Stemify
|
||||||
|
|||||||
@@ -15,6 +15,16 @@
|
|||||||
"tintColor": "#FA2D48",
|
"tintColor": "#FA2D48",
|
||||||
"category": "entertainment",
|
"category": "entertainment",
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"version": "0.10.1",
|
||||||
|
"marketingVersion": "0.10.1",
|
||||||
|
"buildVersion": "48",
|
||||||
|
"date": "2026-11-20T10:23:12-08:00",
|
||||||
|
"localizedDescription": "iOS: only the on-screen Duo pane reports split/unfolded; build 48",
|
||||||
|
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v0.10.1/stemify-0.10.1.ipa",
|
||||||
|
"size": 3139470,
|
||||||
|
"minOSVersion": "17.0"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "0.10.0",
|
"version": "0.10.0",
|
||||||
"marketingVersion": "0.10.0",
|
"marketingVersion": "0.10.0",
|
||||||
|
|||||||
Reference in new issue
Block a user