aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/xyz/adjutor/aniki/presentation
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/xyz/adjutor/aniki/presentation')
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/Constants.kt8
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/Singletons.kt25
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailSearchAnimeController.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/DetailSearchAnimeController.kt)18
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailSearchMangaController.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/DetailSearchMangaController.kt)18
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailTopAnimeController.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/DetailTopAnimeController.kt)19
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailTopMangaController.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/DetailTopMangaController.kt)19
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/controller/SearchAnimeController.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/SearchAnimeController.kt)26
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/controller/SearchMangaController.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/SearchMangaController.kt)26
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/controller/TopAnimeController.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/TopAnimeController.kt)37
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/controller/TopMangaController.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/TopMangaController.kt)35
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchAnime.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnime.kt)2
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchManga.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchManga.kt)2
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/model/TopAnime.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnime.kt)2
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/model/TopManga.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopManga.kt)2
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/model/response/AnimeResponse.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/AnimeResponse.kt)2
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/model/response/MangaResponse.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/MangaResponse.kt)2
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchAnimeResponse.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnimeResponse.kt)3
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchMangaResponse.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchMangaResponse.kt)3
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopAnimeResponse.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnimeResponse.kt)3
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopMangaResponse.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopMangaResponse.kt)3
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailSearchAnimeActivity.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/DetailSearchAnimeActivity.kt)6
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailSearchMangaActivity.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/DetailSearchMangaActivity.kt)6
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailTopAnimeActivity.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/DetailTopAnimeActivity.kt)6
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailTopMangaActivity.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/DetailTopMangaActivity.kt)6
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/MainActivity.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/MainActivity.kt)2
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/SearchAnimeAdapter.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/SearchAnimeAdapter.kt)5
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/SearchMangaAdapter.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/SearchMangaAdapter.kt)5
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/TopAnimeAdapter.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/TopAnimeAdapter.kt)5
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/TopMangaAdapter.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/TopMangaAdapter.kt)5
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/HomePage.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/HomePage.kt)2
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/SearchAnimeFragment.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/SearchAnimePage.kt)12
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/SearchMangaFragment.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/SearchMangaPage.kt)11
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/TopAnimeFragment.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/TopAnimePage.kt)9
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/TopMangaFragment.kt (renamed from app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/TopMangaPage.kt)9
34 files changed, 151 insertions, 193 deletions
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/Constants.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/Constants.kt
new file mode 100644
index 0000000..23e5c3f
--- /dev/null
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/Constants.kt
@@ -0,0 +1,8 @@
+package xyz.adjutor.aniki.presentation
+
+class Constants {
+ companion object {
+ const val baseUrl = "https://api.jikan.moe/"
+ }
+
+} \ No newline at end of file
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/Singletons.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/Singletons.kt
index 827c7e3..896757c 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/Singletons.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/Singletons.kt
@@ -4,55 +4,52 @@ import com.google.gson.Gson
import com.google.gson.GsonBuilder
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
-import xyz.adjutor.aniki.data.anime.AnimeApi
-import xyz.adjutor.aniki.data.anime.SearchAnimeApi
-import xyz.adjutor.aniki.data.anime.TopAnimeApi
-import xyz.adjutor.aniki.data.manga.MangaApi
-import xyz.adjutor.aniki.data.manga.SearchMangaApi
-import xyz.adjutor.aniki.data.manga.TopMangaApi
+import xyz.adjutor.aniki.data.*
+import xyz.adjutor.aniki.presentation.Constants.Companion.baseUrl
class Singletons {
companion object {
+
val gson: Gson = GsonBuilder()
.setLenient()
- .create()!!
- private const val BASE_URL = "https://api.jikan.moe/"
+ .create()
val topMangaApi: TopMangaApi = Retrofit.Builder()
- .baseUrl(BASE_URL)
+ .baseUrl(baseUrl)
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
.create(TopMangaApi::class.java)
val searchMangaApi: SearchMangaApi = Retrofit.Builder()
- .baseUrl(BASE_URL)
+ .baseUrl(baseUrl)
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
.create(SearchMangaApi::class.java)
val mangaApi: MangaApi = Retrofit.Builder()
- .baseUrl(BASE_URL)
+ .baseUrl(baseUrl)
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
.create(MangaApi::class.java)
val topAnimeApi: TopAnimeApi = Retrofit.Builder()
- .baseUrl(BASE_URL)
+ .baseUrl(baseUrl)
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
.create(TopAnimeApi::class.java)
val searchAnimeApi: SearchAnimeApi = Retrofit.Builder()
- .baseUrl(BASE_URL)
+ .baseUrl(baseUrl)
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
.create(SearchAnimeApi::class.java)
val animeApi: AnimeApi = Retrofit.Builder()
- .baseUrl(BASE_URL)
+ .baseUrl(baseUrl)
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
.create(AnimeApi::class.java)
}
+
}
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/DetailSearchAnimeController.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailSearchAnimeController.kt
index e12de3a..95aabec 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/DetailSearchAnimeController.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailSearchAnimeController.kt
@@ -1,32 +1,24 @@
-package xyz.adjutor.aniki.presentation.controller.anime
+package xyz.adjutor.aniki.presentation.controller
-import com.google.gson.Gson
-import com.google.gson.GsonBuilder
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import xyz.adjutor.aniki.presentation.Singletons
-import xyz.adjutor.aniki.presentation.model.anime.AnimeResponse
-import xyz.adjutor.aniki.presentation.view.anime.DetailSearchAnimeActivity
+import xyz.adjutor.aniki.presentation.model.response.AnimeResponse
+import xyz.adjutor.aniki.presentation.view.activity.DetailSearchAnimeActivity
class DetailSearchAnimeController {
- lateinit var gson: Gson
- private lateinit var baseUrl: String //the api's base url
lateinit var view: DetailSearchAnimeActivity
fun onStart(DetailSearchAnimeActivity: DetailSearchAnimeActivity, animeId: String) {
view = DetailSearchAnimeActivity
- baseUrl = "https://api.jikan.moe/" //the api's base url
- gson = GsonBuilder()
- .setLenient()
- .create()
- makeApiCall(baseUrl, animeId)
+ makeApiCall(animeId)
}
- private fun makeApiCall(BASE_URL: String, animeId: String) {
+ private fun makeApiCall(animeId: String) {
Singletons
.animeApi
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/DetailSearchMangaController.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailSearchMangaController.kt
index 080e4ed..d2f718a 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/DetailSearchMangaController.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailSearchMangaController.kt
@@ -1,32 +1,24 @@
-package xyz.adjutor.aniki.presentation.controller.manga
+package xyz.adjutor.aniki.presentation.controller
-import com.google.gson.Gson
-import com.google.gson.GsonBuilder
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import xyz.adjutor.aniki.presentation.Singletons
-import xyz.adjutor.aniki.presentation.model.manga.MangaResponse
-import xyz.adjutor.aniki.presentation.view.manga.DetailSearchMangaActivity
+import xyz.adjutor.aniki.presentation.model.response.MangaResponse
+import xyz.adjutor.aniki.presentation.view.activity.DetailSearchMangaActivity
class DetailSearchMangaController {
- lateinit var gson: Gson
- private lateinit var baseUrl: String //the api's base url
lateinit var view: DetailSearchMangaActivity
fun onStart(DetailSearchMangaActivity: DetailSearchMangaActivity, mangaId: String) {
view = DetailSearchMangaActivity
- baseUrl = "https://api.jikan.moe/" //the api's base url
- gson = GsonBuilder()
- .setLenient()
- .create()
- makeApiCall(baseUrl, mangaId)
+ makeApiCall(mangaId)
}
- private fun makeApiCall(BASE_URL: String, mangaId: String) {
+ private fun makeApiCall(mangaId: String) {
Singletons
.mangaApi
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/DetailTopAnimeController.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailTopAnimeController.kt
index 3fb13b4..46e7edd 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/DetailTopAnimeController.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailTopAnimeController.kt
@@ -1,32 +1,25 @@
-package xyz.adjutor.aniki.presentation.controller.anime
+package xyz.adjutor.aniki.presentation.controller
import android.content.Context
import android.content.SharedPreferences
-import com.google.gson.Gson
-import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import xyz.adjutor.aniki.presentation.Singletons
-import xyz.adjutor.aniki.presentation.model.anime.AnimeResponse
-import xyz.adjutor.aniki.presentation.view.anime.DetailTopAnimeActivity
+import xyz.adjutor.aniki.presentation.Singletons.Companion.gson
+import xyz.adjutor.aniki.presentation.model.response.AnimeResponse
+import xyz.adjutor.aniki.presentation.view.activity.DetailTopAnimeActivity
import java.lang.reflect.Type
class DetailTopAnimeController {
private lateinit var sharedPreferences: SharedPreferences
- lateinit var gson: Gson
- private lateinit var baseUrl: String //the api's base url
lateinit var view: DetailTopAnimeActivity
fun onStart(DetailTopAnimeActivity: DetailTopAnimeActivity, animeId: String) {
view = DetailTopAnimeActivity
- baseUrl = "https://api.jikan.moe/" //the api's base url
- gson = GsonBuilder()
- .setLenient()
- .create()
sharedPreferences =
view.applicationContext.getSharedPreferences("sp_anime", Context.MODE_PRIVATE)
@@ -35,7 +28,7 @@ class DetailTopAnimeController {
view.showDetail(anime)
} else {
//taking the API's fields I want and displaying them
- makeApiCall(baseUrl, animeId)
+ makeApiCall(animeId)
}
}
@@ -50,7 +43,7 @@ class DetailTopAnimeController {
}
}
- private fun makeApiCall(BASE_URL: String, animeId: String) {
+ private fun makeApiCall(animeId: String) {
Singletons
.animeApi
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/DetailTopMangaController.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailTopMangaController.kt
index 9789d0c..f9aaa07 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/DetailTopMangaController.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/DetailTopMangaController.kt
@@ -1,32 +1,25 @@
-package xyz.adjutor.aniki.presentation.controller.manga
+package xyz.adjutor.aniki.presentation.controller
import android.content.Context
import android.content.SharedPreferences
-import com.google.gson.Gson
-import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import xyz.adjutor.aniki.presentation.Singletons
-import xyz.adjutor.aniki.presentation.model.manga.MangaResponse
-import xyz.adjutor.aniki.presentation.view.manga.DetailTopMangaActivity
+import xyz.adjutor.aniki.presentation.Singletons.Companion.gson
+import xyz.adjutor.aniki.presentation.model.response.MangaResponse
+import xyz.adjutor.aniki.presentation.view.activity.DetailTopMangaActivity
import java.lang.reflect.Type
class DetailTopMangaController {
private lateinit var sharedPreferences: SharedPreferences
- lateinit var gson: Gson
- private lateinit var baseUrl: String //the api's base url
lateinit var view: DetailTopMangaActivity
fun onStart(DetailTopMangaActivity: DetailTopMangaActivity, mangaId: String) {
view = DetailTopMangaActivity
- baseUrl = "https://api.jikan.moe/" //the api's base url
- gson = GsonBuilder()
- .setLenient()
- .create()
sharedPreferences =
view.applicationContext.getSharedPreferences("sp_manga", Context.MODE_PRIVATE)
@@ -35,7 +28,7 @@ class DetailTopMangaController {
view.showDetail(manga)
} else {
//taking the API's fields I want and displaying them
- makeApiCall(baseUrl, mangaId)
+ makeApiCall(mangaId)
}
}
@@ -50,7 +43,7 @@ class DetailTopMangaController {
}
}
- private fun makeApiCall(BASE_URL: String, mangaId: String) {
+ private fun makeApiCall(mangaId: String) {
Singletons
.mangaApi
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/SearchAnimeController.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/SearchAnimeController.kt
index 5951f1b..3ee6047 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/SearchAnimeController.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/SearchAnimeController.kt
@@ -1,32 +1,24 @@
-package xyz.adjutor.aniki.presentation.controller.anime
+package xyz.adjutor.aniki.presentation.controller
-import com.google.gson.Gson
-import com.google.gson.GsonBuilder
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import xyz.adjutor.aniki.presentation.Singletons
-import xyz.adjutor.aniki.presentation.model.anime.SearchAnime
-import xyz.adjutor.aniki.presentation.model.anime.SearchAnimeResponse
-import xyz.adjutor.aniki.presentation.view.anime.SearchAnimePage
+import xyz.adjutor.aniki.presentation.model.SearchAnime
+import xyz.adjutor.aniki.presentation.model.response.SearchAnimeResponse
+import xyz.adjutor.aniki.presentation.view.fragment.SearchAnimeFragment
class SearchAnimeController {
- lateinit var gson: Gson
- lateinit var baseUrl: String //the api's base url
- lateinit var view: SearchAnimePage
+ lateinit var view: SearchAnimeFragment
- fun onStart(searchAnimePage: SearchAnimePage) {
+ fun onStart(searchAnimeFragment: SearchAnimeFragment) {
- view = searchAnimePage
- baseUrl = "https://api.jikan.moe/" //the api's base url
- gson = GsonBuilder()
- .setLenient()
- .create()
+ view = searchAnimeFragment
}
//call the API and show the list
- private fun makeApiCall(view: SearchAnimePage, BASE_URL: String, query: String) {
+ private fun makeApiCall(view: SearchAnimeFragment, query: String) {
Singletons
.searchAnimeApi
@@ -59,7 +51,7 @@ class SearchAnimeController {
}
fun updateList(userInput: String) {
- makeApiCall(view, baseUrl, userInput)
+ makeApiCall(view, userInput)
}
} \ No newline at end of file
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/SearchMangaController.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/SearchMangaController.kt
index de1edad..7d5f92b 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/SearchMangaController.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/SearchMangaController.kt
@@ -1,32 +1,24 @@
-package xyz.adjutor.aniki.presentation.controller.manga
+package xyz.adjutor.aniki.presentation.controller
-import com.google.gson.Gson
-import com.google.gson.GsonBuilder
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import xyz.adjutor.aniki.presentation.Singletons
-import xyz.adjutor.aniki.presentation.model.manga.SearchManga
-import xyz.adjutor.aniki.presentation.model.manga.SearchMangaResponse
-import xyz.adjutor.aniki.presentation.view.manga.SearchMangaPage
+import xyz.adjutor.aniki.presentation.model.SearchManga
+import xyz.adjutor.aniki.presentation.model.response.SearchMangaResponse
+import xyz.adjutor.aniki.presentation.view.fragment.SearchMangaFragment
class SearchMangaController {
- lateinit var gson: Gson
- lateinit var baseUrl: String //the api's base url
- lateinit var view: SearchMangaPage
+ lateinit var view: SearchMangaFragment
- fun onStart(searchMangaPage: SearchMangaPage) {
+ fun onStart(searchMangaFragment: SearchMangaFragment) {
- view = searchMangaPage
- baseUrl = "https://api.jikan.moe/" //the api's base url
- gson = GsonBuilder()
- .setLenient()
- .create()
+ view = searchMangaFragment
}
//call the API and show the list
- private fun makeApiCall(view: SearchMangaPage, BASE_URL: String, query: String) {
+ private fun makeApiCall(view: SearchMangaFragment, query: String) {
Singletons
.searchMangaApi
@@ -59,7 +51,7 @@ class SearchMangaController {
}
fun updateList(userInput: String) {
- makeApiCall(view, baseUrl, userInput)
+ makeApiCall(view, userInput)
}
} \ No newline at end of file
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/TopAnimeController.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/TopAnimeController.kt
index 57dc10b..446f4e6 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/anime/TopAnimeController.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/TopAnimeController.kt
@@ -1,37 +1,30 @@
-package xyz.adjutor.aniki.presentation.controller.anime
+package xyz.adjutor.aniki.presentation.controller
import android.content.Context
import android.content.SharedPreferences
import android.view.View
-import com.google.gson.Gson
-import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import xyz.adjutor.aniki.presentation.Singletons
-import xyz.adjutor.aniki.presentation.model.anime.TopAnime
-import xyz.adjutor.aniki.presentation.model.anime.TopAnimeResponse
-import xyz.adjutor.aniki.presentation.view.anime.TopAnimePage
+import xyz.adjutor.aniki.presentation.Singletons.Companion.gson
+import xyz.adjutor.aniki.presentation.model.TopAnime
+import xyz.adjutor.aniki.presentation.model.response.TopAnimeResponse
+import xyz.adjutor.aniki.presentation.view.fragment.TopAnimeFragment
import java.lang.reflect.Type
import kotlin.properties.Delegates
class TopAnimeController {
- lateinit var sharedPreferences: SharedPreferences
- lateinit var gson: Gson
- lateinit var baseUrl: String //the api's base url
- var page by Delegates.notNull<Int>()
- lateinit var view: TopAnimePage
+ private lateinit var sharedPreferences: SharedPreferences
+ private var page by Delegates.notNull<Int>()
+ lateinit var view: TopAnimeFragment
- fun onStart(topAnimePage: TopAnimePage, viewTopAnimePage: View) {
+ fun onStart(topAnimeFragment: TopAnimeFragment, viewTopAnimePage: View) {
- view = topAnimePage
- baseUrl = "https://api.jikan.moe/" //the api's base url
+ view = topAnimeFragment
page = 1
- gson = GsonBuilder()
- .setLenient()
- .create()
sharedPreferences =
viewTopAnimePage.context.getSharedPreferences("sp_anime", Context.MODE_PRIVATE)
@@ -40,11 +33,11 @@ class TopAnimeController {
if (animeList != null) {
view.showList(viewTopAnimePage, animeList)
} else {
- makeApiCall(view, baseUrl, 1)
+ makeApiCall(view, 1)
}
}
- fun makeApiCall(view: TopAnimePage, BASE_URL: String, page: Int) {
+ private fun makeApiCall(view: TopAnimeFragment, page: Int) {
Singletons
.topAnimeApi
@@ -102,7 +95,7 @@ class TopAnimeController {
fun onButtonPrevClick() {
if (page > 1) { // if we're not on the first page, because we can't go back if we're on the first one.
page -= 1
- makeApiCall(view, baseUrl, page)
+ makeApiCall(view, page)
view.showText("Page $page has been loaded.")
} else {
view.showText("You're already on page 1. (If you're actually not, refresh the list.)")
@@ -111,12 +104,12 @@ class TopAnimeController {
fun onButtonNextClick() {
page += 1
- makeApiCall(view, baseUrl, page)
+ makeApiCall(view, page)
view.showText("Page $page has been loaded.")
}
fun updateList() {
- makeApiCall(view, baseUrl, 1)
+ makeApiCall(view, 1)
view.showText("Data refreshed")
page = 1
}
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/TopMangaController.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/TopMangaController.kt
index ea631fd..afdbac7 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/TopMangaController.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/TopMangaController.kt
@@ -1,37 +1,30 @@
-package xyz.adjutor.aniki.presentation.controller.manga
+package xyz.adjutor.aniki.presentation.controller
import android.content.Context
import android.content.SharedPreferences
import android.view.View
-import com.google.gson.Gson
-import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import xyz.adjutor.aniki.presentation.Singletons
-import xyz.adjutor.aniki.presentation.model.manga.TopManga
-import xyz.adjutor.aniki.presentation.model.manga.TopMangaResponse
-import xyz.adjutor.aniki.presentation.view.manga.TopMangaPage
+import xyz.adjutor.aniki.presentation.Singletons.Companion.gson
+import xyz.adjutor.aniki.presentation.model.TopManga
+import xyz.adjutor.aniki.presentation.model.response.TopMangaResponse
+import xyz.adjutor.aniki.presentation.view.fragment.TopMangaFragment
import java.lang.reflect.Type
import kotlin.properties.Delegates
class TopMangaController {
- lateinit var sharedPreferences: SharedPreferences
- lateinit var gson: Gson
- lateinit var baseUrl: String //the api's base url
- var page by Delegates.notNull<Int>()
- lateinit var view: TopMangaPage
+ private lateinit var sharedPreferences: SharedPreferences
+ private var page by Delegates.notNull<Int>()
+ lateinit var view: TopMangaFragment
- fun onStart(topMangaPage: TopMangaPage, viewTopMangaPage: View) {
+ fun onStart(topMangaPage: TopMangaFragment, viewTopMangaPage: View) {
view = topMangaPage
- baseUrl = "https://api.jikan.moe/" //the api's base url
page = 1
- gson = GsonBuilder()
- .setLenient()
- .create()
sharedPreferences =
viewTopMangaPage.context.getSharedPreferences("sp_manga", Context.MODE_PRIVATE)
@@ -40,11 +33,11 @@ class TopMangaController {
if (mangaList != null) {
view.showList(viewTopMangaPage, mangaList)
} else {
- makeApiCall(view, baseUrl, 1)
+ makeApiCall(view, 1)
}
}
- private fun makeApiCall(view: TopMangaPage, BASE_URL: String, page: Int) {
+ private fun makeApiCall(view: TopMangaFragment, page: Int) {
Singletons
.topMangaApi
@@ -102,7 +95,7 @@ class TopMangaController {
fun onButtonPrevClick() {
if (page > 1) { // if we're not on the first page, because we can't go back if we're on the first one.
page -= 1
- makeApiCall(view, baseUrl, page)
+ makeApiCall(view, page)
view.showText("Page $page has been loaded.")
} else {
view.showText("You're already on page 1. (If you're actually not, refresh the list.)")
@@ -111,12 +104,12 @@ class TopMangaController {
fun onButtonNextClick() {
page += 1
- makeApiCall(view, baseUrl, page)
+ makeApiCall(view, page)
view.showText("Page $page has been loaded.")
}
fun updateList() {
- makeApiCall(view, baseUrl, 1)
+ makeApiCall(view, 1)
view.showText("Data refreshed")
page = 1
}
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/SearchAnime.kt
index 7e4340c..df5189d 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnime.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchAnime.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.model.anime
+package xyz.adjutor.aniki.presentation.model
import com.google.gson.annotations.SerializedName
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/SearchManga.kt
index d69227b..c24d93c 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchManga.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/SearchManga.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.model.manga
+package xyz.adjutor.aniki.presentation.model
import com.google.gson.annotations.SerializedName
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/TopAnime.kt
index aefc1c5..3cf4390 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnime.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/TopAnime.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.model.anime
+package xyz.adjutor.aniki.presentation.model
import com.google.gson.annotations.SerializedName
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/TopManga.kt
index 4fe3951..27f63f3 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopManga.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/TopManga.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.model.manga
+package xyz.adjutor.aniki.presentation.model
import com.google.gson.annotations.SerializedName
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/response/AnimeResponse.kt
index e4336ce..c2ef05b 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/AnimeResponse.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/AnimeResponse.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.model.anime
+package xyz.adjutor.aniki.presentation.model.response
import com.google.gson.annotations.SerializedName
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/response/MangaResponse.kt
index 06aeed0..da88a79 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/MangaResponse.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/MangaResponse.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.model.manga
+package xyz.adjutor.aniki.presentation.model.response
import com.google.gson.annotations.SerializedName
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/response/SearchAnimeResponse.kt
index d04aa67..1400704 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/SearchAnimeResponse.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchAnimeResponse.kt
@@ -1,6 +1,7 @@
-package xyz.adjutor.aniki.presentation.model.anime
+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.
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/response/SearchMangaResponse.kt
index 942c071..ed94b95 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchMangaResponse.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/SearchMangaResponse.kt
@@ -1,6 +1,7 @@
-package xyz.adjutor.aniki.presentation.model.manga
+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.
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/response/TopAnimeResponse.kt
index 48e2f8f..0c0adb4 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/anime/TopAnimeResponse.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopAnimeResponse.kt
@@ -1,6 +1,7 @@
-package xyz.adjutor.aniki.presentation.model.anime
+package xyz.adjutor.aniki.presentation.model.response
import com.google.gson.annotations.SerializedName
+import xyz.adjutor.aniki.presentation.model.TopAnime
class TopAnimeResponse {
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/response/TopMangaResponse.kt
index a0f6b8c..091984c 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopMangaResponse.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/response/TopMangaResponse.kt
@@ -1,6 +1,7 @@
-package xyz.adjutor.aniki.presentation.model.manga
+package xyz.adjutor.aniki.presentation.model.response
import com.google.gson.annotations.SerializedName
+import xyz.adjutor.aniki.presentation.model.TopManga
class TopMangaResponse {
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/DetailSearchAnimeActivity.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailSearchAnimeActivity.kt
index 5acf1c3..1b015b6 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/DetailSearchAnimeActivity.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailSearchAnimeActivity.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.anime
+package xyz.adjutor.aniki.presentation.view.activity
import android.os.Bundle
import android.widget.ImageView
@@ -8,8 +8,8 @@ import androidx.appcompat.app.AppCompatActivity
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.controller.anime.DetailSearchAnimeController
-import xyz.adjutor.aniki.presentation.model.anime.AnimeResponse
+import xyz.adjutor.aniki.presentation.controller.DetailSearchAnimeController
+import xyz.adjutor.aniki.presentation.model.response.AnimeResponse
class DetailSearchAnimeActivity : AppCompatActivity() {
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/DetailSearchMangaActivity.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailSearchMangaActivity.kt
index 83beb9b..5e57c5a 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/DetailSearchMangaActivity.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailSearchMangaActivity.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.manga
+package xyz.adjutor.aniki.presentation.view.activity
import android.os.Bundle
import android.widget.ImageView
@@ -8,8 +8,8 @@ import androidx.appcompat.app.AppCompatActivity
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.controller.manga.DetailSearchMangaController
-import xyz.adjutor.aniki.presentation.model.manga.MangaResponse
+import xyz.adjutor.aniki.presentation.controller.DetailSearchMangaController
+import xyz.adjutor.aniki.presentation.model.response.MangaResponse
class DetailSearchMangaActivity : AppCompatActivity() {
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/DetailTopAnimeActivity.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailTopAnimeActivity.kt
index b8cf505..5902e94 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/DetailTopAnimeActivity.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailTopAnimeActivity.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.anime
+package xyz.adjutor.aniki.presentation.view.activity
import android.os.Bundle
import android.widget.ImageView
@@ -8,8 +8,8 @@ import androidx.appcompat.app.AppCompatActivity
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.controller.anime.DetailTopAnimeController
-import xyz.adjutor.aniki.presentation.model.anime.AnimeResponse
+import xyz.adjutor.aniki.presentation.controller.DetailTopAnimeController
+import xyz.adjutor.aniki.presentation.model.response.AnimeResponse
class DetailTopAnimeActivity : AppCompatActivity() {
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/DetailTopMangaActivity.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailTopMangaActivity.kt
index 2a4b28b..3e70acc 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/DetailTopMangaActivity.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/DetailTopMangaActivity.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.manga
+package xyz.adjutor.aniki.presentation.view.activity
import android.os.Bundle
import android.widget.ImageView
@@ -8,8 +8,8 @@ import androidx.appcompat.app.AppCompatActivity
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.controller.manga.DetailTopMangaController
-import xyz.adjutor.aniki.presentation.model.manga.MangaResponse
+import xyz.adjutor.aniki.presentation.controller.DetailTopMangaController
+import xyz.adjutor.aniki.presentation.model.response.MangaResponse
class DetailTopMangaActivity : AppCompatActivity() {
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/MainActivity.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/MainActivity.kt
index e58737a..3a50028 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/MainActivity.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/activity/MainActivity.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view
+package xyz.adjutor.aniki.presentation.view.activity
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/SearchAnimeAdapter.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/SearchAnimeAdapter.kt
index 3bb875b..8d828d3 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/SearchAnimeAdapter.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/SearchAnimeAdapter.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.anime
+package xyz.adjutor.aniki.presentation.view.adapter
import android.content.Intent
import android.view.LayoutInflater
@@ -11,7 +11,8 @@ import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.model.anime.SearchAnime
+import xyz.adjutor.aniki.presentation.model.SearchAnime
+import xyz.adjutor.aniki.presentation.view.activity.DetailSearchAnimeActivity
class SearchAnimeAdapter(private val animeList: List<SearchAnime>) :
RecyclerView.Adapter<SearchAnimeAdapter.AnimeViewHolder>() {
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/SearchMangaAdapter.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/SearchMangaAdapter.kt
index c0813c8..ab99bce 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/SearchMangaAdapter.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/SearchMangaAdapter.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.manga
+package xyz.adjutor.aniki.presentation.view.adapter
import android.content.Intent
import android.view.LayoutInflater
@@ -11,7 +11,8 @@ import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.model.manga.SearchManga
+import xyz.adjutor.aniki.presentation.model.SearchManga
+import xyz.adjutor.aniki.presentation.view.activity.DetailSearchMangaActivity
class SearchMangaAdapter(private val mangaList: List<SearchManga>) :
RecyclerView.Adapter<SearchMangaAdapter.MangaViewHolder>() {
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/TopAnimeAdapter.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/TopAnimeAdapter.kt
index 0529c26..ee0df14 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/TopAnimeAdapter.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/TopAnimeAdapter.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.anime
+package xyz.adjutor.aniki.presentation.view.adapter
import android.content.Intent
import android.view.LayoutInflater
@@ -11,7 +11,8 @@ import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.model.anime.TopAnime
+import xyz.adjutor.aniki.presentation.model.TopAnime
+import xyz.adjutor.aniki.presentation.view.activity.DetailTopAnimeActivity
class TopAnimeAdapter(private val animeList: List<TopAnime>) :
RecyclerView.Adapter<TopAnimeAdapter.AnimeViewHolder>() {
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/TopMangaAdapter.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/TopMangaAdapter.kt
index 5ab1713..dc4380d 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/TopMangaAdapter.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/adapter/TopMangaAdapter.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.manga
+package xyz.adjutor.aniki.presentation.view.adapter
import android.content.Intent
import android.view.LayoutInflater
@@ -11,7 +11,8 @@ import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.model.manga.TopManga
+import xyz.adjutor.aniki.presentation.model.TopManga
+import xyz.adjutor.aniki.presentation.view.activity.DetailTopMangaActivity
class TopMangaAdapter(private val mangaList: List<TopManga>) :
RecyclerView.Adapter<TopMangaAdapter.MangaViewHolder>() {
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/HomePage.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/HomePage.kt
index f2abca1..d8d271c 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/HomePage.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/HomePage.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view
+package xyz.adjutor.aniki.presentation.view.fragment
import android.os.Bundle
import android.view.LayoutInflater
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/SearchAnimePage.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/SearchAnimeFragment.kt
index 764601f..29b6c53 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/SearchAnimePage.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/SearchAnimeFragment.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.anime
+package xyz.adjutor.aniki.presentation.view.fragment
import android.content.Context
import android.os.Bundle
@@ -16,11 +16,13 @@ import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.snackbar.Snackbar
import com.google.android.material.textfield.TextInputEditText
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.controller.anime.SearchAnimeController
-import xyz.adjutor.aniki.presentation.model.anime.SearchAnime
-import xyz.adjutor.aniki.presentation.view.MainActivity
+import xyz.adjutor.aniki.presentation.controller.SearchAnimeController
+import xyz.adjutor.aniki.presentation.model.SearchAnime
+import xyz.adjutor.aniki.presentation.view.activity.MainActivity
+import xyz.adjutor.aniki.presentation.view.adapter.SearchAnimeAdapter
-class SearchAnimePage : Fragment() {
+
+class SearchAnimeFragment : Fragment() {
lateinit var controller: SearchAnimeController
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/SearchMangaPage.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/SearchMangaFragment.kt
index b6ae2bb..4ad6e89 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/SearchMangaPage.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/SearchMangaFragment.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.manga
+package xyz.adjutor.aniki.presentation.view.fragment
import android.content.Context
import android.os.Bundle
@@ -16,12 +16,13 @@ import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.snackbar.Snackbar
import com.google.android.material.textfield.TextInputEditText
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.controller.manga.SearchMangaController
-import xyz.adjutor.aniki.presentation.model.manga.SearchManga
-import xyz.adjutor.aniki.presentation.view.MainActivity
+import xyz.adjutor.aniki.presentation.controller.SearchMangaController
+import xyz.adjutor.aniki.presentation.model.SearchManga
+import xyz.adjutor.aniki.presentation.view.activity.MainActivity
+import xyz.adjutor.aniki.presentation.view.adapter.SearchMangaAdapter
-class SearchMangaPage : Fragment() {
+class SearchMangaFragment : Fragment() {
lateinit var controller: SearchMangaController
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/TopAnimePage.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/TopAnimeFragment.kt
index 5453154..56f7a49 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/anime/TopAnimePage.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/TopAnimeFragment.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.anime
+package xyz.adjutor.aniki.presentation.view.fragment
import android.os.Bundle
import android.view.LayoutInflater
@@ -12,11 +12,12 @@ import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.google.android.material.snackbar.Snackbar
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.controller.anime.TopAnimeController
-import xyz.adjutor.aniki.presentation.model.anime.TopAnime
+import xyz.adjutor.aniki.presentation.controller.TopAnimeController
+import xyz.adjutor.aniki.presentation.model.TopAnime
+import xyz.adjutor.aniki.presentation.view.adapter.TopAnimeAdapter
//view
-class TopAnimePage : Fragment() {
+class TopAnimeFragment : Fragment() {
lateinit var controller: TopAnimeController
diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/TopMangaPage.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/TopMangaFragment.kt
index 98eb0dd..7821e50 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/TopMangaPage.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/fragment/TopMangaFragment.kt
@@ -1,4 +1,4 @@
-package xyz.adjutor.aniki.presentation.view.manga
+package xyz.adjutor.aniki.presentation.view.fragment
import android.os.Bundle
import android.view.LayoutInflater
@@ -12,11 +12,12 @@ import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.google.android.material.snackbar.Snackbar
import xyz.adjutor.aniki.R
-import xyz.adjutor.aniki.presentation.controller.manga.TopMangaController
-import xyz.adjutor.aniki.presentation.model.manga.TopManga
+import xyz.adjutor.aniki.presentation.controller.TopMangaController
+import xyz.adjutor.aniki.presentation.model.TopManga
+import xyz.adjutor.aniki.presentation.view.adapter.TopMangaAdapter
//view
-class TopMangaPage : Fragment() {
+class TopMangaFragment : Fragment() {
lateinit var controller: TopMangaController