diff --git a/assets/translation.json b/assets/translation.json index f213c0a..73539a0 100644 --- a/assets/translation.json +++ b/assets/translation.json @@ -189,7 +189,8 @@ "Quick Favorite": "快速收藏", "Long press on the favorite button to quickly add to this folder": "长按收藏按钮快速添加到这个文件夹", "Added": "已添加", - "Turn page by volume keys": "使用音量键翻页" + "Turn page by volume keys": "使用音量键翻页", + "Display time & battery info in reader":"在阅读器中显示时间和电量信息" }, "zh_TW": { "Home": "首頁", @@ -381,6 +382,7 @@ "Quick Favorite": "快速收藏", "Long press on the favorite button to quickly add to this folder": "長按收藏按鈕快速添加到這個文件夾", "Added": "已添加", - "Turn page by volume keys": "使用音量鍵翻頁" + "Turn page by volume keys": "使用音量鍵翻頁", + "Display time & battery info in reader":"在閱讀器中顯示時間和電量信息" } } \ No newline at end of file diff --git a/lib/foundation/appdata.dart b/lib/foundation/appdata.dart index dc93fb8..afd1522 100644 --- a/lib/foundation/appdata.dart +++ b/lib/foundation/appdata.dart @@ -118,6 +118,7 @@ class _Settings with ChangeNotifier { 'dataVersion': 0, 'quickFavorite': null, 'enableTurnPageByVolumeKey': true, + 'enableClockAndBatteryInfoInReader': true, }; operator [](String key) { diff --git a/lib/pages/reader/scaffold.dart b/lib/pages/reader/scaffold.dart index 89e0944..265fc11 100644 --- a/lib/pages/reader/scaffold.dart +++ b/lib/pages/reader/scaffold.dart @@ -426,17 +426,21 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> { } Widget buildStatusInfo() { - return Positioned( - bottom: 13, - right: 25, - child: Row( - children: [ - _ClockWidget(), - const SizedBox(width: 10), - _BatteryWidget(), - ], - ), - ); + if(appdata.settings['enableClockAndBatteryInfoInReader']) { + return Positioned( + bottom: 13, + right: 25, + child: Row( + children: [ + _ClockWidget(), + const SizedBox(width: 10), + _BatteryWidget(), + ], + ), + ); + } else { + return const SizedBox.shrink(); + } } void openChapterDrawer() { diff --git a/lib/pages/settings/reader.dart b/lib/pages/settings/reader.dart index 3635800..e982dc3 100644 --- a/lib/pages/settings/reader.dart +++ b/lib/pages/settings/reader.dart @@ -77,6 +77,13 @@ class _ReaderSettingsState extends State { widget.onChanged?.call('enableTurnPageByVolumeKey'); }, ).toSliver(), + _SwitchSetting( + title: "Display time & battery info in reader".tl, + settingKey: "enableClockAndBatteryInfoInReader", + onChanged: () { + widget.onChanged?.call("enableClockAndBatteryInfoInReader"); + }, + ).toSliver(), ], ); }