From 8ede9457fd21ac5e272e73f5ece1d4bc9c23faab Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Wed, 19 May 2021 10:07:23 +0200 Subject: Big update Restructuring the packages and adding a Constants.kt for the api URL. Also adding gson in Singletons.kt --- .../aniki/presentation/model/SearchAnime.kt | 31 +++++++++++++++++++ .../aniki/presentation/model/SearchManga.kt | 34 ++++++++++++++++++++ .../adjutor/aniki/presentation/model/TopAnime.kt | 35 +++++++++++++++++++++ .../adjutor/aniki/presentation/model/TopManga.kt | 36 ++++++++++++++++++++++ .../presentation/model/anime/AnimeResponse.kt | 16 ---------- .../aniki/presentation/model/anime/SearchAnime.kt | 31 ------------------- .../model/anime/SearchAnimeResponse.kt | 13 -------- .../aniki/presentation/model/anime/TopAnime.kt | 35 --------------------- .../presentation/model/anime/TopAnimeResponse.kt | 13 -------- .../presentation/model/manga/MangaResponse.kt | 22 ------------- .../aniki/presentation/model/manga/SearchManga.kt | 34 -------------------- .../model/manga/SearchMangaResponse.kt | 13 -------- .../aniki/presentation/model/manga/TopManga.kt | 36 ---------------------- .../presentation/model/manga/TopMangaResponse.kt | 13 -------- .../presentation/model/response/AnimeResponse.kt | 16 ++++++++++ .../presentation/model/response/MangaResponse.kt | 22 +++++++++++++ .../model/response/SearchAnimeResponse.kt | 14 +++++++++ .../model/response/SearchMangaResponse.kt | 14 +++++++++ .../model/response/TopAnimeResponse.kt | 14 +++++++++ .../model/response/TopMangaResponse.kt | 14 +++++++++ 20 files changed, 230 insertions(+), 226 deletions(-) create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchAnime.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchManga.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/TopAnime.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/TopManga.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/AnimeResponse.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnime.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnimeResponse.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnime.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnimeResponse.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/MangaResponse.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchManga.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchMangaResponse.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopManga.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopMangaResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/response/AnimeResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/response/MangaResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchAnimeResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchMangaResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopAnimeResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopMangaResponse.kt (limited to 'app/src/main/java/xyz/adjutor/aniki/presentation/model') diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchAnime.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchAnime.kt new file mode 100644 index 0000000..df5189d --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchAnime.kt @@ -0,0 +1,31 @@ +package xyz.adjutor.aniki.presentation.model + +import com.google.gson.annotations.SerializedName + +class SearchAnime { + + @SerializedName("mal_id") + var mal_id: Int? = null + + @SerializedName("url") + var url: String? = null + + @SerializedName("image_url") + var image_url: String? = null + + @SerializedName("title") + var title: String? = null + + @SerializedName("episodes") + var episodes: Int? = null + + @SerializedName("score") + var score: Float? = null + + @SerializedName("start_date") //we'll maybe remove this later + var start_date: String? = null + + @SerializedName("end_date") //we'll maybe remove this later + var end_date: String? = null + +} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchManga.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchManga.kt new file mode 100644 index 0000000..c24d93c --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchManga.kt @@ -0,0 +1,34 @@ +package xyz.adjutor.aniki.presentation.model + +import com.google.gson.annotations.SerializedName + +class SearchManga { + + @SerializedName("mal_id") + var mal_id: Int? = null + + @SerializedName("url") + var url: String? = null + + @SerializedName("image_url") + var image_url: String? = null + + @SerializedName("title") + var title: String? = null + + @SerializedName("chapters") + var chapters: Int? = null + + @SerializedName("volumes") + var volumes: Int? = null + + @SerializedName("score") + var score: Float? = null + + @SerializedName("start_date") //we'll maybe remove this later + var start_date: String? = null + + @SerializedName("end_date") //we'll maybe remove this later + var end_date: String? = null + +} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/TopAnime.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/TopAnime.kt new file mode 100644 index 0000000..3cf4390 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/TopAnime.kt @@ -0,0 +1,35 @@ +package xyz.adjutor.aniki.presentation.model + +import com.google.gson.annotations.SerializedName + +//Content of the top field from the api of top anime +class TopAnime { + + @SerializedName("mal_id") + var mal_id: Int? = null + + @SerializedName("rank") + var rank: Int? = null + + @SerializedName("title") + var title: String? = null + + @SerializedName("url") + var url: String? = null + + @SerializedName("episodes") + var episodes: Int? = null + + @SerializedName("start_date") + var start_date: String? = null + + @SerializedName("end_date") + var end_date: String? = null + + @SerializedName("score") + var score: Float? = null + + @SerializedName("image_url") + var image_url: String? = null + +} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/TopManga.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/TopManga.kt new file mode 100644 index 0000000..27f63f3 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/TopManga.kt @@ -0,0 +1,36 @@ +package xyz.adjutor.aniki.presentation.model + +import com.google.gson.annotations.SerializedName + +//model +//Content of the top field from the api of top manga +class TopManga { + + @SerializedName("mal_id") + var mal_id: Int? = null + + @SerializedName("rank") + var rank: Int? = null + + @SerializedName("title") + var title: String? = null + + @SerializedName("url") + var url: String? = null + + @SerializedName("volumes") + var volumes: Int? = null + + @SerializedName("start_date") + var start_date: String? = null + + @SerializedName("end_date") + var end_date: String? = null + + @SerializedName("score") + var score: Float? = null + + @SerializedName("image_url") + var image_url: String? = null + +} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/AnimeResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/AnimeResponse.kt deleted file mode 100644 index e4336ce..0000000 --- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/AnimeResponse.kt +++ /dev/null @@ -1,16 +0,0 @@ -package xyz.adjutor.aniki.presentation.model.anime - -import com.google.gson.annotations.SerializedName - -class AnimeResponse { //only kept the infos I didn't have and that were interesting to me. - - @SerializedName("mal_id") - var mal_id: Int? = null - - @SerializedName("rank") - var rank: Int? = null //added for the search feature (detail) - - @SerializedName("synopsis") - var synopsis: String? = null - -} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnime.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnime.kt deleted file mode 100644 index 7e4340c..0000000 --- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnime.kt +++ /dev/null @@ -1,31 +0,0 @@ -package xyz.adjutor.aniki.presentation.model.anime - -import com.google.gson.annotations.SerializedName - -class SearchAnime { - - @SerializedName("mal_id") - var mal_id: Int? = null - - @SerializedName("url") - var url: String? = null - - @SerializedName("image_url") - var image_url: String? = null - - @SerializedName("title") - var title: String? = null - - @SerializedName("episodes") - var episodes: Int? = null - - @SerializedName("score") - var score: Float? = null - - @SerializedName("start_date") //we'll maybe remove this later - var start_date: String? = null - - @SerializedName("end_date") //we'll maybe remove this later - var end_date: String? = null - -} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnimeResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnimeResponse.kt deleted file mode 100644 index d04aa67..0000000 --- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnimeResponse.kt +++ /dev/null @@ -1,13 +0,0 @@ -package xyz.adjutor.aniki.presentation.model.anime - -import com.google.gson.annotations.SerializedName - -class SearchAnimeResponse { //only kept the infos I didn't have and that were interesting to me. - - @SerializedName("results") - private lateinit var results: List - - fun getResults(): List { - return results - } -} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnime.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnime.kt deleted file mode 100644 index aefc1c5..0000000 --- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnime.kt +++ /dev/null @@ -1,35 +0,0 @@ -package xyz.adjutor.aniki.presentation.model.anime - -import com.google.gson.annotations.SerializedName - -//Content of the top field from the api of top anime -class TopAnime { - - @SerializedName("mal_id") - var mal_id: Int? = null - - @SerializedName("rank") - var rank: Int? = null - - @SerializedName("title") - var title: String? = null - - @SerializedName("url") - var url: String? = null - - @SerializedName("episodes") - var episodes: Int? = null - - @SerializedName("start_date") - var start_date: String? = null - - @SerializedName("end_date") - var end_date: String? = null - - @SerializedName("score") - var score: Float? = null - - @SerializedName("image_url") - var image_url: String? = null - -} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnimeResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnimeResponse.kt deleted file mode 100644 index 48e2f8f..0000000 --- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnimeResponse.kt +++ /dev/null @@ -1,13 +0,0 @@ -package xyz.adjutor.aniki.presentation.model.anime - -import com.google.gson.annotations.SerializedName - -class TopAnimeResponse { - - @SerializedName("top") - var top: List? = null - - fun getResults(): List { - return top!! - } -} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/MangaResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/MangaResponse.kt deleted file mode 100644 index 06aeed0..0000000 --- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/MangaResponse.kt +++ /dev/null @@ -1,22 +0,0 @@ -package xyz.adjutor.aniki.presentation.model.manga - -import com.google.gson.annotations.SerializedName - -class MangaResponse { //only kept the infos I didn't have and that were interesting to me. - - @SerializedName("mal_id") - var mal_id: Int? = null - - @SerializedName("chapters") - var chapters: Int? = null - - @SerializedName("synopsis") - var synopsis: String? = null - - @SerializedName("rank") - var rank: Int? = null //added for the search feature (detail) - - @SerializedName("background") - var background: String? = null //a bit of background story about the manga - -} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchManga.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchManga.kt deleted file mode 100644 index d69227b..0000000 --- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchManga.kt +++ /dev/null @@ -1,34 +0,0 @@ -package xyz.adjutor.aniki.presentation.model.manga - -import com.google.gson.annotations.SerializedName - -class SearchManga { - - @SerializedName("mal_id") - var mal_id: Int? = null - - @SerializedName("url") - var url: String? = null - - @SerializedName("image_url") - var image_url: String? = null - - @SerializedName("title") - var title: String? = null - - @SerializedName("chapters") - var chapters: Int? = null - - @SerializedName("volumes") - var volumes: Int? = null - - @SerializedName("score") - var score: Float? = null - - @SerializedName("start_date") //we'll maybe remove this later - var start_date: String? = null - - @SerializedName("end_date") //we'll maybe remove this later - var end_date: String? = null - -} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchMangaResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchMangaResponse.kt deleted file mode 100644 index 942c071..0000000 --- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchMangaResponse.kt +++ /dev/null @@ -1,13 +0,0 @@ -package xyz.adjutor.aniki.presentation.model.manga - -import com.google.gson.annotations.SerializedName - -class SearchMangaResponse { //only kept the infos I didn't have and that were interesting to me. - - @SerializedName("results") - private lateinit var results: List - - fun getResults(): List { - return results - } -} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopManga.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopManga.kt deleted file mode 100644 index 4fe3951..0000000 --- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopManga.kt +++ /dev/null @@ -1,36 +0,0 @@ -package xyz.adjutor.aniki.presentation.model.manga - -import com.google.gson.annotations.SerializedName - -//model -//Content of the top field from the api of top manga -class TopManga { - - @SerializedName("mal_id") - var mal_id: Int? = null - - @SerializedName("rank") - var rank: Int? = null - - @SerializedName("title") - var title: String? = null - - @SerializedName("url") - var url: String? = null - - @SerializedName("volumes") - var volumes: Int? = null - - @SerializedName("start_date") - var start_date: String? = null - - @SerializedName("end_date") - var end_date: String? = null - - @SerializedName("score") - var score: Float? = null - - @SerializedName("image_url") - var image_url: String? = null - -} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopMangaResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopMangaResponse.kt deleted file mode 100644 index a0f6b8c..0000000 --- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopMangaResponse.kt +++ /dev/null @@ -1,13 +0,0 @@ -package xyz.adjutor.aniki.presentation.model.manga - -import com.google.gson.annotations.SerializedName - -class TopMangaResponse { - - @SerializedName("top") - private lateinit var top: List - - fun getResults(): List { - return top - } -} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/AnimeResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/AnimeResponse.kt new file mode 100644 index 0000000..c2ef05b --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/AnimeResponse.kt @@ -0,0 +1,16 @@ +package xyz.adjutor.aniki.presentation.model.response + +import com.google.gson.annotations.SerializedName + +class AnimeResponse { //only kept the infos I didn't have and that were interesting to me. + + @SerializedName("mal_id") + var mal_id: Int? = null + + @SerializedName("rank") + var rank: Int? = null //added for the search feature (detail) + + @SerializedName("synopsis") + var synopsis: String? = null + +} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/MangaResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/MangaResponse.kt new file mode 100644 index 0000000..da88a79 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/MangaResponse.kt @@ -0,0 +1,22 @@ +package xyz.adjutor.aniki.presentation.model.response + +import com.google.gson.annotations.SerializedName + +class MangaResponse { //only kept the infos I didn't have and that were interesting to me. + + @SerializedName("mal_id") + var mal_id: Int? = null + + @SerializedName("chapters") + var chapters: Int? = null + + @SerializedName("synopsis") + var synopsis: String? = null + + @SerializedName("rank") + var rank: Int? = null //added for the search feature (detail) + + @SerializedName("background") + var background: String? = null //a bit of background story about the manga + +} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchAnimeResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchAnimeResponse.kt new file mode 100644 index 0000000..1400704 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchAnimeResponse.kt @@ -0,0 +1,14 @@ +package xyz.adjutor.aniki.presentation.model.response + +import com.google.gson.annotations.SerializedName +import xyz.adjutor.aniki.presentation.model.SearchAnime + +class SearchAnimeResponse { //only kept the infos I didn't have and that were interesting to me. + + @SerializedName("results") + private lateinit var results: List + + fun getResults(): List { + return results + } +} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchMangaResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchMangaResponse.kt new file mode 100644 index 0000000..ed94b95 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchMangaResponse.kt @@ -0,0 +1,14 @@ +package xyz.adjutor.aniki.presentation.model.response + +import com.google.gson.annotations.SerializedName +import xyz.adjutor.aniki.presentation.model.SearchManga + +class SearchMangaResponse { //only kept the infos I didn't have and that were interesting to me. + + @SerializedName("results") + private lateinit var results: List + + fun getResults(): List { + return results + } +} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopAnimeResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopAnimeResponse.kt new file mode 100644 index 0000000..0c0adb4 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopAnimeResponse.kt @@ -0,0 +1,14 @@ +package xyz.adjutor.aniki.presentation.model.response + +import com.google.gson.annotations.SerializedName +import xyz.adjutor.aniki.presentation.model.TopAnime + +class TopAnimeResponse { + + @SerializedName("top") + var top: List? = null + + fun getResults(): List { + return top!! + } +} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopMangaResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopMangaResponse.kt new file mode 100644 index 0000000..091984c --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopMangaResponse.kt @@ -0,0 +1,14 @@ +package xyz.adjutor.aniki.presentation.model.response + +import com.google.gson.annotations.SerializedName +import xyz.adjutor.aniki.presentation.model.TopManga + +class TopMangaResponse { + + @SerializedName("top") + private lateinit var top: List + + fun getResults(): List { + return top + } +} \ No newline at end of file -- cgit v1.2.3