From d140f0b384206864a50f771fb4ef76bf120acb94 Mon Sep 17 00:00:00 2001 From: Mark Chan <45706356+WindowsMEMZ@users.noreply.github.com> Date: Mon, 22 Jan 2024 01:18:34 +0800 Subject: [PATCH] Fix some settings don't make efforts (#87) * Update MainView.swift * Update PersonAccountView.swift * Update VideoPlayerView.swift * Update VideoPlayerView.swift --- DarockBili Watch App/InMain/MainView.swift | 9 +++++++-- .../PersonalCenter/PersonAccountView.swift | 3 ++- .../Video/VideoPlayerView.swift | 18 +++++++++--------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/DarockBili Watch App/InMain/MainView.swift b/DarockBili Watch App/InMain/MainView.swift index 2a3fc8e92..0988fca7e 100644 --- a/DarockBili Watch App/InMain/MainView.swift +++ b/DarockBili Watch App/InMain/MainView.swift @@ -52,6 +52,7 @@ struct MainView: View { @AppStorage("SESSDATA") var sessdata = "" @AppStorage("bili_jct") var biliJct = "" @AppStorage("UpdateTipIgnoreVersion") var updateTipIgnoreVersion = "" + @AppStorage("IsShowNetworkFixing") var isShowNetworkFixing = true @State var videos = [[String: String]]() @State var isSearchPresented = false @State var notice = "" @@ -199,12 +200,16 @@ struct MainView: View { isLoadingNew = false } else { isFailedToLoad = true - isNetworkFixPresented = true + if isShowNetworkFixing { + isNetworkFixPresented = true + } } } } else { isFailedToLoad = true - isNetworkFixPresented = true + if isShowNetworkFixing { + isNetworkFixPresented = true + } } } } diff --git a/DarockBili Watch App/PersonalCenter/PersonAccountView.swift b/DarockBili Watch App/PersonalCenter/PersonAccountView.swift index 3c39a0211..96699415e 100644 --- a/DarockBili Watch App/PersonalCenter/PersonAccountView.swift +++ b/DarockBili Watch App/PersonalCenter/PersonAccountView.swift @@ -91,6 +91,7 @@ struct PersonAccountView: View { @AppStorage("DedeUserID__ckMd5") var dedeUserID__ckMd5 = "" @AppStorage("SESSDATA") var sessdata = "" @AppStorage("bili_jct") var biliJct = "" + @AppStorage("IsShowNetworkFixing") var isShowNetworkFixing = true @State var isLoginPresented = false @State var username = "" @State var userSign = "" @@ -239,7 +240,7 @@ struct PersonAccountView: View { username = respJson["data"]["name"].string ?? "" userSign = respJson["data"]["sign"].string ?? "" userFaceUrl = respJson["data"]["face"].string ?? "E" - } else { + } else if isShowNetworkFixing { isNetworkFixPresented = true } } diff --git a/DarockBili Watch App/Video/VideoPlayerView.swift b/DarockBili Watch App/Video/VideoPlayerView.swift index 1cf2cab78..6f47b72bc 100644 --- a/DarockBili Watch App/Video/VideoPlayerView.swift +++ b/DarockBili Watch App/Video/VideoPlayerView.swift @@ -122,15 +122,6 @@ struct VideoPlayerView: View { hideDigitalTime(false) playerTimer?.invalidate() } - .accessibilityQuickAction(style: .prompt) { - if isVideoPlayerGestureEnabled { - Button(action: { - player?.pause() - }, label: { - - }) - } - } .tag(1) ScrollView { VStack { @@ -196,6 +187,15 @@ struct VideoPlayerView: View { // } } .ignoresSafeArea() + .accessibilityQuickAction(style: .prompt) { + if isVideoPlayerGestureEnabled { + Button(action: { + player?.pause() + }, label: { + Text("Pause") + }) + } + } .onAppear { let pExtension = AVExtension(VideoDetailView.willPlayVideoLink)! player = pExtension.getPlayer()