diff --git a/app/src/main/java/ren/imyan/app_tracker/net/AppTrackerRepo.kt b/app/src/main/java/ren/imyan/app_tracker/net/AppTrackerRepo.kt index 00a86e3..8e7ed4f 100644 --- a/app/src/main/java/ren/imyan/app_tracker/net/AppTrackerRepo.kt +++ b/app/src/main/java/ren/imyan/app_tracker/net/AppTrackerRepo.kt @@ -34,7 +34,7 @@ class AppTrackerRepo { suspend fun submitAppIcon(packageName: String, icon: File) = flow { - val iconFile = icon.asRequestBody("image/jpeg".toMediaTypeOrNull()); + val iconFile = icon.asRequestBody("image/png".toMediaTypeOrNull()); emit(api.submitAppIcon(packageName, iconFile)) }.flowOn(Dispatchers.IO) } \ No newline at end of file diff --git a/app/src/main/java/ren/imyan/app_tracker/ui/MainViewModel.kt b/app/src/main/java/ren/imyan/app_tracker/ui/MainViewModel.kt index 2b94a66..388271e 100644 --- a/app/src/main/java/ren/imyan/app_tracker/ui/MainViewModel.kt +++ b/app/src/main/java/ren/imyan/app_tracker/ui/MainViewModel.kt @@ -199,7 +199,7 @@ class MainViewModel : BaseViewModel() { iconList.toList().asFlow().catch { err -> err.printStackTrace() }.onEach { - val iconFile = it.second.setBackground().toSize(288f, 288f).toFile("${it.first}.jpg") + val iconFile = it.second.setBackground().toSize(288f, 288f).toFile("${it.first}.png", format = Bitmap.CompressFormat.PNG) if (iconFile != null) { repo.submitAppIcon(it.first, iconFile).catch { err -> err.printStackTrace() @@ -240,7 +240,7 @@ class MainViewModel : BaseViewModel() { err.printStackTrace() }.onEach { icons -> val iconFile = icons.second.setBackground().toSize(288f, 288f) - .toFile("${icons.first}.jpg") + .toFile("${icons.first}.png", format = Bitmap.CompressFormat.PNG) if (iconFile != null) { repo.submitAppIcon(icons.first, iconFile).catch { err -> err.printStackTrace()