Skip to content

Latest commit

 

History

History
67 lines (45 loc) · 2.46 KB

apk_app_icon.md

File metadata and controls

67 lines (45 loc) · 2.46 KB

Load Icon For Apk Or Installed App

Translations: 简体中文

Load Apk Icon

First install the component

${LAST_VERSION}: Download (Not included 'v')

implementation("io.github.panpf.sketch4:sketch-extensions-apkicon:${LAST_VERSION}")

Then directly pass in the path to the apk file when loading the image:

sketch.enqueue(ImageRequest(context, uri = "/sdcard/sample.apk"))

Important

  1. sketch-extensions-apkicon The module supports automatic registration of components. For details on component registration, please see the documentation: 《Register component》
  2. Only supports Android platform

Load the icon of the installed app

First install the component

${LAST_VERSION}: Download (Not included 'v')

implementation("io.github.panpf.sketch4:sketch-extensions-appicon:${LAST_VERSION}")

Then use the newAppIconUri() function to create a dedicated uri when loading the image.

// app.icon://com.github.panpf.sketch.sample/1
val appIconUri = newAppIconUri(packageName = "com.github.panpf.sketch.sample", versionCode = 1)
sketch.enqueue(ImageRequest(context, uri = appIconUri))

Important

  1. versionCode: App version number. The correct version number must be passed in, because when the icon is modified, the modified icon will be cached on the disk. If you only use packageName is used as the cache key, so the icon will not be refreshed even if the cache is changed after the App version is updated.
  2. sketch-extensions-appicon The module supports automatic component registration. Please see the documentation for details on component registration. 《Register component》
  3. Only supports Android platform