diff --git a/android/app-newm/src/main/java/io/newm/di/android/Dependencies.kt b/android/app-newm/src/main/java/io/newm/di/android/Dependencies.kt index eada9ea4..30f7c325 100644 --- a/android/app-newm/src/main/java/io/newm/di/android/Dependencies.kt +++ b/android/app-newm/src/main/java/io/newm/di/android/Dependencies.kt @@ -14,8 +14,6 @@ import io.newm.feature.login.screen.createaccount.CreateAccountScreenPresenter import io.newm.feature.login.screen.login.LoginScreenPresenter import io.newm.feature.login.screen.resetpassword.ResetPasswordScreenPresenter import io.newm.feature.login.screen.welcome.WelcomeScreenPresenter -import io.newm.feature.musicplayer.repository.MockMusicRepository -import io.newm.feature.musicplayer.repository.MusicRepository import io.newm.screens.forceupdate.ForceAppUpdatePresenter import io.newm.screens.library.NFTLibraryPresenter import io.newm.screens.profile.edit.ProfileEditPresenter @@ -103,7 +101,6 @@ val viewModule = module { params.get(), ) } - single { MockMusicRepository(androidContext()) } } val androidModules = module { diff --git a/android/features/music-player/src/main/java/io/newm/feature/musicplayer/repository/MusicRepository.kt b/android/features/music-player/src/main/java/io/newm/feature/musicplayer/repository/MusicRepository.kt deleted file mode 100644 index 82b45b1c..00000000 --- a/android/features/music-player/src/main/java/io/newm/feature/musicplayer/repository/MusicRepository.kt +++ /dev/null @@ -1,69 +0,0 @@ -package io.newm.feature.musicplayer.repository - -import android.content.Context -import android.net.Uri -import io.newm.feature.musicplayer.models.Playlist -import io.newm.feature.musicplayer.models.Track -import io.newm.feature.musicplayer.R -import io.newm.shared.internal.repositories.testdata.MockSongModel -import io.newm.shared.internal.repositories.testdata.savedSongModels - -interface MusicRepository { - // TODO make suspended - fun fetchTrack(trackId: String): Track - fun fetchPlaylist(playlistId: String): Playlist - fun saveTrack(track: Track) - fun savePlaylist(playlist: Playlist) -} - -class MockMusicRepository( - private val context: Context, -) : MusicRepository { - override fun fetchTrack(trackId: String): Track { - // TODO find by id - val songModel = - savedSongModels.find { "${it.assetId}" == trackId } ?: savedSongModels.first() - - return Track( - id = songModel.title, - title = songModel.title, - url = songModel.getAssetSourceSongURI(context).toString(), - artist = songModel.artist, - ) - } - - override fun fetchPlaylist(playlistId: String): Playlist { - // TODO find by id - val tracks = savedSongModels.mapIndexed { index, songModel -> - Track( - id = index.toString(), - title = songModel.title, - url = songModel.getAssetSourceSongURI(context).toString(), - artist = songModel.artist, - ) - } - return Playlist(tracks = tracks) - } - - override fun saveTrack(track: Track) { - TODO("Not yet implemented") - } - - override fun savePlaylist(playlist: Playlist) { - TODO("Not yet implemented") - } - - private fun MockSongModel.getAssetSourceSongURI(context: Context): Uri { - val assetName = when (this.assetId) { - 1 -> R.raw.song1 - 2 -> R.raw.song2 - 3 -> R.raw.song3 - 4 -> R.raw.song4 - 5 -> R.raw.song5 - 6 -> R.raw.song6 - else -> R.raw.song0 - } - return Uri.parse("android.resource://${context.packageName}/$assetName") - } - -} diff --git a/android/features/music-player/src/main/res/raw/song0.mp3 b/android/features/music-player/src/main/res/raw/song0.mp3 deleted file mode 100644 index cedd30c3..00000000 Binary files a/android/features/music-player/src/main/res/raw/song0.mp3 and /dev/null differ diff --git a/android/features/music-player/src/main/res/raw/song1.mp3 b/android/features/music-player/src/main/res/raw/song1.mp3 deleted file mode 100644 index bb71c931..00000000 Binary files a/android/features/music-player/src/main/res/raw/song1.mp3 and /dev/null differ diff --git a/android/features/music-player/src/main/res/raw/song2.wav b/android/features/music-player/src/main/res/raw/song2.wav deleted file mode 100644 index 5539fd84..00000000 Binary files a/android/features/music-player/src/main/res/raw/song2.wav and /dev/null differ diff --git a/android/features/music-player/src/main/res/raw/song3.mp3 b/android/features/music-player/src/main/res/raw/song3.mp3 deleted file mode 100644 index f5a8ca80..00000000 Binary files a/android/features/music-player/src/main/res/raw/song3.mp3 and /dev/null differ diff --git a/android/features/music-player/src/main/res/raw/song4.mp3 b/android/features/music-player/src/main/res/raw/song4.mp3 deleted file mode 100644 index fb25d27c..00000000 Binary files a/android/features/music-player/src/main/res/raw/song4.mp3 and /dev/null differ diff --git a/android/features/music-player/src/main/res/raw/song5.m4a b/android/features/music-player/src/main/res/raw/song5.m4a deleted file mode 100644 index 7cb6b3c5..00000000 Binary files a/android/features/music-player/src/main/res/raw/song5.m4a and /dev/null differ diff --git a/android/features/music-player/src/main/res/raw/song6.wav b/android/features/music-player/src/main/res/raw/song6.wav deleted file mode 100644 index a0b4a0cd..00000000 Binary files a/android/features/music-player/src/main/res/raw/song6.wav and /dev/null differ