Skip to content

Commit

Permalink
SwitchListTile
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangtian616 committed May 21, 2024
1 parent fef3bf0 commit 0465d39
Show file tree
Hide file tree
Showing 12 changed files with 149 additions and 148 deletions.
7 changes: 3 additions & 4 deletions lib/src/l18n/en_US.dart
Original file line number Diff line number Diff line change
Expand Up @@ -711,16 +711,15 @@ class en_US {
'notSameBlockingRuleTargetHint': 'All sub-rules should have the same blocking target',
'blockingRuleHelp': '''
Blocking Target: Filter galleries on the list page or filter comments on the details page. All sub-rules under the same rule must have the same blocking target.
Blocking Attribute: Specify the attribute of the target based on which the rule is written to block.
Blocking Pattern: Use regular expressions for complex scenarios.
Blocking Expression: Simple strings or regular expressions.
Note1: Different rules have an OR (||) relationship, while all sub-rules under the same rule have an AND (&&) relationship.
Note2: When blocking tag, the rule will check each tag in the gallery, the expression should be written for a single tag.
Example 1: Block galleries that have the "yaoi" tag and do not have the "tomgirl" tag————Gallery Tag Contain yaoi && Gallery Tag NotContain tomgirl
Example 2: Block comments with a score not exceeding 10————Comment Score <= 10
''',

/// quick search page
Expand Down
7 changes: 3 additions & 4 deletions lib/src/l18n/ko_KR.dart
Original file line number Diff line number Diff line change
Expand Up @@ -710,16 +710,15 @@ class ko_KR {
'notSameBlockingRuleTargetHint': 'All sub-rules should have the same blocking target',
'blockingRuleHelp': '''
Blocking Target: Filter galleries on the list page or filter comments on the details page. All sub-rules under the same rule must have the same blocking target.
Blocking Attribute: Specify the attribute of the target based on which the rule is written to block.
Blocking Pattern: Use regular expressions for complex scenarios.
Blocking Expression: Simple strings or regular expressions.
Note1: Different rules have an OR (||) relationship, while all sub-rules under the same rule have an AND (&&) relationship.
Note2: When blocking tag, the rule will check each tag in the gallery, the expression should be written for a single tag.
Example 1: Block galleries that have the "yaoi" tag and do not have the "tomgirl" tag————Gallery Tag Contain yaoi && Gallery Tag NotContain tomgirl
Example 2: Block comments with a score not exceeding 10————Comment Score <= 10
''',

/// quick search page
Expand Down
7 changes: 3 additions & 4 deletions lib/src/l18n/pt_BR.dart
Original file line number Diff line number Diff line change
Expand Up @@ -713,16 +713,15 @@ class pt_BR {
'notSameBlockingRuleTargetHint': 'All sub-rules should have the same blocking target',
'blockingRuleHelp': '''
Blocking Target: Filter galleries on the list page or filter comments on the details page. All sub-rules under the same rule must have the same blocking target.
Blocking Attribute: Specify the attribute of the target based on which the rule is written to block.
Blocking Pattern: Use regular expressions for complex scenarios.
Blocking Expression: Simple strings or regular expressions.
Note1: Different rules have an OR (||) relationship, while all sub-rules under the same rule have an AND (&&) relationship.
Note2: When blocking tag, the rule will check each tag in the gallery, the expression should be written for a single tag.
Example 1: Block galleries that have the "yaoi" tag and do not have the "tomgirl" tag————Gallery Tag Contain yaoi && Gallery Tag NotContain tomgirl
Example 2: Block comments with a score not exceeding 10————Comment Score <= 10
''',

/// quick search page
Expand Down
7 changes: 3 additions & 4 deletions lib/src/l18n/zh_CN.dart
Original file line number Diff line number Diff line change
Expand Up @@ -716,16 +716,15 @@ favnote:匹配收藏备注
'notSameBlockingRuleTargetHint': '所有子规则的屏蔽目标需要相同',
'blockingRuleHelp': '''
屏蔽目标:在列表页过滤画廊或者在详情页过滤评论,同一规则下所有子规则的屏蔽目标必须相同。
屏蔽属性:根据目标的哪个属性来编写规则进行屏蔽。
屏蔽规则:复杂场景可使用正则表达式匹配。
屏蔽表达式:简单字符串或者正则表达式。
注意1:不同规则之间是||的关系,同一规则下所有子规则之间是&&的关系。
注意2:屏蔽属性为标签时,规则会对画廊的每一个标签均进行校验,表达式针对单个标签进行编写即可。
示例1:屏蔽有男同标签且无伪娘标签的画廊————画廊标签包含yaoi && 画廊标签不包含tomgirl
示例2:屏蔽评分不超过10分的评论————评论评分<=10
''',

/// quick search page
Expand Down
9 changes: 4 additions & 5 deletions lib/src/l18n/zh_TW.dart
Original file line number Diff line number Diff line change
Expand Up @@ -714,16 +714,15 @@ favnote:匹配收藏備注
'notSameBlockingRuleTargetHint': '所有子規則的屏蔽目標需要相同',
'blockingRuleHelp': '''
屏蔽目標:在列表頁過濾畫廊或者在詳情頁過濾評論,同壹規則下所有子規則的屏蔽目標必須相同。
屏蔽屬性:根據目標的哪個屬性來編寫規則進行屏蔽。
屏蔽規則:複雜場景可使用正則表達式匹配。
屏蔽表達式:簡單字符串或者正則表達式。
註意1:不同規則之間是||的關系,同一規則下所有子規則之間是&&的關系。
注意1:不同規則之間是||的關系,同壹規則下所有子規則之間是&&的關系。
注意2:屏蔽屬性爲標簽時,規則會對畫廊的每壹個標簽均進行校驗,表達式針對單個標簽進行編寫即可。
註意2:屏蔽屬性為標簽時,規則會對畫廊的每一個標簽均進行校驗,表達式針對單個標簽進行編寫即可。
示例1:屏蔽有男同標簽且無僞娘標簽的畫廊————畫廊標簽包含yaoi && 畫廊標簽不包含tomgirl
示例2:屏蔽評分不超過10分的評論————評論評分<=10
''',

/// quick search page
Expand Down
20 changes: 12 additions & 8 deletions lib/src/pages/setting/advanced/setting_advanced_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ class _SettingAdvancedPageState extends State<SettingAdvancedPage> {
}

Widget _buildRecordAllLogs() {
return ListTile(
return SwitchListTile(
title: Text('enableVerboseLogging'.tr),
subtitle: Text('needRestart'.tr),
trailing: Switch(value: AdvancedSetting.enableVerboseLogging.value, onChanged: AdvancedSetting.saveEnableVerboseLogging),
value: AdvancedSetting.enableVerboseLogging.value,
onChanged: AdvancedSetting.saveEnableVerboseLogging,
);
}

Expand Down Expand Up @@ -154,16 +155,18 @@ class _SettingAdvancedPageState extends State<SettingAdvancedPage> {
}

Widget _buildCheckUpdate() {
return ListTile(
return SwitchListTile(
title: Text('checkUpdateAfterLaunchingApp'.tr),
trailing: Switch(value: AdvancedSetting.enableCheckUpdate.value, onChanged: AdvancedSetting.saveEnableCheckUpdate),
value: AdvancedSetting.enableCheckUpdate.value,
onChanged: AdvancedSetting.saveEnableCheckUpdate,
);
}

Widget _buildCheckClipboard() {
return ListTile(
return SwitchListTile(
title: Text('checkClipboard'.tr),
trailing: Switch(value: AdvancedSetting.enableCheckClipboard.value, onChanged: AdvancedSetting.saveEnableCheckClipboard),
value: AdvancedSetting.enableCheckClipboard.value,
onChanged: AdvancedSetting.saveEnableCheckClipboard,
);
}

Expand All @@ -188,9 +191,10 @@ class _SettingAdvancedPageState extends State<SettingAdvancedPage> {
}

Widget _buildInNoImageMode() {
return ListTile(
return SwitchListTile(
title: Text('noImageMode'.tr),
trailing: Switch(value: AdvancedSetting.inNoImageMode.value, onChanged: AdvancedSetting.saveInNoImageMode),
value: AdvancedSetting.inNoImageMode.value,
onChanged: AdvancedSetting.saveInNoImageMode,
);
}

Expand Down
46 changes: 21 additions & 25 deletions lib/src/pages/setting/download/setting_download_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,16 @@ class _SettingDownloadPageState extends State<SettingDownloadPage> {
}

Widget _buildDownloadOriginalImage() {
return ListTile(
return SwitchListTile(
title: Text('downloadOriginalImageByDefault'.tr),
trailing: Switch(
value: DownloadSetting.downloadOriginalImageByDefault.value,
onChanged: (value) {
if (!UserSetting.hasLoggedIn()) {
toast('needLoginToOperate'.tr);
return;
}
DownloadSetting.saveDownloadOriginalImageByDefault(value);
},
),
value: DownloadSetting.downloadOriginalImageByDefault.value,
onChanged: (value) {
if (!UserSetting.hasLoggedIn()) {
toast('needLoginToOperate'.tr);
return;
}
DownloadSetting.saveDownloadOriginalImageByDefault(value);
},
);
}

Expand Down Expand Up @@ -244,13 +242,11 @@ class _SettingDownloadPageState extends State<SettingDownloadPage> {
}

Widget _buildDownloadAllGallerysOfSamePriority() {
return ListTile(
return SwitchListTile(
title: Text('downloadAllGallerysOfSamePriority'.tr),
subtitle: Text('${'downloadAllGallerysOfSamePriorityHint'.tr} | ${'needRestart'.tr}'),
trailing: Switch(
value: DownloadSetting.downloadAllGallerysOfSamePriority.value,
onChanged: DownloadSetting.saveDownloadAllGallerysOfSamePriority,
),
value: DownloadSetting.downloadAllGallerysOfSamePriority.value,
onChanged: DownloadSetting.saveDownloadAllGallerysOfSamePriority,
);
}

Expand Down Expand Up @@ -279,17 +275,19 @@ class _SettingDownloadPageState extends State<SettingDownloadPage> {
}

Widget _buildManageArchiveDownloadConcurrency() {
return ListTile(
return SwitchListTile(
title: Text('manageArchiveDownloadConcurrency'.tr),
subtitle: Text('manageArchiveDownloadConcurrencyHint'.tr),
trailing: Switch(value: DownloadSetting.manageArchiveDownloadConcurrency.value, onChanged: DownloadSetting.saveManageArchiveDownloadConcurrency),
value: DownloadSetting.manageArchiveDownloadConcurrency.value,
onChanged: DownloadSetting.saveManageArchiveDownloadConcurrency,
);
}

Widget _buildDeleteArchiveFileAfterDownload() {
return ListTile(
return SwitchListTile(
title: Text('deleteArchiveFileAfterDownload'.tr),
trailing: Switch(value: DownloadSetting.deleteArchiveFileAfterDownload.value, onChanged: DownloadSetting.saveDeleteArchiveFileAfterDownload),
value: DownloadSetting.deleteArchiveFileAfterDownload.value,
onChanged: DownloadSetting.saveDeleteArchiveFileAfterDownload,
);
}

Expand All @@ -302,13 +300,11 @@ class _SettingDownloadPageState extends State<SettingDownloadPage> {
}

Widget _buildRestoreTasksAutomatically() {
return ListTile(
return SwitchListTile(
title: Text('restoreTasksAutomatically'.tr),
subtitle: Text('restoreTasksAutomaticallyHint'.tr),
trailing: Switch(
value: DownloadSetting.restoreTasksAutomatically.value,
onChanged: DownloadSetting.saveRestoreTasksAutomatically,
),
value: DownloadSetting.restoreTasksAutomatically.value,
onChanged: DownloadSetting.saveRestoreTasksAutomatically,
);
}

Expand Down
8 changes: 5 additions & 3 deletions lib/src/pages/setting/eh/setting_eh_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class _SettingEHPageState extends State<SettingEHPage> {
Widget _buildSiteSegmentControl() {
return ListTile(
title: Text('site'.tr),
onTap: () => EHSetting.saveSite(EHSetting.site.value == 'EH' ? 'EX' : 'EH'),
trailing: CupertinoSlidingSegmentedControl<String>(
groupValue: EHSetting.site.value,
children: const {
Expand All @@ -83,11 +84,12 @@ class _SettingEHPageState extends State<SettingEHPage> {
return const SizedBox();
}

return ListTile(
return SwitchListTile(
title: Text('redirect2Eh'.tr),
subtitle: Text('redirect2EhHint'.tr),
trailing: Switch(value: EHSetting.redirect2Eh.value, onChanged: EHSetting.saveRedirect2Eh).fadeIn(),
);
value: EHSetting.redirect2Eh.value,
onChanged: EHSetting.saveRedirect2Eh,
).fadeIn();
}

Widget _buildProfile() {
Expand Down
5 changes: 3 additions & 2 deletions lib/src/pages/setting/network/setting_network_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ class SettingNetworkPage extends StatelessWidget {
}

Widget _buildEnableDomainFronting() {
return ListTile(
return SwitchListTile(
title: Text('enableDomainFronting'.tr),
subtitle: Text('bypassSNIBlocking'.tr),
trailing: Switch(value: NetworkSetting.enableDomainFronting.value, onChanged: NetworkSetting.saveEnableDomainFronting),
value: NetworkSetting.enableDomainFronting.value,
onChanged: NetworkSetting.saveEnableDomainFronting,
);
}

Expand Down
48 changes: 18 additions & 30 deletions lib/src/pages/setting/preference/setting_preference_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,11 @@ class SettingPreferencePage extends StatelessWidget {
}

Widget _buildSimpleDashboardMode() {
return ListTile(
return SwitchListTile(
title: Text('simpleDashboardMode'.tr),
subtitle: Text('simpleDashboardModeHint'.tr),
trailing: Switch(
value: PreferenceSetting.simpleDashboardMode.value,
onChanged: PreferenceSetting.saveSimpleDashboardMode,
),
value: PreferenceSetting.simpleDashboardMode.value,
onChanged: PreferenceSetting.saveSimpleDashboardMode,
);
}

Expand Down Expand Up @@ -257,12 +255,10 @@ class SettingPreferencePage extends StatelessWidget {
}

Widget _buildQuickSearch() {
return ListTile(
return SwitchListTile(
title: Text('enableQuickSearchDrawerGesture'.tr),
trailing: Switch(
value: PreferenceSetting.enableQuickSearchDrawerGesture.value,
onChanged: PreferenceSetting.saveEnableQuickSearchDrawerGesture,
),
value: PreferenceSetting.enableQuickSearchDrawerGesture.value,
onChanged: PreferenceSetting.saveEnableQuickSearchDrawerGesture,
);
}

Expand Down Expand Up @@ -330,45 +326,37 @@ class SettingPreferencePage extends StatelessWidget {
}

Widget _buildShowR18GImageDirectly() {
return ListTile(
return SwitchListTile(
title: Text('showR18GImageDirectly'.tr),
trailing: Switch(
value: PreferenceSetting.showR18GImageDirectly.value,
onChanged: PreferenceSetting.saveShowR18GImageDirectly,
),
value: PreferenceSetting.showR18GImageDirectly.value,
onChanged: PreferenceSetting.saveShowR18GImageDirectly,
);
}

Widget _buildEnableDefaultFavorite() {
return ListTile(
return SwitchListTile(
title: Text('enableDefaultFavorite'.tr),
subtitle: Text(PreferenceSetting.enableDefaultFavorite.isTrue ? 'enableDefaultFavoriteHint'.tr : 'disableDefaultFavoriteHint'.tr),
trailing: Switch(
value: PreferenceSetting.enableDefaultFavorite.value,
onChanged: PreferenceSetting.saveEnableDefaultFavorite,
),
value: PreferenceSetting.enableDefaultFavorite.value,
onChanged: PreferenceSetting.saveEnableDefaultFavorite,
);
}

Widget _buildEnableDefaultTagSet() {
return ListTile(
return SwitchListTile(
title: Text('enableDefaultTagSet'.tr),
subtitle: Text(PreferenceSetting.enableDefaultTagSet.isTrue ? 'enableDefaultTagSetHint'.tr : 'disableDefaultTagSetHint'.tr),
trailing: Switch(
value: PreferenceSetting.enableDefaultTagSet.value,
onChanged: PreferenceSetting.saveEnableDefaultTagSet,
),
value: PreferenceSetting.enableDefaultTagSet.value,
onChanged: PreferenceSetting.saveEnableDefaultTagSet,
);
}

Widget _buildLaunchInFullScreen() {
return ListTile(
return SwitchListTile(
title: Text('launchInFullScreen'.tr),
subtitle: Text('launchInFullScreenHint'.tr),
trailing: Switch(
value: PreferenceSetting.launchInFullScreen.value,
onChanged: PreferenceSetting.saveLaunchInFullScreen,
),
value: PreferenceSetting.launchInFullScreen.value,
onChanged: PreferenceSetting.saveLaunchInFullScreen,
);
}

Expand Down
Loading

0 comments on commit 0465d39

Please sign in to comment.