aboutsummaryrefslogtreecommitdiff
path: root/app
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
parent41bb476749fa84164726b728676b144531009446 (diff)
parentfa849021bf137fc4b245a8c0e7a2a8fc46d574df (diff)
Merge branch 'release/1.0' into develop
Diffstat (limited to 'app')
-rw-r--r--app/build.gradle8
-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
-rw-r--r--app/src/main/res/layout/activity_main.xml9
-rw-r--r--app/src/main/res/layout/article_page.xml29
-rw-r--r--app/src/main/res/layout/home_page.xml26
-rw-r--r--app/src/main/res/layout/news_page.xml29
12 files changed, 16 insertions, 174 deletions
diff --git a/app/build.gradle b/app/build.gradle
index 79284ac..4a23638 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -51,4 +51,12 @@ dependencies {
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
+ // Required for local unit tests (JUnit 4 framework)
+ testImplementation 'junit:junit:4.13.2'
+
+ // Required for instrumented tests
+ androidTestImplementation 'com.android.support:support-annotations:28.0.0'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+
+
} \ No newline at end of file
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) {
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 12a61d8..dd69e51 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -23,13 +23,4 @@
<include layout="@layout/content_main" />
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/info"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_margin="@dimen/fab_margin"
- app:srcCompat="@android:drawable/ic_dialog_info"
- android:contentDescription="@string/info"/>
-
</androidx.coordinatorlayout.widget.CoordinatorLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/article_page.xml b/app/src/main/res/layout/article_page.xml
deleted file mode 100644
index 380ba00..0000000
--- a/app/src/main/res/layout/article_page.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context=".ArticlePage"
- android:background="@color/very_dark_purple"
- >
-
- <TextView
- android:id="@+id/textview_second"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- app:layout_constraintBottom_toTopOf="@id/button_home"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
-
- <Button
- android:id="@+id/button_home"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/home"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/textview_second" />
-</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/home_page.xml b/app/src/main/res/layout/home_page.xml
index 036800c..68d9f81 100644
--- a/app/src/main/res/layout/home_page.xml
+++ b/app/src/main/res/layout/home_page.xml
@@ -18,40 +18,18 @@
android:textAlignment="center"
android:textColor="@color/strong_pink"
android:textSize="40sp"
- app:layout_constraintBottom_toTopOf="@id/button_news"
+ app:layout_constraintBottom_toBottomOf="@id/button_top_manga"
app:layout_constraintTop_toTopOf="parent"
/>
<Button
- android:id="@+id/button_news"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/news"
- app:layout_constraintTop_toBottomOf="@id/tv_title"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toStartOf="@id/button_article"
- />
-
- <Button
- android:id="@+id/button_article"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/article"
- app:layout_constraintTop_toBottomOf="@id/tv_title"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@id/button_news"
- app:layout_constraintEnd_toStartOf="@id/button_top_manga"
- />
-
- <Button
android:id="@+id/button_top_manga"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/top_manga"
app:layout_constraintTop_toBottomOf="@id/tv_title"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@id/button_article"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>
diff --git a/app/src/main/res/layout/news_page.xml b/app/src/main/res/layout/news_page.xml
deleted file mode 100644
index 2e41ad0..0000000
--- a/app/src/main/res/layout/news_page.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context=".NewsPage"
- android:background="@color/very_dark_purple"
- >
-
- <TextView
- android:id="@+id/textview_second"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- app:layout_constraintBottom_toTopOf="@id/button_home"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
-
- <Button
- android:id="@+id/button_home"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/home"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@id/textview_second" />
-</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file