Skip to content
Merged

v2.2 #13

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions DarkModeDiscovery/Arkenstone.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
2ECC35AB2D8957C60059FBCC /* Map.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2ECC35AA2D8957C60059FBCC /* Map.storyboard */; };
2ECC35AD2D8960A00059FBCC /* MapWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ECC35AC2D8960A00059FBCC /* MapWindowController.swift */; };
2ECC35AF2D8960AD0059FBCC /* MapViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ECC35AE2D8960AD0059FBCC /* MapViewController.swift */; };
2ECECDFA2E3CB3C200A1DC82 /* MessageLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ECECDF92E3CB3C200A1DC82 /* MessageLabel.swift */; };
2ECF7ADF2DB29A1600ECB6B7 /* PDMSupportingStar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ECF7ADE2DB29A1600ECB6B7 /* PDMSupportingStar.swift */; };
2ECFE08B2DB3705F0083FDBE /* PGKSupportingStar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ECFE08A2DB3705F0083FDBE /* PGKSupportingStar.swift */; };
4B0158E629103C0D009F1803 /* DarkModeDiscoveryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B0158E529103C0D009F1803 /* DarkModeDiscoveryTests.swift */; };
Expand Down Expand Up @@ -71,6 +72,7 @@
2ECC35AA2D8957C60059FBCC /* Map.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Map.storyboard; sourceTree = "<group>"; };
2ECC35AC2D8960A00059FBCC /* MapWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapWindowController.swift; sourceTree = "<group>"; };
2ECC35AE2D8960AD0059FBCC /* MapViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapViewController.swift; sourceTree = "<group>"; };
2ECECDF92E3CB3C200A1DC82 /* MessageLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageLabel.swift; sourceTree = "<group>"; };
2ECF7ADE2DB29A1600ECB6B7 /* PDMSupportingStar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDMSupportingStar.swift; sourceTree = "<group>"; };
2ECFE08A2DB3705F0083FDBE /* PGKSupportingStar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PGKSupportingStar.swift; sourceTree = "<group>"; };
2EE5FCCE2DD06D22000AC9CD /* UpdatingLocation.gpx */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = UpdatingLocation.gpx; sourceTree = "<group>"; };
Expand Down Expand Up @@ -146,6 +148,7 @@
4B7DD3AF297D33B700172BD4 /* CustomColors.swift */,
2ECFE08A2DB3705F0083FDBE /* PGKSupportingStar.swift */,
2ECF7ADE2DB29A1600ECB6B7 /* PDMSupportingStar.swift */,
2ECECDF92E3CB3C200A1DC82 /* MessageLabel.swift */,
);
path = FirstPartyCode;
sourceTree = "<group>";
Expand Down Expand Up @@ -426,6 +429,7 @@
2ECF7ADF2DB29A1600ECB6B7 /* PDMSupportingStar.swift in Sources */,
E06FED13289A86ED00538B55 /* Race.swift in Sources */,
E01D2D3A289A76A6009B932F /* Companion.swift in Sources */,
2ECECDFA2E3CB3C200A1DC82 /* MessageLabel.swift in Sources */,
4B6A98BB295CAF3400965FAF /* OptionsWindowController.swift in Sources */,
4B6C3D2C29704130001299E6 /* ItemImageView.swift in Sources */,
E00F8383288A4A04000D0A01 /* MainViewController.swift in Sources */,
Expand Down Expand Up @@ -716,23 +720,23 @@
repositoryURL = "https://github.com/perseusrealdeal/PerseusDarkMode";
requirement = {
kind = exactVersion;
version = 2.0.3;
version = 2.1.0;
};
};
2E9EC03C2DD90E8F00384398 /* XCRemoteSwiftPackageReference "ConsolePerseusLogger" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/perseusrealdeal/ConsolePerseusLogger";
requirement = {
kind = exactVersion;
version = 1.5.0;
version = 1.6.0;
};
};
2EC1A8592DEAEDFC001861B5 /* XCRemoteSwiftPackageReference "PerseusGeoKit" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/perseusrealdeal/PerseusGeoKit/";
requirement = {
kind = exactVersion;
version = 1.0.3;
version = 1.1.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "NO">
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
Expand Down
4 changes: 2 additions & 2 deletions DarkModeDiscovery/DarkModeDiscovery/AppGlobals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct AppGlobals {
didSet {
let location = currentLocation?.description ?? "current location is erased"
log.message("\(location) \(#function)", .info)
geolog.message("\(location) \(#function)", .debug, .custom)
GEO_LOG.message("\(location) \(#function)", .debug, .custom)
}
}

Expand Down Expand Up @@ -66,7 +66,7 @@ struct AppGlobals {
GeoCoordinator.shared.locationUpdatesRecieved = { updates in
if let thelastone = updates.last {
log.message("Location Updates: \(updates.count)")
geolog.message("Location Updates: \(updates.count)", .debug, .custom)
GEO_LOG.message("Location Updates: \(updates.count)", .debug, .custom)
AppGlobals.currentLocation = thelastone
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
//
// MessageLabel.swift
// PerseusRealDeal
//
// Created by Mikhail Zhigulin on 23.04.2021.
//
// INFO: Origionally from my "repost.maker" closed source project.
//
// Copyright © 7530 - 7534 Mikhail A. Zhigulin of Novosibirsk
// Copyright © 7530 - 7534 PerseusRealDeal
//
// All rights reserved.
//
// MIT License
//
// Copyright © 7530 - 7534 Mikhail Zhigulin of Novosibirsk
// Copyright © 7530 - 7534 PerseusRealDeal
//
// The year starts from the creation of the world according to a Slavic calendar.
// September, the 1st of Slavic year. It means that "Sep 01, 2024" is the beginning of 7533.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notices and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//

import ConsolePerseusLogger
import PerseusGeoKit
import PerseusDarkMode

#if canImport(UIKit)
import UIKit
#elseif canImport(Cocoa)
import Cocoa
#endif

#if os(iOS)
public typealias MyCustomLabel = UILabel
#elseif os(macOS)
public typealias MyCustomLabel = NSTextField
#endif

public let DEFAULT_MESSAGE_LABEL_TEXT = "Have a great time"

public class MessageLabel: MyCustomLabel, PerseusDelegatedMessage {

private var messageDeepCounter: Int = 0

public var messageDefaultGetter: (() -> String)?
public var messageDefault: String {
guard let getter = messageDefaultGetter else {
return DEFAULT_MESSAGE_LABEL_TEXT
}

return getter()
}

public var message = "" {
didSet {

// for now

#if os(iOS)
self.text = self.message
self.alpha = 1.0
#elseif os(macOS)
self.stringValue = self.message
self.alphaValue = 1.0
#endif

// for after now

guard self.message != self.messageDefault else {
return
}

self.messageDeepCounter += 1

let messageDefaultTemp = messageDefault

DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(3), execute: {
#if os(iOS)
UIView.animate(withDuration: 0.5) {
self.messageDeepCounter -= 1
if self.messageDeepCounter > 0 {
// do nothing
} else {
self.alpha = 0.0
}
}
#elseif os(macOS)
NSAnimationContext.runAnimationGroup({ context in
context.duration = 0.5

self.messageDeepCounter -= 1

if self.messageDeepCounter > 0 {
// do nothing
} else {
self.animator().alphaValue = 0.0
}

}, completionHandler: nil)
#endif
})

DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(4), execute: {
#if os(iOS)
UIView.animate(withDuration: 0.5) {
if self.messageDeepCounter > 0 {
// do nothing
} else {
self.text = messageDefaultTemp
self.alpha = 1.0
}
}
#elseif os(macOS)
NSAnimationContext.runAnimationGroup({ context in
context.duration = 0.5

if self.messageDeepCounter > 0 {
// do nothing
} else {
self.stringValue = messageDefaultTemp
self.animator().alphaValue = 1.0
}
}, completionHandler: nil)
#endif
})
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// PDMSupportingStar.swift
// Version: 2.0.1
// Version: 2.1.0
//
// The Darkness Support Classes (PerseusUISystemKit previously)
// The Darkness Support (PerseusUISystemKit previously)
//
//
// For iOS and macOS only. Use Stars to adopt for the specifics you need.
Expand Down Expand Up @@ -563,7 +563,7 @@ public class DarkModeImageView: UIImageView {
}
}

private(set) var darkModeObserver: DarkModeObserver?
private(set) var theDarknessTrigger: DarkModeObserver?

private(set) var light: UIImage?
private(set) var dark: UIImage?
Expand All @@ -579,7 +579,7 @@ public class DarkModeImageView: UIImageView {
}

private func configure() {
darkModeObserver = DarkModeObserver { style in
theDarknessTrigger = DarkModeObserver { style in
self.image = style == .light ? self.light : self.dark
}

Expand All @@ -590,7 +590,7 @@ public class DarkModeImageView: UIImageView {
self.light = light
self.dark = dark

darkModeObserver?.action = { style in
theDarknessTrigger?.action = { style in
self.image = style == .light ? self.light : self.dark
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// PGKSupportingStar.swift
// Version: 1.0.1
// Version: 1.1.0
//
// PerseusGeoKit Support Code
//
Expand Down Expand Up @@ -43,14 +43,14 @@
// swiftlint:disable file_length
//

import ConsolePerseusLogger
import PerseusGeoKit

#if os(iOS)
import UIKit
#endif
import MapKit

import ConsolePerseusLogger
import PerseusGeoKit

// MARK: - Geo Constants

let DEFAULT_ACCURACY: GeoAccuracy = .threeKilometers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0</string>
<string>2.2</string>
<key>CFBundleVersion</key>
<string>0</string>
<key>LSMinimumSystemVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

@IBOutlet private(set) weak var checkButtonAutoMapToCurrent: NSButton!

private var observation: NSKeyValueObservation?
private var logReportObservation: NSKeyValueObservation?
private var autoMapToCurrent = true

@IBOutlet private(set) weak var labelCoordinate: NSTextField!
Expand Down Expand Up @@ -85,11 +85,11 @@
GeoCoordinator.register(stakeholder: self, selector: #selector(reload))

// Connect to Log Reporting
observation = geoReport.observe(\.lastMessage, options: .new) { _, _ in
logReportObservation = localReport.observe(\.lastMessage, options: .new) { _, _ in
self.refreshLogReportTextView()
}

textScrollViewLog.isHidden = true
textScrollViewLog.isHidden = false
}

override func viewDidAppear() {
Expand Down Expand Up @@ -126,19 +126,19 @@

mapView.showsUserLocation = true

guard let location = AppGlobals.currentLocation else { return }
let point = AppGlobals.currentLocation ?? GeoPoint(DEFAULT_MAP_POINT)

let point = CLLocation(latitude: location.latitude, longitude: location.longitude)
let region = MKCoordinateRegion(center: point.coordinate,
let location = CLLocation(latitude: point.latitude, longitude: point.longitude)
let region = MKCoordinateRegion(center: location.coordinate,
latitudinalMeters: DEFAULT_MAP_RADIUS,
longitudinalMeters: DEFAULT_MAP_RADIUS)

mapView.setRegion(region, animated: true)
}

private func refreshLogReportTextView() {
// textViewLog.string = geoReport.text
textViewLog.string = localReport.text

// TODO: - Scroll to bottom

Check warning on line 142 in DarkModeDiscovery/DarkModeDiscovery/DemoContent/Location/MapViewController.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Todo (todo)

TODOs should be resolved (- Scroll to bottom)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="CompanionCollectionViewItem" customModule="DarkModeDiscovery" customModuleProvider="target">
<customObject id="-2" userLabel="File's Owner" customClass="CompanionCollectionViewItem" customModule="Arkenstone" customModuleProvider="target">
<connections>
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
</connections>
Expand All @@ -17,7 +17,7 @@
<rect key="frame" x="0.0" y="0.0" width="130" height="160"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="7U2-jg-3ut" customClass="ItemImageView" customModule="DarkModeDiscovery" customModuleProvider="target">
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="7U2-jg-3ut" customClass="ItemImageView" customModule="Arkenstone" customModuleProvider="target">
<rect key="frame" x="5" y="35" width="120" height="120"/>
<constraints>
<constraint firstAttribute="width" constant="120" id="FoR-Xw-QCb"/>
Expand All @@ -43,7 +43,7 @@
</constraints>
<point key="canvasLocation" x="27" y="-36"/>
</customView>
<customObject id="Ylp-Gc-GhI" customClass="CompanionCollectionViewItem" customModule="DarkModeDiscovery" customModuleProvider="target">
<customObject id="Ylp-Gc-GhI" customClass="CompanionCollectionViewItem" customModule="Arkenstone" customModuleProvider="target">
<connections>
<outlet property="imageView" destination="7U2-jg-3ut" id="DSc-45-1Wd"/>
<outlet property="textField" destination="Wwd-Sq-6zV" id="nec-zA-Yhn"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
<rect key="contentRect" x="99" y="99" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1025"/>
<value key="minSize" type="size" width="800" height="600"/>
<value key="minSize" type="size" width="650" height="500"/>
<view key="contentView" id="GXa-t6-a7S">
<rect key="frame" x="0.0" y="0.0" width="800" height="600"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down
Loading