-
-
Notifications
You must be signed in to change notification settings - Fork 38
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 #70 from kl3jvi/feature/implementing_epoxy
Feature/implementing epoxy
- Loading branch information
Showing
81 changed files
with
1,308 additions
and
1,327 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
49 changes: 49 additions & 0 deletions
49
app/src/main/java/com/kl3jvi/animity/data/model/ui_models/test/DetailedInfo.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,49 @@ | ||
package com.kl3jvi.animity.data.model.ui_models.test | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
|
||
data class DetailedAnimeInfo( | ||
@SerializedName("Pages") | ||
val pages: Pages, | ||
) | ||
|
||
data class Pages( | ||
@SerializedName("Gogoanime") | ||
val data: Map<String, SubInfo> | ||
) | ||
|
||
data class SubInfo( | ||
@SerializedName("active") | ||
val active: Boolean, | ||
@SerializedName("actor") | ||
val actor: Any, | ||
@SerializedName("aniId") | ||
val aniId: Int, | ||
@SerializedName("createdAt") | ||
val createdAt: String, | ||
@SerializedName("deletedAt") | ||
val deletedAt: Any, | ||
@SerializedName("hentai") | ||
val hentai: Boolean, | ||
@SerializedName("identifier") | ||
val identifier: String, | ||
@SerializedName("image") | ||
val image: String, | ||
@SerializedName("malId") | ||
val malId: Int, | ||
@SerializedName("page") | ||
val page: String, | ||
@SerializedName("sticky") | ||
val sticky: Boolean, | ||
@SerializedName("title") | ||
val title: String, | ||
@SerializedName("type") | ||
val type: String, | ||
@SerializedName("updatedAt") | ||
val updatedAt: String, | ||
@SerializedName("url") | ||
val url: String | ||
) | ||
|
||
|
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
33 changes: 33 additions & 0 deletions
33
...n/java/com/kl3jvi/animity/data/repository/fragment_repositories/FavoriteRepositoryImpl.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,33 @@ | ||
package com.kl3jvi.animity.data.repository.fragment_repositories | ||
|
||
import com.kl3jvi.animity.data.model.ui_models.test.DetailedAnimeInfo | ||
import com.kl3jvi.animity.data.network.anime_service.AnimeApiClient | ||
import com.kl3jvi.animity.domain.repositories.fragment_repositories.FavoriteRepository | ||
import com.kl3jvi.animity.domain.repositories.network_repositories.NetworkBoundRepository | ||
import com.kl3jvi.animity.utils.NetworkResource | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.ExperimentalCoroutinesApi | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.withContext | ||
import retrofit2.Response | ||
import javax.inject.Inject | ||
|
||
@ExperimentalCoroutinesApi | ||
class FavoriteRepositoryImpl @Inject constructor( | ||
private val apiClient: AnimeApiClient, | ||
private val ioDispatcher: CoroutineDispatcher | ||
) : FavoriteRepository { | ||
override fun getGogoUrlFromAniListId(id: Int): Flow<NetworkResource<DetailedAnimeInfo>> { | ||
return object : NetworkBoundRepository<DetailedAnimeInfo>() { | ||
override suspend fun fetchFromRemote(): Response<DetailedAnimeInfo> { | ||
return withContext(ioDispatcher) { | ||
apiClient.getGogoUrlFromAniListId(id) } | ||
} | ||
}.asFlow() | ||
} | ||
|
||
// | ||
// | ||
// withContext(ioDispatcher) | ||
// { apiClient.getGogoUrlFromAniListId(id) } | ||
} |
Oops, something went wrong.