mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Add more info in tracking settings section
(cherry picked from commit 436253dd63)
# Conflicts:
#	app/src/main/res/values/strings.xml
			
			
This commit is contained in:
		| @@ -12,6 +12,7 @@ import eu.kanade.tachiyomi.data.track.anilist.AnilistApi | ||||
| import eu.kanade.tachiyomi.data.track.bangumi.BangumiApi | ||||
| import eu.kanade.tachiyomi.data.track.shikimori.ShikimoriApi | ||||
| import eu.kanade.tachiyomi.util.preference.defaultValue | ||||
| import eu.kanade.tachiyomi.util.preference.infoPreference | ||||
| import eu.kanade.tachiyomi.util.preference.initThenAdd | ||||
| import eu.kanade.tachiyomi.util.preference.onClick | ||||
| import eu.kanade.tachiyomi.util.preference.preferenceCategory | ||||
| @@ -73,6 +74,9 @@ class SettingsTrackingController : | ||||
|                 tabsIntent.launchUrl(activity!!, BangumiApi.authUrl()) | ||||
|             } | ||||
|         } | ||||
|         preferenceCategory { | ||||
|             infoPreference(R.string.tracking_info) | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private inline fun PreferenceScreen.trackPreference( | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| package eu.kanade.tachiyomi.util.preference | ||||
|  | ||||
| import androidx.annotation.StringRes | ||||
| import androidx.core.graphics.drawable.DrawableCompat | ||||
| import androidx.preference.CheckBoxPreference | ||||
| import androidx.preference.DialogPreference | ||||
| @@ -13,6 +14,8 @@ import androidx.preference.PreferenceManager | ||||
| import androidx.preference.PreferenceScreen | ||||
| import androidx.preference.SwitchPreferenceCompat | ||||
| import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat | ||||
| import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.util.system.getResourceColor | ||||
| import eu.kanade.tachiyomi.widget.preference.IntListPreference | ||||
| import eu.kanade.tachiyomi.widget.preference.SwitchPreferenceCategory | ||||
|  | ||||
| @@ -28,6 +31,18 @@ inline fun PreferenceGroup.preference(block: (@DSL Preference).() -> Unit): Pref | ||||
|     return initThenAdd(Preference(context), block) | ||||
| } | ||||
|  | ||||
| inline fun PreferenceGroup.infoPreference(@StringRes infoRes: Int): Preference { | ||||
|     return initThenAdd( | ||||
|         Preference(context), | ||||
|         { | ||||
|             iconRes = R.drawable.ic_info_24dp | ||||
|             iconTint = context.getResourceColor(android.R.attr.textColorHint) | ||||
|             summaryRes = infoRes | ||||
|             isSelectable = false | ||||
|         } | ||||
|     ) | ||||
| } | ||||
|  | ||||
| inline fun PreferenceGroup.switchPreference(block: (@DSL SwitchPreferenceCompat).() -> Unit): SwitchPreferenceCompat { | ||||
|     return initThenAdd(SwitchPreferenceCompat(context), block) | ||||
| } | ||||
|   | ||||
| @@ -117,7 +117,7 @@ | ||||
|     <string name="short_recent_updates">Updates</string> | ||||
|  | ||||
|     <!-- Preferences --> | ||||
|     <!-- Subsections --> | ||||
|       <!-- Subsections --> | ||||
|     <string name="pref_category_general">General</string> | ||||
|     <string name="pref_category_library">Library</string> | ||||
|     <string name="pref_category_reader">Reader</string> | ||||
| @@ -126,7 +126,7 @@ | ||||
|     <string name="pref_category_advanced">Advanced</string> | ||||
|     <string name="pref_category_about">About</string> | ||||
|  | ||||
|     <!-- General section --> | ||||
|       <!-- General section --> | ||||
|     <string name="pref_theme_mode">App theme</string> | ||||
|     <string name="theme_light">Light</string> | ||||
|     <string name="theme_dark">Dark</string> | ||||
| @@ -158,7 +158,7 @@ | ||||
|     <string name="secure_screen_summary">Hide app contents when switching apps and block screenshots</string> | ||||
|     <string name="hide_notification_content">Hide notification content</string> | ||||
|  | ||||
|     <!-- Library section --> | ||||
|       <!-- Library section --> | ||||
|     <string name="pref_category_display">Display</string> | ||||
|     <string name="pref_library_columns">Items per row</string> | ||||
|     <string name="portrait">Portrait</string> | ||||
| @@ -194,7 +194,7 @@ | ||||
|     <string name="pref_library_update_categories">Categories to include in global update</string> | ||||
|     <string name="all">All</string> | ||||
|  | ||||
|     <!-- Extension section --> | ||||
|       <!-- Extension section --> | ||||
|     <string name="all_lang">All</string> | ||||
|     <string name="ext_details">Details</string> | ||||
|     <string name="ext_updates_pending">Updates pending</string> | ||||
| @@ -217,7 +217,7 @@ | ||||
|     <string name="ext_language_info">Language: %1$s</string> | ||||
|     <string name="ext_empty_preferences">No preferences to edit for this extension</string> | ||||
|  | ||||
|     <!-- Reader section --> | ||||
|       <!-- Reader section --> | ||||
|     <string name="pref_fullscreen">Fullscreen</string> | ||||
|     <string name="pref_cutout_short">Show content in cutout area</string> | ||||
|     <string name="pref_lock_orientation">Lock orientation</string> | ||||
| @@ -290,7 +290,7 @@ | ||||
|     <string name="webtoon_side_padding_20">20%</string> | ||||
|     <string name="webtoon_side_padding_25">25%</string> | ||||
|  | ||||
|     <!-- Downloads section --> | ||||
|       <!-- Downloads section --> | ||||
|     <string name="pref_download_directory">Download location</string> | ||||
|     <string name="pref_download_only_over_wifi">Only download over Wi-Fi</string> | ||||
|     <string name="pref_remove_after_marked_as_read">Remove when marked as read</string> | ||||
| @@ -305,15 +305,16 @@ | ||||
|     <string name="pref_download_new">Download new chapters</string> | ||||
|     <string name="pref_download_new_categories">Categories to include in download</string> | ||||
|  | ||||
|     <!-- Tracking section --> | ||||
|     <string name="pref_auto_update_manga_sync">Sync chapters after reading</string> | ||||
|       <!-- Tracking section --> | ||||
|     <string name="pref_auto_update_manga_sync">Update chapter progress after reading</string> | ||||
|     <string name="services">Services</string> | ||||
|     <string name="tracking_info">One-way sync to update chapter tracking services. Set up tracking for individual manga entries from their tracking tabs.</string> | ||||
|  | ||||
|     <!-- Browse section --> | ||||
|       <!-- Browse section --> | ||||
|     <string name="pref_enable_automatic_extension_updates">Check for extension updates</string> | ||||
|     <string name="pref_search_pinned_sources_only">Only include pinned sources</string> | ||||
|  | ||||
|     <!-- Backup section --> | ||||
|       <!-- Backup section --> | ||||
|     <string name="backup">Backup</string> | ||||
|     <string name="pref_create_backup">Create backup</string> | ||||
|     <string name="pref_create_backup_summ">Can be used to restore current library</string> | ||||
| @@ -341,7 +342,7 @@ | ||||
|     <string name="restoring_backup_error">Restoring backup failed</string> | ||||
|     <string name="restoring_backup_canceled">Canceled restore</string> | ||||
|  | ||||
|     <!-- Advanced section --> | ||||
|       <!-- Advanced section --> | ||||
|     <string name="pref_clear_chapter_cache">Clear chapter cache</string> | ||||
|     <string name="used_cache">Used: %1$s</string> | ||||
|     <string name="cache_deleted">Cache cleared. %1$d files have been deleted</string> | ||||
| @@ -360,7 +361,7 @@ | ||||
|     <string name="battery_optimization_disabled">Battery optimization is already disabled</string> | ||||
|     <string name="battery_optimization_setting_activity_not_found">Couldn\'t open device settings</string> | ||||
|  | ||||
|     <!-- About section --> | ||||
|       <!-- About section --> | ||||
|     <string name="website">Website</string> | ||||
|     <string name="version">Version</string> | ||||
|     <string name="build_time">Build time</string> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user