Skip to content

Commit

Permalink
Merge branch 'feature/ui_updates' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed Dec 5, 2023
2 parents 2853ecf + 46100e3 commit 8409701
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 20 deletions.
13 changes: 11 additions & 2 deletions Kukai Mobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 53;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -1664,7 +1664,7 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1250;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1500;
TargetAttributes = {
C0B0363E269EE2070071ACD0 = {
CreatedOnToolsVersion = 12.5;
Expand Down Expand Up @@ -2206,6 +2206,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -2241,6 +2242,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand All @@ -2259,6 +2261,7 @@
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "\"-Wl,-no_warn_duplicate_libraries\"";
PRODUCT_NAME = Kuaki;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
Expand All @@ -2272,6 +2275,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -2307,6 +2311,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -2318,6 +2323,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 16.1;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_LDFLAGS = "\"-Wl,-no_warn_duplicate_libraries\"";
PRODUCT_NAME = Kukai;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down Expand Up @@ -2494,6 +2500,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -2529,6 +2536,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -2540,6 +2548,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 16.1;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_LDFLAGS = "\"-Wl,-no_warn_duplicate_libraries\"";
PRODUCT_NAME = "Kukai Beta";
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"location" : "https://github.com/kukai-wallet/kukai-core-swift",
"state" : {
"branch" : "develop",
"revision" : "75cee6f7c83eea9debf265bff5891e7197065de1"
"revision" : "469398a5dd7f7c535002a26654388d466367569a"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
21 changes: 11 additions & 10 deletions Kukai Mobile/Controls/CustomAVPlayerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class CustomAVPlayerViewController: AVPlayerViewController {

private var viewToMonitor: UIView? = nil
private var previousValue = true
private var hiddenObserver: NSKeyValueObservation? = nil

public weak var customDelegate: CustomAVPlayerViewControllerDelegate? = nil

Expand All @@ -27,18 +28,18 @@ class CustomAVPlayerViewController: AVPlayerViewController {
previousValue = viewToMonitor?.isHidden ?? true

viewToMonitor?.addObserver(self, forKeyPath: "hidden", context: nil)

self.hiddenObserver = viewToMonitor?.observe(\.isHidden, changeHandler: { [weak self] view, change in
if self?.previousValue != view.isHidden {
self?.previousValue = view.isHidden
self?.customDelegate?.playbackControlsChanged(visible: !view.isHidden)
}
})

}

deinit {
viewToMonitor?.removeObserver(self, forKeyPath: "hidden")
}

override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {

// Check if its the correct element and avoid double trigger
if keyPath == "hidden", let v = viewToMonitor, previousValue != v.isHidden {
previousValue = v.isHidden
customDelegate?.playbackControlsChanged(visible: !v.isHidden)
}
hiddenObserver?.invalidate()
hiddenObserver = nil
}
}
3 changes: 3 additions & 0 deletions Kukai Mobile/Extensions/UIViewController+extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ extension UIViewController {
func hideLoadingView(completion: (() -> Void)? = nil) {
UIViewController.activityViewActivityIndicator.stopAnimating()
UIViewController.activityView.removeFromSuperview()
if let comp = completion {
comp()
}
}

static func createLoadingModal() -> UIViewController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CollectibleDetailAVCell: UICollectionViewCell {
private var isPlaybackReady = false
private var isPlaying = false
private var imageView: UIImageView? = nil
private weak var playerController: CustomAVPlayerViewController? = nil
private weak var playerController: AVPlayerViewController? = nil

private var airPlayName: String = ""
private var airPlayArtist: String = ""
Expand All @@ -38,7 +38,7 @@ class CollectibleDetailAVCell: UICollectionViewCell {
public var setup = false
public var timer: Timer? = nil

func setup(mediaContent: MediaContent, airPlayName: String, airPlayArtist: String, airPlayAlbum: String, avplayerController: CustomAVPlayerViewController, layoutOnly: Bool) {
func setup(mediaContent: MediaContent, airPlayName: String, airPlayArtist: String, airPlayAlbum: String, avplayerController: AVPlayerViewController, layoutOnly: Bool) {
if mediaContent.width > mediaContent.height {
self.aspectRatioConstraint.isActive = false
placeholderView.widthAnchor.constraint(equalTo: placeholderView.heightAnchor, multiplier: mediaContent.width/mediaContent.height).isActive = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class CollectiblesDetailsViewModel: ViewModel, UICollectionViewDiffableDataSourc

private var currentSnapshot = NSDiffableDataSourceSnapshot<SectionEnum, CellDataType>()
private let mediaService = MediaProxyService()
private var playerController: CustomAVPlayerViewController? = nil
private var playerController: AVPlayerViewController? = nil
private var playerLooper: AVPlayerLooper? = nil

private var sendData = SendContent(enabled: true)
Expand Down Expand Up @@ -540,7 +540,7 @@ class CollectiblesDetailsViewModel: ViewModel, UICollectionViewDiffableDataSourc

// Make sure we only register the player controller once
if self.playerController == nil {
self.playerController = CustomAVPlayerViewController()
self.playerController = AVPlayerViewController()

Logger.app.info("Loading video url: \(url.absoluteString)")

Expand Down

0 comments on commit 8409701

Please sign in to comment.