mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-03 23:58:55 +01:00 
			
		
		
		
	extension-lib 1.5: Add AppInfo#getSupportedImageMimeTypes()
This commit is contained in:
		@@ -1,12 +1,33 @@
 | 
			
		||||
package eu.kanade.tachiyomi
 | 
			
		||||
 | 
			
		||||
import tachiyomi.core.util.system.ImageUtil
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Used by extensions.
 | 
			
		||||
 *
 | 
			
		||||
 * @since extension-lib 1.3
 | 
			
		||||
 */
 | 
			
		||||
@Suppress("UNUSED")
 | 
			
		||||
object AppInfo {
 | 
			
		||||
    fun getVersionCode() = BuildConfig.VERSION_CODE
 | 
			
		||||
    fun getVersionName() = BuildConfig.VERSION_NAME
 | 
			
		||||
    /**
 | 
			
		||||
     * Version code of the host application. May be useful for sharing as User-Agent information.
 | 
			
		||||
     * Note that this value differs between forks so logic should not rely on it.
 | 
			
		||||
     *
 | 
			
		||||
     * @since extension-lib 1.3
 | 
			
		||||
     */
 | 
			
		||||
    fun getVersionCode(): Int = BuildConfig.VERSION_CODE
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Version name of the host application. May be useful for sharing as User-Agent information.
 | 
			
		||||
     * Note that this value differs between forks so logic should not rely on it.
 | 
			
		||||
     *
 | 
			
		||||
     * @since extension-lib 1.3
 | 
			
		||||
     */
 | 
			
		||||
    fun getVersionName(): String = BuildConfig.VERSION_NAME
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * A list of supported image MIME types by the reader.
 | 
			
		||||
     * e.g. ["image/jpeg", "image/png", ...]
 | 
			
		||||
     *
 | 
			
		||||
     * @since extension-lib 1.5
 | 
			
		||||
     */
 | 
			
		||||
    fun getSupportedImageMimeTypes(): List<String> = ImageUtil.ImageType.values().map { it.mime }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,7 @@ internal object ExtensionLoader {
 | 
			
		||||
    private const val METADATA_HAS_README = "tachiyomi.extension.hasReadme"
 | 
			
		||||
    private const val METADATA_HAS_CHANGELOG = "tachiyomi.extension.hasChangelog"
 | 
			
		||||
    const val LIB_VERSION_MIN = 1.3
 | 
			
		||||
    const val LIB_VERSION_MAX = 1.4
 | 
			
		||||
    const val LIB_VERSION_MAX = 1.5
 | 
			
		||||
 | 
			
		||||
    private const val PACKAGE_FLAGS = PackageManager.GET_CONFIGURATIONS or PackageManager.GET_SIGNATURES
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user