Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
Fix Cover Flow again, and update apps to 2.0.1/1.0.1
Browse files Browse the repository at this point in the history
Simplify Cover Flow List View code to fix layout issues
  • Loading branch information
conath authored Feb 23, 2022
2 parents 8c9e1c9 + 191912d commit 703ac43
Show file tree
Hide file tree
Showing 113 changed files with 226 additions and 86 deletions.
File renamed without changes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ On TV (via AirPlay or adapter):
The latest release version of this app is [available on the App Store](https://apps.apple.com/app/id1534845010) and beta versions are sometimes available on [TestFlight](https://testflight.apple.com/join/Wnlesgzr). It appears on your homescreen as "Front Row".


<img src="https://github.com/conath/FrontRowTrailers/blob/main/FrontRowTrailersIcon.png?raw=true" alt="App Icon. It is dark red and black color with a white lens flare at the top. It is designed to resemble a movie theatre." width="500"/>
<img src="https://github.com/conath/FrontRowTrailers/blob/main/Design Assets/FrontRowTrailersIcon.png?raw=true" alt="App Icon. It is dark red and black color with a white lens flare at the top. It is designed to resemble a movie theatre." width="500"/>

To build from source, you need Xcode 12 and an Apple Developer account. Clone or download the repository, open the Xcode project and change the bunde identifier and development team. Then build and run.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions TMT Mac/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ struct ContentView: View {
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.black)
.transition(.opacity)
.onDisappear {
/// user played trailer, request review
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
AppStoreReviewsManager.requestReviewIfAppropriate()
}
}
}
}
)
Expand Down
6 changes: 6 additions & 0 deletions TMT Mac/TMT_MacApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import TelemetryClient

