summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorClyhtsuriva <aimeric@adjutor.xyz>2021-02-19 14:17:15 +0100
committerClyhtsuriva <aimeric@adjutor.xyz>2021-02-19 14:17:15 +0100
commitcd37b807397b50b8e9c45389fc04679998e628db (patch)
tree1d4e58436f7d88c82b588c86fe99fce74ea09de3 /app/src/main/java
parent41bb476749fa84164726b728676b144531009446 (diff)
parentfa849021bf137fc4b245a8c0e7a2a8fc46d574df (diff)
Merge branch 'release/1.0' into develop
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/ArticlePage.kt31
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/HomePage.kt11
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/MainActivity.kt6
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/NewsPage.kt32
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/TopManga.kt1
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/TopMangaAdapter.kt (renamed from app/src/main/java/xyz/adjutor/aniki/MangaAdapter.kt)4
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/TopMangaPage.kt4
7 files changed, 6 insertions, 83 deletions
diff --git a/app/src/main/java/xyz/adjutor/aniki/ArticlePage.kt b/app/src/main/java/xyz/adjutor/aniki/ArticlePage.kt
deleted file mode 100644
index 4579c69..0000000
--- a/app/src/main/java/xyz/adjutor/aniki/ArticlePage.kt
+++ /dev/null
@@ -1,31 +0,0 @@
-package xyz.adjutor.aniki
-
-import android.os.Bundle
-import androidx.fragment.app.Fragment
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.Button
-import androidx.navigation.fragment.findNavController
-
-/**
- * A simple [Fragment] subclass as the second destination in the navigation.
- */
-class ArticlePage : Fragment() {
-
- override fun onCreateView(
- inflater: LayoutInflater, container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View? {
- // Inflate the layout for this fragment
- return inflater.inflate(R.layout.article_page, container, false)
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
-
- view.findViewById<Button>(R.id.button_home).setOnClickListener {
- findNavController().navigate(R.id.action_ArticlePage_to_HomePage)
- }
- }
-} \ No newline at end of file
diff --git a/app/src/main/java/xyz/adjutor/aniki/HomePage.kt b/app/src/main/java/xyz/adjutor/aniki/HomePage.kt
index d252755..b6d45c3 100644
--- a/app/src/main/java/xyz/adjutor/aniki/HomePage.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/HomePage.kt
@@ -7,11 +7,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.navigation.fragment.findNavController
-import com.google.android.material.snackbar.Snackbar
-/**
- * A simple [Fragment] subclass as the default destination in the navigation.
- */
class HomePage : Fragment() {
override fun onCreateView(
@@ -24,13 +20,6 @@ class HomePage : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
-
- view.findViewById<Button>(R.id.button_news).setOnClickListener {
- findNavController().navigate(R.id.action_HomePage_to_NewsPage)
- }
- view.findViewById<Button>(R.id.button_article).setOnClickListener {
- findNavController().navigate(R.id.action_HomePage_to_ArticlePage)
- }
view.findViewById<Button>(R.id.button_top_manga).setOnClickListener {
findNavController().navigate(R.id.action_HomePage_to_TopMangaPage)
}
diff --git a/app/src/main/java/xyz/adjutor/aniki/MainActivity.kt b/app/src/main/java/xyz/adjutor/aniki/MainActivity.kt
index 3ae1bf2..50cd24f 100644
--- a/app/src/main/java/xyz/adjutor/aniki/MainActivity.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/MainActivity.kt
@@ -6,7 +6,6 @@ import com.google.android.material.snackbar.Snackbar
import androidx.appcompat.app.AppCompatActivity
import android.view.Menu
import android.view.MenuItem
-import androidx.recyclerview.widget.RecyclerView
class MainActivity : AppCompatActivity() {
@@ -14,11 +13,6 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
setSupportActionBar(findViewById(R.id.toolbar))
-
- findViewById<FloatingActionButton>(R.id.info).setOnClickListener { view ->
- Snackbar.make(view, "HA? YOU THOUGHT IT WAS AN INFO !? BUT IT WAS I, DIO !", Snackbar.LENGTH_LONG)
- .setAction("Action", null).show()
- }
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
diff --git a/app/src/main/java/xyz/adjutor/aniki/NewsPage.kt b/app/src/main/java/xyz/adjutor/aniki/NewsPage.kt
deleted file mode 100644
index 90be1bd..0000000
--- a/app/src/main/java/xyz/adjutor/aniki/NewsPage.kt
+++ /dev/null
@@ -1,32 +0,0 @@
-package xyz.adjutor.aniki
-
-import android.os.Bundle
-import androidx.fragment.app.Fragment
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.Button
-import androidx.navigation.fragment.findNavController
-
-/**
- * A simple [Fragment] subclass as the second destination in the navigation.
- */
-class NewsPage : Fragment() {
-
- override fun onCreateView(
- inflater: LayoutInflater, container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View? {
- // Inflate the layout for this fragment
- return inflater.inflate(R.layout.news_page, container, false)
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
-
- view.findViewById<Button>(R.id.button_home).setOnClickListener {
- findNavController().navigate(R.id.action_NewsPage_to_HomePage)
- }
- //val industryNews = News(0,"Horror Manga Ajin Ends Nine-Year Serialization","Gamon Sakurai's Ajin (Ajin: Demi-Human) manga ended its nine-year run in the March issue of good! Afternoon on Friday.")
- }
-} \ No newline at end of file
diff --git a/app/src/main/java/xyz/adjutor/aniki/TopManga.kt b/app/src/main/java/xyz/adjutor/aniki/TopManga.kt
index acedf56..9cba192 100644
--- a/app/src/main/java/xyz/adjutor/aniki/TopManga.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/TopManga.kt
@@ -2,6 +2,7 @@ package xyz.adjutor.aniki
import com.google.gson.annotations.SerializedName
+//Content of the top field from the api of top manga
class TopManga{
@SerializedName("mal_id")
diff --git a/app/src/main/java/xyz/adjutor/aniki/MangaAdapter.kt b/app/src/main/java/xyz/adjutor/aniki/TopMangaAdapter.kt
index 3116062..1478111 100644
--- a/app/src/main/java/xyz/adjutor/aniki/MangaAdapter.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/TopMangaAdapter.kt
@@ -14,8 +14,8 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
-class MangaAdapter(val mangaList: List<TopManga>) :
- RecyclerView.Adapter<MangaAdapter.MangaViewHolder>() {
+class TopMangaAdapter(val mangaList: List<TopManga>) :
+ RecyclerView.Adapter<TopMangaAdapter.MangaViewHolder>() {
// Describes an item view and its place within the RecyclerView
class MangaViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
diff --git a/app/src/main/java/xyz/adjutor/aniki/TopMangaPage.kt b/app/src/main/java/xyz/adjutor/aniki/TopMangaPage.kt
index ee8a510..6606b6c 100644
--- a/app/src/main/java/xyz/adjutor/aniki/TopMangaPage.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/TopMangaPage.kt
@@ -34,17 +34,19 @@ class TopMangaPage : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
+ //button to return to the home page
view.findViewById<Button>(R.id.button_home).setOnClickListener {
findNavController().navigate(R.id.action_TopMangaPage_to_HomePage)
}
}
+ //display the recyclerview
fun showList(view: View, mangaList: List<TopManga> ){
val recyclerView: RecyclerView = view.findViewById(R.id.recycler_view)
recyclerView.setHasFixedSize(true)
recyclerView.layoutManager = LinearLayoutManager(view.context)
- recyclerView.adapter = MangaAdapter(mangaList)
+ recyclerView.adapter = TopMangaAdapter(mangaList)
}
fun makeApiCall(view: View, BASE_URL: String) {