-
-
Notifications
You must be signed in to change notification settings - Fork 70
added hueSound screen in explore #562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GautamCoder4019k
wants to merge
5
commits into
metabrainz:main
Choose a base branch
from
GautamCoder4019k:feat_huesound_feature
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
331d73e
added hueSound screen in explore
GautamCoder4019k d9adcad
Merge remote-tracking branch 'origin/main' into feat_huesound_feature
GautamCoder4019k 13f2457
refactor: HueSound screen UI and viewmodel
GautamCoder4019k 0aa8bd0
fix: minor bug fixes
GautamCoder4019k cb23d30
Update app/src/main/java/org/listenbrainz/android/ui/screens/explore/…
GautamCoder4019k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
app/src/main/java/org/listenbrainz/android/di/ExploreRepositoryModule.kt
This file contains hidden or 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,16 @@ | ||
| 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.explore.ExploreRepository | ||
| import org.listenbrainz.android.repository.explore.ExploreRepositoryImpl | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| abstract class ExploreRepositoryModule { | ||
|
|
||
| @Binds | ||
| abstract fun bindsExploreRepository(repository: ExploreRepositoryImpl): ExploreRepository | ||
| } |
This file contains hidden or 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 hidden or 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
24 changes: 24 additions & 0 deletions
24
app/src/main/java/org/listenbrainz/android/model/explore/HueSoundPayload.kt
This file contains hidden or 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,24 @@ | ||
| package org.listenbrainz.android.model.explore | ||
|
|
||
| import com.google.gson.annotations.SerializedName | ||
| import org.listenbrainz.android.model.TrackMetadata | ||
|
|
||
| data class HueSoundPayload( | ||
| val payload: HueSoundPayloadData | ||
| ) | ||
|
|
||
| data class HueSoundPayloadData( | ||
| val releases: List<Release> | ||
| ) | ||
|
|
||
| data class Release( | ||
| @SerializedName("artist_name") val artistName: String = "", | ||
| @SerializedName("release_name") val releaseName: String = "", | ||
| @SerializedName("release_mbid") val releaseId: String = "", | ||
| @SerializedName("caa_id") val caaId: Long = 0, | ||
| val recordings: List<Recording> = listOf() | ||
| ) | ||
|
|
||
| data class Recording( | ||
| @SerializedName("track_metadata") val trackMetadata: TrackMetadata | ||
| ) | ||
9 changes: 9 additions & 0 deletions
9
app/src/main/java/org/listenbrainz/android/repository/explore/ExploreRepository.kt
This file contains hidden or 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,9 @@ | ||
| package org.listenbrainz.android.repository.explore | ||
|
|
||
| import org.listenbrainz.android.model.explore.HueSoundPayload | ||
| import org.listenbrainz.android.util.Resource | ||
|
|
||
| interface ExploreRepository { | ||
|
|
||
| suspend fun getReleasesFromColor(color: String): Resource<HueSoundPayload> | ||
| } |
15 changes: 15 additions & 0 deletions
15
app/src/main/java/org/listenbrainz/android/repository/explore/ExploreRepositoryImpl.kt
This file contains hidden or 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,15 @@ | ||
| package org.listenbrainz.android.repository.explore | ||
|
|
||
| import javax.inject.Inject | ||
| import org.listenbrainz.android.model.explore.HueSoundPayload | ||
| import org.listenbrainz.android.service.ExploreService | ||
| import org.listenbrainz.android.util.Resource | ||
| import org.listenbrainz.android.util.Utils.parseResponse | ||
|
|
||
|
|
||
| class ExploreRepositoryImpl @Inject constructor( | ||
| private val exploreService: ExploreService | ||
| ) : ExploreRepository { | ||
| override suspend fun getReleasesFromColor(color: String): Resource<HueSoundPayload> = | ||
| parseResponse { exploreService.getReleasesFromColor(color) } | ||
| } |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/org/listenbrainz/android/service/ExploreService.kt
This file contains hidden or 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,12 @@ | ||
| package org.listenbrainz.android.service | ||
|
|
||
| import org.listenbrainz.android.model.explore.HueSoundPayload | ||
| import retrofit2.Response | ||
| import retrofit2.http.GET | ||
| import retrofit2.http.Path | ||
|
|
||
| interface ExploreService { | ||
|
|
||
| @GET("explore/color/{hexCode}") | ||
| suspend fun getReleasesFromColor(@Path("hexCode") colorHex: String): Response<HueSoundPayload> | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.