@main
struct TMT_MacApp: App {
Expand All @@ -15,6 +16,11 @@ struct TMT_MacApp: App {
ContentView()
.environmentObject(dataStore)
.onAppear {
/// initialize telemetry
let configuration = TelemetryManagerConfiguration(appID: TelemetryAppId)
TelemetryManager.initialize(with: configuration)
TelemetryManager.send("appLaunchedRegularly")
/// put window into full screen
DispatchQueue.main.asyncAfter(0.1) {
if let window = NSApplication.shared.windows.last {
window.toggleFullScreen(nil)
Expand Down
37 changes: 37 additions & 0 deletions TMT Mac/Utilities/AppStoreReviewsManager.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// AppStoreReviewManager.swift
// TheatricalMovieTrailers
//
// Created by Christoph Parstorfer on 20.02.22.
//

import StoreKit

/**
Shows the App Store review prompt if appropriate.
Appropriate means:
- app launched > 1 minute ago
- has not been asked to review this version
*/
class AppStoreReviewsManager {
static func requestReviewIfAppropriate() {
let settings = Settings.instance
// check if app was first launched more than one minute ago
guard Date().timeIntervalSince(settings.firstLaunchedDate) > 1 * 60/* seconds */ else {
return
}

// check that no request for review of this app version has been made
let currentVersion = NSApplication.version
let lastVersion = settings.lastReviewRequestAppVersion
guard lastVersion == nil || lastVersion! != currentVersion else {
return
}

// request for the review popup to be shown
SKStoreReviewController.requestReview()

// update last requested version number
settings.lastReviewRequestAppVersion = currentVersion
}
}
2 changes: 2 additions & 0 deletions TMT Mac/Views/MovieTrailerListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import TelemetryClient

struct MovieTrailerListView: View {
@ObservedObject private var settings = Settings.instance
Expand Down Expand Up @@ -162,5 +163,6 @@ struct MovieTrailerListView: View {
dataStore.selectedTrailerModel = movieInfo
dataStore.isPlaying = true
}
dataStore.setWatchedTrailer(movieInfo)
}
}
30 changes: 18 additions & 12 deletions TheatricalMovieTrailers.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
83FA29FF2748909B00445816 /* NSApplication+version+build.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FA29FE2748909B00445816 /* NSApplication+version+build.swift */; };
83FA2A002748930100445816 /* CustomDarkAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 831CD8FA24ABEC36008EDC6F /* CustomDarkAppearance.swift */; };
83FA2A012748933F00445816 /* DispatchQueue+async.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83AC6275255018F700197B0B /* DispatchQueue+async.swift */; };
83FD3F3927C2ACF00083F354 /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8300055C2541B34A0069A8D1 /* Secrets.swift */; };
83FD3F3C27C2AE640083F354 /* AppStoreReviewsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FD3F3B27C2AE640083F354 /* AppStoreReviewsManager.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -205,6 +207,7 @@
83FA29EB274889C400445816 /* Settings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Settings.swift; sourceTree = "<group>"; };
83FA29FC2748905800445816 /* Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Settings.swift; sourceTree = "<group>"; };
83FA29FE2748909B00445816 /* NSApplication+version+build.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSApplication+version+build.swift"; sourceTree = "<group>"; };
83FD3F3B27C2AE640083F354 /* AppStoreReviewsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppStoreReviewsManager.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -361,6 +364,7 @@
837E13E527680356004B564B /* Utilities */ = {
isa = PBXGroup;
children = (
83FD3F3B27C2AE640083F354 /* AppStoreReviewsManager.swift */,
837E13E627680374004B564B /* KeyEventHandling.swift */,
);
path = Utilities;
Expand Down Expand Up @@ -678,13 +682,15 @@
83FA29F7274889D900445816 /* MovieInfo.swift in Sources */,
83FA29FD2748905800445816 /* Settings.swift in Sources */,
83FA2A012748933F00445816 /* DispatchQueue+async.swift in Sources */,
83FD3F3C27C2AE640083F354 /* AppStoreReviewsManager.swift in Sources */,
833A78AB27B72B60009A91A6 /* MacFont.swift in Sources */,
8354861827760D8E0039A29C /* MoviePosterView.swift in Sources */,
837E13E12767FD5C004B564B /* MovieTrailerListView.swift in Sources */,
835486142775EE520039A29C /* FadeInOutPosterView.swift in Sources */,
83FA29FA27488F2700445816 /* MovieInfoDataStore.swift in Sources */,
83FA29F6274889D900445816 /* SortingMode.swift in Sources */,
837E13E4276800A5004B564B /* SelectionIndicator.swift in Sources */,
83FD3F3927C2ACF00083F354 /* Secrets.swift in Sources */,
83FA29FF2748909B00445816 /* NSApplication+version+build.swift in Sources */,
83AB8429278CDF9800428FB4 /* MovieInfoContainerView.swift in Sources */,
);
Expand Down Expand Up @@ -837,7 +843,7 @@
CODE_SIGN_ENTITLEMENTS = TheatricalMovieTrailers/TheatricalMovieTrailers.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 43;
CURRENT_PROJECT_VERSION = 46;
DEVELOPMENT_ASSET_PATHS = "\"TheatricalMovieTrailers/Preview Content\"";
DEVELOPMENT_TEAM = U96PJYMZWW;
ENABLE_PREVIEWS = YES;
Expand All @@ -847,7 +853,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
PRODUCT_BUNDLE_IDENTIFIER = cafe.chrisp.tmt;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -865,7 +871,7 @@
CODE_SIGN_ENTITLEMENTS = TheatricalMovieTrailers/TheatricalMovieTrailers.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 43;
CURRENT_PROJECT_VERSION = 46;
DEVELOPMENT_ASSET_PATHS = "\"TheatricalMovieTrailers/Preview Content\"";
DEVELOPMENT_TEAM = U96PJYMZWW;
ENABLE_PREVIEWS = YES;
Expand All @@ -875,7 +881,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
PRODUCT_BUNDLE_IDENTIFIER = cafe.chrisp.tmt;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -892,7 +898,7 @@
CODE_SIGN_ENTITLEMENTS = TrailersWidget/TrailersWidgetExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 43;
CURRENT_PROJECT_VERSION = 46;
DEVELOPMENT_TEAM = U96PJYMZWW;
INFOPLIST_FILE = TrailersWidget/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
Expand All @@ -901,7 +907,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
PRODUCT_BUNDLE_IDENTIFIER = cafe.chrisp.tmt.TrailersWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -918,7 +924,7 @@
CODE_SIGN_ENTITLEMENTS = TrailersWidget/TrailersWidgetExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 43;
CURRENT_PROJECT_VERSION = 46;
DEVELOPMENT_TEAM = U96PJYMZWW;
INFOPLIST_FILE = TrailersWidget/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
Expand All @@ -927,7 +933,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
PRODUCT_BUNDLE_IDENTIFIER = cafe.chrisp.tmt.TrailersWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -947,7 +953,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_ASSET_PATHS = "\"TMT Mac/Preview Content\"";
DEVELOPMENT_TEAM = U96PJYMZWW;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -962,7 +968,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = cafe.chrisp.tmt;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
Expand All @@ -982,7 +988,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_ASSET_PATHS = "\"TMT Mac/Preview Content\"";
DEVELOPMENT_TEAM = U96PJYMZWW;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -997,7 +1003,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = cafe.chrisp.tmt;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
Expand Down
62 changes: 31 additions & 31 deletions TheatricalMovieTrailers/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,43 @@ struct ContentView: View {

var body: some View {
CoverFlowScrollView(model: $dataStore.model, sortingMode: $sortingMode)
.overlay(
Group {
if loading {
ZStack {
ProgressView("Loading Trailers…")
.frame(width: 200, height: 44)
.overlay(
Group {
if loading {
ZStack {
ProgressView("Loading Trailers…")
.frame(width: 200, height: 44)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.init(UIColor.systemBackground))
.edgesIgnoringSafeArea(.all)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.init(UIColor.systemBackground))
.edgesIgnoringSafeArea(.all)
}
)
.alert(item: $dataStore.error, content: { error -> Alert in
error.makeAlert()
})
.transition(.opacity)
.modifier(CustomDarkAppearance())
.statusBar(hidden: true)
.onChange(of: sortingMode) { sortingMode in
dataStore.model.sort(by: sortingMode.predicate)
}
)
.alert(item: $dataStore.error, content: { error -> Alert in
error.makeAlert()
})
.transition(.opacity)
.modifier(CustomDarkAppearance())
.statusBar(hidden: true)
.onChange(of: sortingMode) { sortingMode in
dataStore.model.sort(by: sortingMode.predicate)
}
.onAppear {
if !dataStore.moviesAvailable {
DispatchQueue.main.asyncAfter(0.5) {
if !dataStore.moviesAvailable {
withAnimation {
loading = true
.onAppear {
if !dataStore.moviesAvailable {
DispatchQueue.main.asyncAfter(0.5) {
if !dataStore.moviesAvailable {
withAnimation {
loading = true
}
}
}
}
}
}
.onChange(of: dataStore.moviesAvailable, perform: { moviesAvailable in
withAnimation {
loading = !moviesAvailable
}
})
.onChange(of: dataStore.moviesAvailable, perform: { moviesAvailable in
withAnimation {
loading = !moviesAvailable
}
})
}
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.059",
"green" : "0.357",
"red" : "0.043"
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
Expand All @@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.059",
"green" : "0.357",
"red" : "0.043"
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "4",
"green" : "11",
"red" : "194"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.016",
"green" : "0.043",
"red" : "0.761"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 703ac43

Please sign in to comment.