mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-29 21:37:56 +01:00 
			
		
		
		
	Add click-to-copy extension debug info (#271)
* Add click-to-copy extension debug info Adds some debug info about an extension to the user's clipboard when tapping the logo/name/package name area at the top of the details screen. Modeled after the debug info from the About screen. Closes #168. * Fix linting failure * Slight cleanup * Address detekt --------- Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
		| @@ -53,6 +53,7 @@ import eu.kanade.tachiyomi.extension.model.Extension | ||||
| import eu.kanade.tachiyomi.source.ConfigurableSource | ||||
| import eu.kanade.tachiyomi.ui.browse.extension.details.ExtensionDetailsScreenModel | ||||
| import eu.kanade.tachiyomi.util.system.LocaleHelper | ||||
| import eu.kanade.tachiyomi.util.system.copyToClipboard | ||||
| import kotlinx.collections.immutable.ImmutableList | ||||
| import kotlinx.collections.immutable.persistentListOf | ||||
| import tachiyomi.i18n.MR | ||||
| @@ -224,7 +225,31 @@ private fun DetailsHeader( | ||||
|                     end = MaterialTheme.padding.medium, | ||||
|                     top = MaterialTheme.padding.medium, | ||||
|                     bottom = MaterialTheme.padding.small, | ||||
|                 ), | ||||
|                 ) | ||||
|                 .clickable { | ||||
|                     val extDebugInfo = buildString { | ||||
|                         append( | ||||
|                             """ | ||||
|                             Extension name: ${extension.name} (lang: ${extension.lang}; package: ${extension.pkgName}) | ||||
|                             Extension version: ${extension.versionName} (lib: ${extension.libVersion}; version code: ${extension.versionCode}) | ||||
|                             NSFW: ${extension.isNsfw} | ||||
|                             """.trimIndent() | ||||
|                         ) | ||||
|  | ||||
|                         if (extension is Extension.Installed) { | ||||
|                             append("\n\n") | ||||
|                             append( | ||||
|                                 """ | ||||
|                                 Update available: ${extension.hasUpdate} | ||||
|                                 Obsolete: ${extension.isObsolete} | ||||
|                                 Shared: ${extension.isShared} | ||||
|                                 Repository: ${extension.repoUrl}  | ||||
|                                 """.trimIndent() | ||||
|                             ) | ||||
|                         } | ||||
|                     } | ||||
|                     context.copyToClipboard("Extension Debug information", extDebugInfo) | ||||
|                 }, | ||||
|             horizontalAlignment = Alignment.CenterHorizontally, | ||||
|         ) { | ||||
|             ExtensionIcon( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user