From ac929460d07e0d0ef8c6b4ea569a2b2c6daa3b13 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Tue, 23 Mar 2021 11:47:53 +0100 Subject: Refactoring into MVC --- app/build.gradle | 4 +- app/src/main/AndroidManifest.xml | 10 +- app/src/main/java/xyz/adjutor/aniki/HomePage.kt | 37 ---- .../main/java/xyz/adjutor/aniki/MainActivity.kt | 13 -- .../main/java/xyz/adjutor/aniki/anime/AnimeApi.kt | 12 -- .../java/xyz/adjutor/aniki/anime/AnimeResponse.kt | 16 -- .../anime/search/DetailSearchAnimeActivity.kt | 156 ----------------- .../xyz/adjutor/aniki/anime/search/SearchAnime.kt | 31 ---- .../aniki/anime/search/SearchAnimeAdapter.kt | 81 --------- .../adjutor/aniki/anime/search/SearchAnimeApi.kt | 12 -- .../adjutor/aniki/anime/search/SearchAnimePage.kt | 134 -------------- .../aniki/anime/search/SearchAnimeResponse.kt | 13 -- .../aniki/anime/topanime/DetailTopAnimeActivity.kt | 176 ------------------- .../xyz/adjutor/aniki/anime/topanime/TopAnime.kt | 35 ---- .../aniki/anime/topanime/TopAnimeAdapter.kt | 80 --------- .../adjutor/aniki/anime/topanime/TopAnimeApi.kt | 12 -- .../adjutor/aniki/anime/topanime/TopAnimePage.kt | 173 ------------------ .../aniki/anime/topanime/TopAnimeResponse.kt | 13 -- .../main/java/xyz/adjutor/aniki/data/AnimeApi.kt | 13 ++ .../main/java/xyz/adjutor/aniki/data/MangaApi.kt | 13 ++ .../java/xyz/adjutor/aniki/data/SearchAnimeApi.kt | 13 ++ .../java/xyz/adjutor/aniki/data/SearchMangaApi.kt | 13 ++ .../java/xyz/adjutor/aniki/data/TopAnimeApi.kt | 13 ++ .../java/xyz/adjutor/aniki/data/TopMangaApi.kt | 13 ++ .../main/java/xyz/adjutor/aniki/manga/MangaApi.kt | 12 -- .../java/xyz/adjutor/aniki/manga/MangaResponse.kt | 22 --- .../manga/search/DetailSearchMangaActivity.kt | 169 ------------------ .../xyz/adjutor/aniki/manga/search/SearchManga.kt | 34 ---- .../aniki/manga/search/SearchMangaAdapter.kt | 83 --------- .../adjutor/aniki/manga/search/SearchMangaApi.kt | 12 -- .../adjutor/aniki/manga/search/SearchMangaPage.kt | 142 --------------- .../aniki/manga/search/SearchMangaResponse.kt | 13 -- .../aniki/manga/topmanga/DetailTopMangaActivity.kt | 193 --------------------- .../xyz/adjutor/aniki/manga/topmanga/TopManga.kt | 35 ---- .../aniki/manga/topmanga/TopMangaAdapter.kt | 81 --------- .../adjutor/aniki/manga/topmanga/TopMangaApi.kt | 12 -- .../adjutor/aniki/manga/topmanga/TopMangaPage.kt | 174 ------------------- .../aniki/manga/topmanga/TopMangaResponse.kt | 13 -- .../aniki/presentation/model/AnimeResponse.kt | 16 ++ .../aniki/presentation/model/MangaResponse.kt | 22 +++ .../aniki/presentation/model/SearchAnime.kt | 31 ++++ .../presentation/model/SearchAnimeResponse.kt | 13 ++ .../aniki/presentation/model/SearchManga.kt | 34 ++++ .../presentation/model/SearchMangaResponse.kt | 13 ++ .../adjutor/aniki/presentation/model/TopAnime.kt | 35 ++++ .../aniki/presentation/model/TopAnimeResponse.kt | 13 ++ .../adjutor/aniki/presentation/model/TopManga.kt | 35 ++++ .../aniki/presentation/model/TopMangaResponse.kt | 13 ++ .../presentation/view/DetailSearchAnimeActivity.kt | 156 +++++++++++++++++ .../presentation/view/DetailSearchMangaActivity.kt | 169 ++++++++++++++++++ .../presentation/view/DetailTopAnimeActivity.kt | 176 +++++++++++++++++++ .../presentation/view/DetailTopMangaActivity.kt | 193 +++++++++++++++++++++ .../adjutor/aniki/presentation/view/HomePage.kt | 38 ++++ .../aniki/presentation/view/MainActivity.kt | 14 ++ .../aniki/presentation/view/SearchAnimeAdapter.kt | 82 +++++++++ .../aniki/presentation/view/SearchAnimePage.kt | 136 +++++++++++++++ .../aniki/presentation/view/SearchMangaAdapter.kt | 84 +++++++++ .../aniki/presentation/view/SearchMangaPage.kt | 144 +++++++++++++++ .../aniki/presentation/view/TopAnimeAdapter.kt | 81 +++++++++ .../aniki/presentation/view/TopAnimePage.kt | 176 +++++++++++++++++++ .../aniki/presentation/view/TopMangaAdapter.kt | 82 +++++++++ .../aniki/presentation/view/TopMangaPage.kt | 177 +++++++++++++++++++ .../main/res/layout/activity_detail_top_anime.xml | 2 +- .../main/res/layout/activity_detail_top_manga.xml | 2 +- app/src/main/res/layout/activity_main.xml | 2 +- app/src/main/res/layout/home_page.xml | 2 +- app/src/main/res/layout/search_anime_page.xml | 2 +- app/src/main/res/layout/search_manga_page.xml | 2 +- app/src/main/res/layout/top_anime_page.xml | 2 +- app/src/main/res/layout/top_manga_page.xml | 2 +- app/src/main/res/navigation/nav_graph.xml | 10 +- build.gradle | 2 +- 72 files changed, 2032 insertions(+), 2010 deletions(-) delete mode 100644 app/src/main/java/xyz/adjutor/aniki/HomePage.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/MainActivity.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/AnimeApi.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/AnimeResponse.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/search/DetailSearchAnimeActivity.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnime.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnimeAdapter.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnimeApi.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnimePage.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnimeResponse.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/topanime/DetailTopAnimeActivity.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/topanime/TopAnime.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/topanime/TopAnimeAdapter.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/topanime/TopAnimeApi.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/topanime/TopAnimePage.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/anime/topanime/TopAnimeResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/AnimeApi.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/MangaApi.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/SearchAnimeApi.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/SearchMangaApi.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/TopAnimeApi.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/TopMangaApi.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/MangaApi.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/MangaResponse.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/search/DetailSearchMangaActivity.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/search/SearchManga.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaAdapter.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaApi.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaPage.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaResponse.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/topmanga/DetailTopMangaActivity.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/topmanga/TopManga.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/topmanga/TopMangaAdapter.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/topmanga/TopMangaApi.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/topmanga/TopMangaPage.kt delete mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/topmanga/TopMangaResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/AnimeResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/MangaResponse.kt 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/SearchAnimeResponse.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/SearchMangaResponse.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/TopAnimeResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/TopManga.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/TopMangaResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/DetailSearchAnimeActivity.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/DetailSearchMangaActivity.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/DetailTopAnimeActivity.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/DetailTopMangaActivity.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/HomePage.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/MainActivity.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/SearchAnimeAdapter.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/SearchAnimePage.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/SearchMangaAdapter.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/SearchMangaPage.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/TopAnimeAdapter.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/TopAnimePage.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/TopMangaAdapter.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/view/TopMangaPage.kt diff --git a/app/build.gradle b/app/build.gradle index 0251555..d28b3c6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,8 +40,8 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'com.google.android.material:material:1.3.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - implementation 'androidx.navigation:navigation-fragment-ktx:2.3.3' - implementation 'androidx.navigation:navigation-ui-ktx:2.3.3' + implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4' + implementation 'androidx.navigation:navigation-ui-ktx:2.3.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4de763c..93413a4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -14,23 +14,23 @@ android:theme="@style/Theme.Aniki" tools:ignore="AllowBackup"> diff --git a/app/src/main/java/xyz/adjutor/aniki/HomePage.kt b/app/src/main/java/xyz/adjutor/aniki/HomePage.kt deleted file mode 100644 index 46dac33..0000000 --- a/app/src/main/java/xyz/adjutor/aniki/HomePage.kt +++ /dev/null @@ -1,37 +0,0 @@ -package xyz.adjutor.aniki - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.Button -import androidx.fragment.app.Fragment -import androidx.navigation.fragment.findNavController - -class HomePage : Fragment() { - - override fun onCreateView( - inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.home_page, container, false) - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - view.findViewById