aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorClyhtsuriva <aimeric@adjutor.xyz>2021-04-13 13:34:34 +0200
committerClyhtsuriva <aimeric@adjutor.xyz>2021-04-13 13:34:34 +0200
commitd053033b3c74acdbd05ea5bc6549e87ff7ea008f (patch)
treed3389377b6235487cdb8280e8af640671c980cf1 /app/src/main
parent5a8c22508e08b00a31c8ebb4df13d9e108d29e1f (diff)
Moving the basic variables.
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/TopMangaPage.kt20
1 files changed, 15 insertions, 5 deletions
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/manga/TopMangaPage.kt
index edb5fea..943019d 100644
--- a/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/TopMangaPage.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/presentation/view/manga/TopMangaPage.kt
@@ -23,19 +23,21 @@ import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import xyz.adjutor.aniki.R
import xyz.adjutor.aniki.data.manga.TopMangaApi
+import xyz.adjutor.aniki.presentation.controller.TopMangaController
import xyz.adjutor.aniki.presentation.model.manga.TopManga
import xyz.adjutor.aniki.presentation.model.manga.TopMangaResponse
import java.lang.reflect.Type
+import kotlin.properties.Delegates
//view
class TopMangaPage : Fragment() {
+ lateinit var controller: TopMangaController
+
private lateinit var sharedPreferences: SharedPreferences
- val gson: Gson = GsonBuilder()
- .setLenient()
- .create()
- private var baseUrl = "https://api.jikan.moe/" //the api's base url
- var page: Int = 1
+ lateinit var gson: Gson
+ private lateinit var baseUrl: String //the api's base url
+ private var page by Delegates.notNull<Int>()
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
@@ -44,6 +46,14 @@ class TopMangaPage : Fragment() {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.top_manga_page, container, false)
+ //controller.onStart()
+
+ gson = GsonBuilder()
+ .setLenient()
+ .create()
+ baseUrl = "https://api.jikan.moe/" //the api's base url
+ page = 1
+
sharedPreferences = view.context.getSharedPreferences("sp_manga", Context.MODE_PRIVATE)
val mangaList: List<TopManga>? = getDataFromCache()