This commit is contained in:
MM20
2022-06-24 17:23:59 +02:00
parent 26995c1141
commit 96e70da913
98 changed files with 61 additions and 891 deletions
@@ -1,7 +1,6 @@
package de.mm20.launcher2.files
import org.koin.android.ext.koin.androidContext
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module
val filesModule = module {
@@ -6,7 +6,6 @@ import android.os.Build
import android.os.CancellationSignal
import android.provider.MediaStore
import android.util.Size
import androidx.core.content.ContentResolverCompat
import java.io.File
import java.io.IOException
@@ -114,7 +114,7 @@ abstract class File(
}
}
if (resource == R.string.file_type_none && label.matches(Regex(".+\\..+"))) {
val extension = label.substringAfterLast(".").toUpperCase(Locale.getDefault())
val extension = label.substringAfterLast(".").uppercase(Locale.getDefault())
if (extension == "kvaesitso") return context.getString(
R.string.file_type_launcherbackup,
context.getString(R.string.app_name)
@@ -4,10 +4,6 @@ import android.content.Context
import android.content.Intent
import android.net.Uri
import de.mm20.launcher2.files.R
import de.mm20.launcher2.gservices.DriveFileMeta
import de.mm20.launcher2.gservices.GoogleApiHelper
import de.mm20.launcher2.helper.NetworkUtils
import de.mm20.launcher2.icons.LauncherIcon
class GDriveFile(
val fileId: String,
@@ -114,8 +114,8 @@ open class LocalFile(
val icon = withContext(Dispatchers.IO) {
pkgInfo?.applicationInfo?.loadIcon(context.packageManager)
} ?: return null
when {
icon is AdaptiveIconDrawable -> {
when (icon) {
is AdaptiveIconDrawable -> {
return StaticLauncherIcon(
foregroundLayer = icon.foreground?.let {
StaticIconLayer(
@@ -3,10 +3,7 @@ package de.mm20.launcher2.search.data
import android.content.Context
import android.content.Intent
import android.net.Uri
import de.mm20.launcher2.msservices.DriveItem
import de.mm20.launcher2.files.R
import de.mm20.launcher2.msservices.MicrosoftGraphApiHelper
import de.mm20.launcher2.icons.LauncherIcon
class OneDriveFile(
val fileId: String,
@@ -4,8 +4,6 @@ import android.content.Context
import android.content.Intent
import android.net.Uri
import de.mm20.launcher2.files.R
import de.mm20.launcher2.helper.NetworkUtils
import de.mm20.launcher2.owncloud.OwncloudClient
class OwncloudFile(
fileId: Long,