aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/xyz/adjutor/aniki
diff options
context:
space:
mode:
authorClyhtsuriva <aimeric@adjutor.xyz>2021-05-13 13:09:14 +0200
committerClyhtsuriva <aimeric@adjutor.xyz>2021-05-13 13:09:14 +0200
commit69d34a4e3844c148cf637a5135872bb09ef3d07a (patch)
tree43f569b5bd68749a9fa8a5d171ef505ddb9a8122 /app/src/main/java/xyz/adjutor/aniki
parented22cdefdc8db6e09c801369aaf3bd5ef9950c60 (diff)
Redefining how the controller is started.
Diffstat (limited to 'app/src/main/java/xyz/adjutor/aniki')
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/DetailTopMangaController.kt4
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/DetailTopMangaActivity.kt3
2 files changed, 2 insertions, 5 deletions
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/manga/DetailTopMangaController.kt
index 2d99a45..807421c 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/DetailTopMangaController.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/controller/manga/DetailTopMangaController.kt
@@ -22,7 +22,7 @@ class DetailTopMangaController {
private lateinit var baseUrl: String //the api's base url
lateinit var view: DetailTopMangaActivity
- fun onStart(DetailTopMangaActivity: DetailTopMangaActivity) {
+ fun onStart(DetailTopMangaActivity: DetailTopMangaActivity, mangaId: String) {
view = DetailTopMangaActivity
baseUrl = "https://api.jikan.moe/" //the api's base url
@@ -31,9 +31,7 @@ class DetailTopMangaController {
.create()
sharedPreferences =
view.applicationContext.getSharedPreferences("sp_manga", Context.MODE_PRIVATE)
- }
- fun launch(mangaId: String) {
val manga: MangaResponse? = getDataFromCache(mangaId)
if (manga != null) {
view.showDetail(manga)
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/manga/DetailTopMangaActivity.kt
index 74f7595..2a4b28b 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/DetailTopMangaActivity.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/DetailTopMangaActivity.kt
@@ -20,7 +20,6 @@ class DetailTopMangaActivity : AppCompatActivity() {
setContentView(R.layout.activity_detail_top_manga)
controller = DetailTopMangaController()
- controller.onStart(this)
//used in the list
val intentMangaTitle = "themangatitle"
@@ -85,7 +84,7 @@ class DetailTopMangaActivity : AppCompatActivity() {
tvUrl.text = mangaUrl
- controller.launch(mangaId.toString())
+ controller.onStart(this, mangaId.toString())
}