Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from 07jasjeet/feed-section-phase-2.3
Feed section phase 2.3 Part 1
- Loading branch information
Showing
28 changed files
with
739 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/src/main/java/org/listenbrainz/android/di/RemotePlayerRepositoryModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.listenbrainz.android.di | ||
|
||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import org.listenbrainz.android.repository.remoteplayer.RemotePlayerRepository | ||
import org.listenbrainz.android.repository.remoteplayer.RemotePlayerRepositoryImpl | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
abstract class RemotePlayerRepositoryModule { | ||
|
||
@Binds | ||
abstract fun bindsRemotePlayerRepository(repository: RemotePlayerRepositoryImpl?): RemotePlayerRepository? | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/main/java/org/listenbrainz/android/repository/remoteplayer/RemotePlayerRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.listenbrainz.android.repository.remoteplayer | ||
|
||
import com.spotify.protocol.types.PlayerState | ||
import org.listenbrainz.android.model.ListenBitmap | ||
import org.listenbrainz.android.model.ResponseError | ||
import org.listenbrainz.android.util.Resource | ||
|
||
interface RemotePlayerRepository { | ||
|
||
suspend fun searchYoutubeMusicVideoId( | ||
trackName: String, | ||
artist: String | ||
): Resource<String> | ||
|
||
suspend fun playOnYoutube( | ||
getYoutubeMusicVideoId: suspend () -> Resource<String> | ||
): Resource<Unit> | ||
|
||
suspend fun connectToSpotify(onError: (ResponseError) -> Unit = {}) | ||
|
||
fun disconnectSpotify() | ||
|
||
suspend fun updateTrackCoverArt(playerState: PlayerState): ListenBitmap | ||
|
||
fun playUri(trackId: String, onFailure: () -> Unit) | ||
} |
Oops, something went wrong.