Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Oct 9, 2024
1 parent 9439484 commit eb331a4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
3 changes: 0 additions & 3 deletions FileTypes/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ dependencies {
implementation(libs.androidx.ui.android)
implementation(libs.androidx.foundation.android)
implementation(libs.androidx.ui.tooling.preview.android)
// implementation(libs.androidx.appcompat)
// implementation(libs.material)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
debugImplementation(libs.androidx.ui.tooling)
// androidTestImplementation(libs.androidx.espresso.core)
}
4 changes: 0 additions & 4 deletions FileTypes/src/main/AndroidManifest.xml

This file was deleted.

1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<application
android:name=".ui.MainApplication"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fun SentListScreen(transfers: List<Any>) {
override val uid: String = fileName
override val fileSizeInBytes: Long = 456782
override val mimeType: String? = null
override val uri: String = "httttttps://picsum.photos/200/300"
override val uri: String = "https://picsum.photos/200/300"
}

items(3) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ import com.infomaniak.library.filetypes.FileType
import com.infomaniak.swisstransfer.ui.components.FileUiItem

val FileUiItem.fileType: FileType get() = mimeType?.let { FileType.guessFromMimeType(it) } ?: FileType.guessFromFileName(fileName)

val FileUiItem.hasPreview: Boolean get() = fileType == FileType.IMAGE
8 changes: 7 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ lifecycleRuntimeKtx = "2.8.6"
navigation = "2.8.1"
serialization = "1.7.1"
swisstransfer = "0.1.1"
uiAndroid = "1.7.2"

# FileType module
uiAndroid = "1.7.3"
foundationAndroid = "1.7.3"
uiToolingPreviewAndroid = "1.7.3"
uiTooling = "1.7.3"
Expand Down Expand Up @@ -47,6 +49,8 @@ swisstransfer-core = { module = "com.github.Infomaniak.multiplatform-SwissTransf
# Tests
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
junit = { group = "junit", name = "junit", version.ref = "junit" }

# FileType module
androidx-ui-android = { group = "androidx.compose.ui", name = "ui-android", version.ref = "uiAndroid" }
androidx-foundation-android = { group = "androidx.compose.foundation", name = "foundation-android", version.ref = "foundationAndroid" }
androidx-ui-tooling-preview-android = { group = "androidx.compose.ui", name = "ui-tooling-preview-android", version.ref = "uiToolingPreviewAndroid" }
Expand All @@ -58,4 +62,6 @@ compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

# FileType module
android-library = { id = "com.android.library", version.ref = "agp" }

0 comments on commit eb331a4

Please sign in to comment.