From 9b52da940502a21a495d0f93b35e2bc46c215fe8 Mon Sep 17 00:00:00 2001 From: violet-dev Date: Sun, 31 Dec 2023 21:35:56 +0900 Subject: [PATCH 1/6] Add appbar to main page --- lib/pages/after_loading/afterloading_page.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/pages/after_loading/afterloading_page.dart b/lib/pages/after_loading/afterloading_page.dart index 370ce8e74..b57176507 100644 --- a/lib/pages/after_loading/afterloading_page.dart +++ b/lib/pages/after_loading/afterloading_page.dart @@ -6,6 +6,7 @@ import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:uni_links/uni_links.dart'; @@ -338,6 +339,10 @@ class AfterLoadingPageState extends State return false; }, child: Scaffold( + appBar: AppBar( + systemOverlayStyle: Settings.themeWhat + ? SystemUiOverlayStyle.dark + : SystemUiOverlayStyle.light), bottomNavigationBar: _usesBottomNavigationBar ? _buildBottomNavigationBar(context) : null, From 08a162c3b487397765f8867bca1b77462a72408e Mon Sep 17 00:00:00 2001 From: violet-dev Date: Mon, 1 Jan 2024 08:51:25 +0900 Subject: [PATCH 2/6] Except pure search on litemode --- lib/pages/settings/settings_page.dart | 44 +++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/pages/settings/settings_page.dart b/lib/pages/settings/settings_page.dart index 4c2f0866f..346387703 100644 --- a/lib/pages/settings/settings_page.dart +++ b/lib/pages/settings/settings_page.dart @@ -811,30 +811,30 @@ class _SettingsPageState extends State }, ), if (!Settings.liteMode) _buildDivider(), - // if (!Settings.liteMode) - InkWell( - child: ListTile( - leading: Icon(Mdi.compassOutline, color: Settings.majorColor), - title: const Text('Pure Search'), - trailing: Switch( - value: Settings.searchPure, - onChanged: (newValue) async { - await Settings.setSearchPure(newValue); - setState(() { - _shouldReload = true; - }); - }, - activeTrackColor: Settings.majorColor, - activeColor: Settings.majorAccentColor, + if (!Settings.liteMode) + InkWell( + child: ListTile( + leading: Icon(Mdi.compassOutline, color: Settings.majorColor), + title: const Text('Pure Search'), + trailing: Switch( + value: Settings.searchPure, + onChanged: (newValue) async { + await Settings.setSearchPure(newValue); + setState(() { + _shouldReload = true; + }); + }, + activeTrackColor: Settings.majorColor, + activeColor: Settings.majorAccentColor, + ), ), + onTap: () async { + await Settings.setSearchPure(!Settings.searchPure); + setState(() { + _shouldReload = true; + }); + }, ), - onTap: () async { - await Settings.setSearchPure(!Settings.searchPure); - setState(() { - _shouldReload = true; - }); - }, - ), _buildDivider(), InkWell( customBorder: const RoundedRectangleBorder( From 50682e98572c094bcbb4582db175babbd905e3e6 Mon Sep 17 00:00:00 2001 From: violet-dev Date: Mon, 1 Jan 2024 09:13:30 +0900 Subject: [PATCH 3/6] Revert "Add appbar to main page" This reverts commit 9b52da940502a21a495d0f93b35e2bc46c215fe8. --- lib/pages/after_loading/afterloading_page.dart | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/pages/after_loading/afterloading_page.dart b/lib/pages/after_loading/afterloading_page.dart index b57176507..370ce8e74 100644 --- a/lib/pages/after_loading/afterloading_page.dart +++ b/lib/pages/after_loading/afterloading_page.dart @@ -6,7 +6,6 @@ import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:uni_links/uni_links.dart'; @@ -339,10 +338,6 @@ class AfterLoadingPageState extends State return false; }, child: Scaffold( - appBar: AppBar( - systemOverlayStyle: Settings.themeWhat - ? SystemUiOverlayStyle.dark - : SystemUiOverlayStyle.light), bottomNavigationBar: _usesBottomNavigationBar ? _buildBottomNavigationBar(context) : null, From 4e9de63978b4fe5a704218b10b2533389fb318e5 Mon Sep 17 00:00:00 2001 From: violet-dev Date: Mon, 1 Jan 2024 09:15:18 +0900 Subject: [PATCH 4/6] Revert "ios: full screen error" This reverts commit 97fbe6afff9120e9ab7968bcd734494f54133b1d. --- lib/pages/viewer/viewer_controller.dart | 2 +- lib/pages/viewer/viewer_page.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pages/viewer/viewer_controller.dart b/lib/pages/viewer/viewer_controller.dart index a6231c92d..8adc4a661 100644 --- a/lib/pages/viewer/viewer_controller.dart +++ b/lib/pages/viewer/viewer_controller.dart @@ -40,7 +40,7 @@ class ViewerController extends GetxController { var animation = Settings.animation.obs; var rightToLeft = Settings.rightToLeft.obs; var imgQuality = Settings.imageQuality.obs; - var fullscreen = (!Settings.disableFullScreen || Platform.isIOS).obs; + var fullscreen = (!Settings.disableFullScreen).obs; /// horizontal viewer option var viewScrollType = diff --git a/lib/pages/viewer/viewer_page.dart b/lib/pages/viewer/viewer_page.dart index 71a096b76..52de9f42d 100644 --- a/lib/pages/viewer/viewer_page.dart +++ b/lib/pages/viewer/viewer_page.dart @@ -131,7 +131,7 @@ class _ViewerPageState extends State { _initProvider = CallOnce(_initAfterProvider); _startsTime = DateTime.now(); - if (!Settings.disableFullScreen || Platform.isIOS) { + if (!Settings.disableFullScreen) { SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); } From 674e7fdb7a90c60b93e89c4874a7f8ef9a2b34ca Mon Sep 17 00:00:00 2001 From: violet-dev Date: Mon, 1 Jan 2024 09:15:33 +0900 Subject: [PATCH 5/6] Revert "ios: Fix viewer full screen error" This reverts commit ba0ff79bd074f547c7996be9833a76c98bc4915c. --- lib/pages/viewer/viewer_controller.dart | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/pages/viewer/viewer_controller.dart b/lib/pages/viewer/viewer_controller.dart index 8adc4a661..c10360235 100644 --- a/lib/pages/viewer/viewer_controller.dart +++ b/lib/pages/viewer/viewer_controller.dart @@ -1,8 +1,6 @@ // This source code is a part of Project Violet. // Copyright (C) 2020-2023. violet-team. Licensed under the Apache-2.0 License. -import 'dart:io'; - import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -216,14 +214,14 @@ class ViewerController extends GetxController { if (!overlay.value) { overlay.value = !overlay.value; opacity.value = 1.0; - if (!Settings.disableFullScreen || Platform.isIOS) { + if (!Settings.disableFullScreen) { SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [ SystemUiOverlay.top, SystemUiOverlay.bottom, ]); } } else { - if (!Settings.disableFullScreen || Platform.isIOS) { + if (!Settings.disableFullScreen) { SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); } opacity.value = 0.0; From 0712701161801520df2cb997c9051ecddb0df628 Mon Sep 17 00:00:00 2001 From: violet-dev Date: Mon, 1 Jan 2024 09:18:25 +0900 Subject: [PATCH 6/6] Set AnnotatedRegion --- .../after_loading/afterloading_page.dart | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/lib/pages/after_loading/afterloading_page.dart b/lib/pages/after_loading/afterloading_page.dart index 370ce8e74..69c72f3f4 100644 --- a/lib/pages/after_loading/afterloading_page.dart +++ b/lib/pages/after_loading/afterloading_page.dart @@ -6,6 +6,7 @@ import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:uni_links/uni_links.dart'; @@ -342,26 +343,31 @@ class AfterLoadingPageState extends State ? _buildBottomNavigationBar(context) : null, drawer: _usesDrawer ? _buildDrawer(context) : null, - body: Stack( - children: [ - if (kReleaseMode) const ScriptWebView(), - PageView( - controller: _pageController, - physics: - _usesDrawer ? const NeverScrollableScrollPhysics() : null, - onPageChanged: (newPage) { - setState(() {}); - }, - children: [ - if (!Settings.liteMode) MainPage(key: _widgetKeys[0]), - SearchPage(key: _widgetKeys[1]), - if (Settings.liteMode) HotPage(key: _widgetKeys[2]), - BookmarkPage(key: _widgetKeys[3]), - DownloadPage(key: _widgetKeys[4]), - SettingsPage(key: _widgetKeys[5]), - ], - ), - ], + body: AnnotatedRegion( + value: Settings.themeWhat + ? SystemUiOverlayStyle.dark + : SystemUiOverlayStyle.light, + child: Stack( + children: [ + if (kReleaseMode) const ScriptWebView(), + PageView( + controller: _pageController, + physics: + _usesDrawer ? const NeverScrollableScrollPhysics() : null, + onPageChanged: (newPage) { + setState(() {}); + }, + children: [ + if (!Settings.liteMode) MainPage(key: _widgetKeys[0]), + SearchPage(key: _widgetKeys[1]), + if (Settings.liteMode) HotPage(key: _widgetKeys[2]), + BookmarkPage(key: _widgetKeys[3]), + DownloadPage(key: _widgetKeys[4]), + SettingsPage(key: _widgetKeys[5]), + ], + ), + ], + ), ), ), );