From 40a7892e11ec44e27a613cf937df6a109d9150ad Mon Sep 17 00:00:00 2001 From: S0meyosh1no <147923950+slds1@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:38:53 +0300 Subject: [PATCH] updates --- LiveContainerSwiftUI/LCAppBanner.swift | 13 +-- LiveContainerSwiftUI/LCSettingsView.swift | 20 +++++ LiveContainerSwiftUI/Localizable.xcstrings | 97 +++++++++++++++------- 3 files changed, 92 insertions(+), 38 deletions(-) diff --git a/LiveContainerSwiftUI/LCAppBanner.swift b/LiveContainerSwiftUI/LCAppBanner.swift index c3fdd26..eac23ed 100644 --- a/LiveContainerSwiftUI/LCAppBanner.swift +++ b/LiveContainerSwiftUI/LCAppBanner.swift @@ -34,6 +34,7 @@ struct LCAppBanner : View { @State private var errorShow = false @State private var errorInfo = "" + @AppStorage("dynamicColors") var dynamicColors = true @EnvironmentObject private var sharedModel : SharedModel @@ -83,8 +84,8 @@ struct LCAppBanner : View { } } - Text("\(appInfo.version()) - \(appInfo.bundleIdentifier())").font(.system(size: 12)).foregroundColor(extractMainHueColor(from: appInfo.icon())) - Text(LocalizedStringKey(model.uiDataFolder == nil ? "lc.appBanner.noDataFolder".loc : model.uiDataFolder!)).font(.system(size: 8)).foregroundColor(extractMainHueColor(from: appInfo.icon())) + Text("\(appInfo.version()) - \(appInfo.bundleIdentifier())").font(.system(size: 12)).foregroundColor(dynamicColors ? extractMainHueColor(from: appInfo.icon()) : Color("FontColor")) + Text(LocalizedStringKey(model.uiDataFolder == nil ? "lc.appBanner.noDataFolder".loc : model.uiDataFolder!)).font(.system(size: 8)).foregroundColor(dynamicColors ? extractMainHueColor(from: appInfo.icon()) : Color("FontColor")) }) } Spacer() @@ -104,14 +105,14 @@ struct LCAppBanner : View { .fixedSize() .background(GeometryReader { g in if !model.isSigningInProgress { - Capsule().fill(extractMainHueColor(from: appInfo.icon())) + Capsule().fill(dynamicColors ? extractMainHueColor(from: appInfo.icon()) : Color("FontColor")) } else { let w = g.size.width let h = g.size.height Capsule() - .fill(extractMainHueColor(from: appInfo.icon())).opacity(0.2) + .fill(dynamicColors ? extractMainHueColor(from: appInfo.icon()) : Color("FontColor")).opacity(0.2) Circle() - .fill(extractMainHueColor(from: appInfo.icon())) + .fill(dynamicColors ? extractMainHueColor(from: appInfo.icon()) : Color("FontColor")) .frame(width: w * 2, height: w * 2) .offset(x: (model.signProgress - 2) * w, y: h/2-w) } @@ -123,7 +124,7 @@ struct LCAppBanner : View { } .padding() .frame(height: 88) - .background(RoundedRectangle(cornerSize: CGSize(width:22, height: 22)).fill(extractMainHueColor(from: appInfo.icon()).opacity(0.5))) + .background(RoundedRectangle(cornerSize: CGSize(width:22, height: 22)).fill(dynamicColors ? extractMainHueColor(from: appInfo.icon()).opacity(0.5) : Color("AppBannerBG"))) .onAppear() { handleOnAppear() } diff --git a/LiveContainerSwiftUI/LCSettingsView.swift b/LiveContainerSwiftUI/LCSettingsView.swift index 79c5053..d085ba0 100644 --- a/LiveContainerSwiftUI/LCSettingsView.swift +++ b/LiveContainerSwiftUI/LCSettingsView.swift @@ -32,6 +32,7 @@ struct LCSettingsView: View { @State var silentSwitchApp = false @State var injectToLCItelf = false @State var strictHiding = false + @AppStorage("dynamicColors") var dynamicColors = true @State var sideJITServerAddress : String @State var deviceUDID: String @@ -152,6 +153,25 @@ struct LCSettingsView: View { Text("lc.settings.JitDesc".loc) } + Section{ + Toggle(isOn: $dynamicColors) { + Text("lc.settings.dynamicColors".loc) + } + } header: { + Text("lc.settings.interface".loc) + } footer: { + Text("lc.settings.dynamicColors.desc".loc) + } + // MARK: Go here! + // MARK: Go here! + // MARK: Go here! + // MARK: Go here! + // MARK: Go here! // MARK: Go here! + // MARK: Go here! // MARK: Go here! // MARK: Go here! + // MARK: Go here! + // MARK: Go here! + // MARK: Go here! // MARK: Go here! + // MARK: Go here! Section{ Toggle(isOn: $frameShortIcon) { Text("lc.settings.FrameIcon".loc) diff --git a/LiveContainerSwiftUI/Localizable.xcstrings b/LiveContainerSwiftUI/Localizable.xcstrings index c786f4f..263f79c 100644 --- a/LiveContainerSwiftUI/Localizable.xcstrings +++ b/LiveContainerSwiftUI/Localizable.xcstrings @@ -137,6 +137,23 @@ } } }, + "lc.appBanner.locked" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "LOCKED" + } + }, + "zh_CN" : { + "stringUnit" : { + "state" : "translated", + "value" : "锁定" + } + } + } + }, "lc.appBanner.noDataFolder" : { "extractionState" : "manual", "localizations" : { @@ -222,23 +239,6 @@ } } }, - "lc.appBanner.locked" : { - "extractionState" : "manual", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "LOCKED" - } - }, - "zh_CN" : { - "stringUnit" : { - "state" : "translated", - "value" : "锁定" - } - } - } - }, "lc.appBanner.uninstall" : { "extractionState" : "manual", "localizations" : { @@ -807,87 +807,87 @@ } } }, - "lc.appSettings.lockApp" : { + "lc.appSettings.hideApp" : { "extractionState" : "manual", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "Lock App" + "value" : "Hide App" } }, "zh_CN" : { "stringUnit" : { "state" : "translated", - "value" : "锁定App" + "value" : "隐藏App" } } } }, - "lc.appSettings.hideApp" : { + "lc.appSettings.hideAppDesc" : { "extractionState" : "manual", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "Hide App" + "value" : "To completely hide apps, enable Strict Hiding mode in settings." } }, "zh_CN" : { "stringUnit" : { "state" : "translated", - "value" : "隐藏App" + "value" : "要完全隐藏App,请在设置中启用严格隐藏模式。" } } } }, - "lc.appSettings.hideAppDesc" : { + "lc.appSettings.launchWithJit" : { "extractionState" : "manual", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "To completely hide apps, enable Strict Hiding mode in settings." + "value" : "Launch with JIT" } }, "zh_CN" : { "stringUnit" : { "state" : "translated", - "value" : "要完全隐藏App,请在设置中启用严格隐藏模式。" + "value" : "带JIT启动" } } } }, - "lc.appSettings.launchWithJit" : { + "lc.appSettings.launchWithJitDesc" : { "extractionState" : "manual", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "Launch with JIT" + "value" : "LiveContainer will try to acquire JIT permission before launching the app." } }, "zh_CN" : { "stringUnit" : { "state" : "translated", - "value" : "带JIT启动" + "value" : "在启动App前LiveContainer会尝试获取JIT权限。" } } } }, - "lc.appSettings.launchWithJitDesc" : { + "lc.appSettings.lockApp" : { "extractionState" : "manual", "localizations" : { "en" : { "stringUnit" : { "state" : "translated", - "value" : "LiveContainer will try to acquire JIT permission before launching the app." + "value" : "Lock App" } }, "zh_CN" : { "stringUnit" : { "state" : "translated", - "value" : "在启动App前LiveContainer会尝试获取JIT权限。" + "value" : "锁定App" } } } @@ -1647,6 +1647,28 @@ } } }, + "lc.settings.dynamicColors" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Dynamic colors" + } + } + } + }, + "lc.settings.dynamicColors.desc" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Enable dynamic colors for app boxes" + } + } + } + }, "lc.settings.error.altstoreNotPatched" : { "extractionState" : "manual", "localizations" : { @@ -1766,6 +1788,17 @@ } } }, + "lc.settings.interface" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "interface" + } + } + } + }, "lc.settings.JitAddress" : { "extractionState" : "manual", "localizations" : {