diff --git a/src/main/kotlin/com/machiav3lli/fdroid/network/CoilDownloader.kt b/src/main/kotlin/com/machiav3lli/fdroid/network/CoilDownloader.kt index b38954a3..2887672b 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/network/CoilDownloader.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/network/CoilDownloader.kt @@ -1,8 +1,6 @@ package com.machiav3lli.fdroid.network -import android.content.Context import android.net.Uri -import android.view.View import com.machiav3lli.fdroid.database.entity.Repository import com.machiav3lli.fdroid.entity.Screenshot import com.machiav3lli.fdroid.utility.extension.text.nullIfEmpty @@ -10,8 +8,6 @@ import okhttp3.Cache import okhttp3.Call import okhttp3.HttpUrl.Companion.toHttpUrl import java.io.File -import kotlin.math.min -import kotlin.math.roundToInt object CoilDownloader { private const val HOST_ICON = "icon" @@ -110,39 +106,6 @@ object CoilDownloader { .build() } - fun createIconUri( - view: View, - packageName: String, - icon: String, - metadataIcon: String, - repository: Repository, - ): Uri { - val size = (view.layoutParams.let { min(it.width, it.height) } / - view.resources.displayMetrics.density).roundToInt() - return createIconUri(view.context, packageName, icon, metadataIcon, size, repository) - } - - private fun createIconUri( - context: Context, packageName: String, icon: String, metadataIcon: String, - targetSizeDp: Int, repository: Repository, - ): Uri { - return Uri.Builder().scheme("https").authority(HOST_ICON) - .appendQueryParameter(QUERY_ADDRESS, repository.address) - .appendQueryParameter(QUERY_AUTHENTICATION, repository.authentication) - .appendQueryParameter(QUERY_PACKAGE_NAME, packageName) - .appendQueryParameter(QUERY_ICON, icon) - .appendQueryParameter(QUERY_METADATA_ICON, metadataIcon) - .apply { - if (repository.version >= 11) { - val displayDpi = context.resources.displayMetrics.densityDpi - val requiredDpi = displayDpi * targetSizeDp / 48 - val iconDpi = supportedDpis.find { it >= requiredDpi } ?: supportedDpis.last() - appendQueryParameter(QUERY_DPI, iconDpi.toString()) - } - } - .build() - } - fun createIconUri( packageName: String, icon: String, metadataIcon: String, address: String?, auth: String? diff --git a/src/main/kotlin/com/machiav3lli/fdroid/service/SyncService.kt b/src/main/kotlin/com/machiav3lli/fdroid/service/SyncService.kt index 1bc83f63..e308e173 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/service/SyncService.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/service/SyncService.kt @@ -136,7 +136,7 @@ class SyncService : ConnectionService() { return removed || currentTask != null } - fun setUpdateNotificationBlocker(fragment: Fragment?) { + fun setUpdateNotificationBlocker(fragment: Fragment?) { // TODO should the notification be canceled on opening a specific page? updateNotificationBlockerFragment = fragment?.let(::WeakReference) if (fragment != null) { notificationManager.cancel(NOTIFICATION_ID_UPDATES) diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductCard.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductCard.kt index 7de861d8..a06224bf 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductCard.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductCard.kt @@ -1,6 +1,10 @@ package com.machiav3lli.fdroid.ui.compose.components -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.requiredSize +import androidx.compose.foundation.layout.size import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ScreenshotList.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ScreenshotList.kt index 71d4038d..e668f195 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ScreenshotList.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ScreenshotList.kt @@ -8,7 +8,12 @@ import androidx.compose.foundation.layout.wrapContentWidth import androidx.compose.foundation.lazy.LazyRow import androidx.compose.foundation.lazy.items import androidx.compose.material3.MaterialTheme -import androidx.compose.runtime.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.SideEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.unit.dp diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 170d3661..b7e4c2ac 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - + Action failed Add repository Address