Skip to content

Commit

Permalink
refactor: Refactored app code
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Fontán <[email protected]>
  • Loading branch information
BobbyESP committed Apr 28, 2024
1 parent e47b95b commit c3714c5
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 26 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ dependencies {
//-------------------Image Loading-------------------//
implementation(libs.landscapist.coil)
implementation(libs.coil)
implementation(libs.compose.coil
implementation(
libs.compose.coil
)
//-------------------FIREBASE-------------------//
"playstoreImplementation"(platform(libs.firebase.bom))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.bobbyesp.metadator

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
12 changes: 7 additions & 5 deletions app/src/main/java/com/bobbyesp/metadator/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ class App : Application() {
DynamicColors.applyToActivitiesIfAvailable(this)
super.onCreate()

if(!isPlayStoreBuild) setupCrashHandler(reportInfo = ReportInfo(
androidVersion = true,
deviceInfo = true,
supportedABIs = true
))
if (!isPlayStoreBuild) setupCrashHandler(
reportInfo = ReportInfo(
androidVersion = true,
deviceInfo = true,
supportedABIs = true
)
)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ val LocalNavController =
compositionLocalOf<NavHostController> { error("No nav controller provided") }
val LocalWindowWidthState =
staticCompositionLocalOf { WindowWidthSizeClass.Compact } //This value probably will never change, that's why it is static
val LocalSnackbarHostState = compositionLocalOf<SnackbarHostState> { error("No snackbar host state provided") }
val LocalSnackbarHostState =
compositionLocalOf<SnackbarHostState> { error("No snackbar host state provided") }
val LocalDrawerState =
compositionLocalOf<DrawerState> { error("No Drawer State has been provided") }
val LocalMediaplayerConnection =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ private fun LocalSongCardPreview() {
MetadatorTheme {
VerticalSongCard(
song = Song(
id = 1,
title = "Bones",
artist = "Imagine Dragons",
album = "Mercury - Acts 1 & 2",
id = 1,
title = "Bones",
artist = "Imagine Dragons",
album = "Mercury - Acts 1 & 2",
artworkPath = null,
duration = 100.0,
path = "path"
), onClick = {})
duration = 100.0,
path = "path"
), onClick = {})
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.bobbyesp.metadator.presentation.pages.mediaplayer

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand All @@ -19,7 +18,6 @@ import com.bobbyesp.ui.components.bottomsheet.draggable.DraggableBottomSheetStat
import my.nanihadesuka.compose.LazyColumnScrollbar
import my.nanihadesuka.compose.ScrollbarSelectionActionable

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun MediaplayerPage(
viewModel: MediaplayerViewModel,
Expand Down
3 changes: 1 addition & 2 deletions app/src/test/java/com/bobbyesp/metadator/ExampleUnitTest.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.bobbyesp.metadator

import org.junit.Assert.assertEquals
import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import androidx.compose.material.icons.outlined.Check
import androidx.compose.material3.AssistChip
import androidx.compose.material3.AssistChipDefaults
import androidx.compose.material3.ElevatedAssistChip
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilterChip
import androidx.compose.material3.FilterChipDefaults
import androidx.compose.material3.Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fun ProfilePicture(
) {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
Text(
fontSize = (size/1.5).sp,
fontSize = (size / 1.5).sp,
text = firstLetter,
fontWeight = FontWeight.SemiBold,
textAlign = TextAlign.Center,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.bobbyesp.ui.motion

import android.graphics.Path
import androidx.compose.animation.AnimatedVisibilityScope
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
Expand Down
1 change: 1 addition & 0 deletions app/ui/src/main/java/com/bobbyesp/ui/util/AppBarUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
import androidx.compose.ui.input.nestedscroll.NestedScrollSource

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun appBarScrollBehavior(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ data class AudioFileMetadata(
releaseType = this["RELEASETYPE"]
)
}

fun AudioFileMetadata.deepCopy(): AudioFileMetadata {
return AudioFileMetadata(
title = title?.copyOf(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ fun String.toPermissionType(): PermissionType {
@Preview
@Composable
fun PermissionNotGrantedPreview() {
PermissionNotGrantedDialog(onGrantRequest = {},
PermissionNotGrantedDialog(
onGrantRequest = {},
onDismissRequest = {},
neededPermissions = listOf(
PermissionType.READ_EXTERNAL_STORAGE, PermissionType.WRITE_EXTERNAL_STORAGE
Expand Down

0 comments on commit c3714c5

Please sign in to comment.