Skip to content

Commit

Permalink
default language & white popup background fix
Browse files Browse the repository at this point in the history
  • Loading branch information
whoeevee committed Jul 13, 2024
1 parent 98f6f9e commit c407874
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
18 changes: 10 additions & 8 deletions Sources/EeveeSpotify/DarkPopUps.x.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ class EncoreLabelHook: ClassHook<UIView> {
}
}

class SPTEncorePopUpDialogHook: ClassHook<NSObject> {
class SPTEncorePopUpContainerHook: ClassHook<UIViewController> {

typealias Group = DarkPopUps
static let targetName = "SPTEncorePopUpDialog"

func uiView() -> UIView {
let view = orig.uiView()
view.backgroundColor = UIColor(Color(hex: "#242424"))

return view
static let targetName = "SPTEncorePopUpContainer"

func containedView() -> SPTEncorePopUpDialog {
return orig.containedView()
}

func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
containedView().uiView().backgroundColor = UIColor(Color(hex: "#242424"))
return orig.supportedInterfaceOrientations()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ extension UserDefaults {
return lyricsOptions
}

return LyricsOptions(romanization: false, musixmatchLanguage: "")
return LyricsOptions(
romanization: false,
musixmatchLanguage: Locale.current.languageCode ?? ""
)
}
set (lyricsOptions) {
defaults.set(try! JSONEncoder().encode(lyricsOptions), forKey: lyricsOptionsKey)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Foundation
import UIKit

@objc protocol SPTEncorePopUpDialog {
func `init`() -> SPTEncorePopUpDialog
func uiView() -> UIView
func update(_ popUpModel: SPTEncorePopUpDialogModel)
func setEventHandler(_ handler: @escaping (_ state: ClickState) -> Void)
}
Expand Down

0 comments on commit c407874

Please sign in to comment.