aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorClyhtsuriva <aimeric@adjutor.xyz>2021-02-12 11:26:07 +0100
committerClyhtsuriva <aimeric@adjutor.xyz>2021-02-12 11:26:07 +0100
commit416450b33960588984d88659d596703e84c8c2d5 (patch)
tree86775e66f9372fb2c557a086478cdddc1df12780 /app
parent3decfd9d0d043c710f48cc145027a7b6bd45df8f (diff)
Renaming.
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/HomePage.kt (renamed from app/src/main/java/xyz/adjutor/aniki/FirstFragment.kt)6
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/News.kt6
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/NewsPage.kt (renamed from app/src/main/java/xyz/adjutor/aniki/SecondFragment.kt)6
-rw-r--r--app/src/main/res/layout/home_page.xml (renamed from app/src/main/res/layout/fragment_first.xml)2
-rw-r--r--app/src/main/res/layout/news_page.xml (renamed from app/src/main/res/layout/fragment_second.xml)2
-rw-r--r--app/src/main/res/navigation/nav_graph.xml26
-rw-r--r--app/src/main/res/values/strings.xml5
7 files changed, 26 insertions, 27 deletions
diff --git a/app/src/main/java/xyz/adjutor/aniki/FirstFragment.kt b/app/src/main/java/xyz/adjutor/aniki/HomePage.kt
index e2fa6eb..377a523 100644
--- a/app/src/main/java/xyz/adjutor/aniki/FirstFragment.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/HomePage.kt
@@ -12,21 +12,21 @@ import com.google.android.material.snackbar.Snackbar
/**
* A simple [Fragment] subclass as the default destination in the navigation.
*/
-class FirstFragment : Fragment() {
+class HomePage : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
- return inflater.inflate(R.layout.fragment_first, container, false)
+ return inflater.inflate(R.layout.home_page, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
view.findViewById<Button>(R.id.news).setOnClickListener {
- findNavController().navigate(R.id.action_FirstFragment_to_SecondFragment)
+ findNavController().navigate(R.id.action_HomePage_to_NewsPage)
}
view.findViewById<Button>(R.id.article).setOnClickListener {
Snackbar.make(view, "HA? YOU THOUGHT IT WAS AN ARTICLE !? BUT IT WAS I, DIO !", Snackbar.LENGTH_LONG)
diff --git a/app/src/main/java/xyz/adjutor/aniki/News.kt b/app/src/main/java/xyz/adjutor/aniki/News.kt
index dea3516..d38a556 100644
--- a/app/src/main/java/xyz/adjutor/aniki/News.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/News.kt
@@ -1,7 +1,7 @@
package xyz.adjutor.aniki
data class News (
- val id: Int,
- val title: String,
- val description: String
+ val id: Int,
+ val title: String,
+ val description: String
) \ No newline at end of file
diff --git a/app/src/main/java/xyz/adjutor/aniki/SecondFragment.kt b/app/src/main/java/xyz/adjutor/aniki/NewsPage.kt
index 2e215c4..88427fa 100644
--- a/app/src/main/java/xyz/adjutor/aniki/SecondFragment.kt
+++ b/app/src/main/java/xyz/adjutor/aniki/NewsPage.kt
@@ -11,21 +11,21 @@ import androidx.navigation.fragment.findNavController
/**
* A simple [Fragment] subclass as the second destination in the navigation.
*/
-class SecondFragment : Fragment() {
+class NewsPage : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
- return inflater.inflate(R.layout.fragment_second, container, false)
+ 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.home).setOnClickListener {
- findNavController().navigate(R.id.action_SecondFragment_to_FirstFragment)
+ 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.")
}
diff --git a/app/src/main/res/layout/fragment_first.xml b/app/src/main/res/layout/home_page.xml
index 46033be..bf81de4 100644
--- a/app/src/main/res/layout/fragment_first.xml
+++ b/app/src/main/res/layout/home_page.xml
@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- tools:context=".FirstFragment"
+ tools:context=".HomePage"
android:background="@color/very_dark_purple"
>
diff --git a/app/src/main/res/layout/fragment_second.xml b/app/src/main/res/layout/news_page.xml
index daabf01..5d9018c 100644
--- a/app/src/main/res/layout/fragment_second.xml
+++ b/app/src/main/res/layout/news_page.xml
@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- tools:context=".SecondFragment"
+ tools:context=".NewsPage"
android:background="@color/very_dark_purple"
>
diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml
index 5441348..78eb7f0 100644
--- a/app/src/main/res/navigation/nav_graph.xml
+++ b/app/src/main/res/navigation/nav_graph.xml
@@ -3,26 +3,26 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
- app:startDestination="@id/FirstFragment">
+ app:startDestination="@id/HomePage">
<fragment
- android:id="@+id/FirstFragment"
- android:name="xyz.adjutor.aniki.FirstFragment"
- android:label="@string/first_fragment_label"
- tools:layout="@layout/fragment_first">
+ android:id="@+id/HomePage"
+ android:name="xyz.adjutor.aniki.HomePage"
+ android:label="@string/home_page_label"
+ tools:layout="@layout/home_page">
<action
- android:id="@+id/action_FirstFragment_to_SecondFragment"
- app:destination="@id/SecondFragment" />
+ android:id="@+id/action_HomePage_to_NewsPage"
+ app:destination="@id/NewsPage" />
</fragment>
<fragment
- android:id="@+id/SecondFragment"
- android:name="xyz.adjutor.aniki.SecondFragment"
- android:label="@string/second_fragment_label"
- tools:layout="@layout/fragment_second">
+ android:id="@+id/NewsPage"
+ android:name="xyz.adjutor.aniki.NewsPage"
+ android:label="@string/news_page_label"
+ tools:layout="@layout/news_page">
<action
- android:id="@+id/action_SecondFragment_to_FirstFragment"
- app:destination="@id/FirstFragment" />
+ android:id="@+id/action_NewsPage_to_HomePage"
+ app:destination="@id/HomePage" />
</fragment>
</navigation> \ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 3eed9c6..b0be6b2 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -2,14 +2,13 @@
<string name="app_name">Aniki</string>
<string name="action_settings">Settings</string>
<!-- Strings used for fragments for navigation -->
- <string name="first_fragment_label">First Fragment</string>
- <string name="second_fragment_label">Second Fragment</string>
- <string name="hello_first_fragment">Oi Otouto !</string>
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
<string name="info">Infos about the developper of the app.</string>
<string name="news">News</string>
<string name="article">Article</string>
<string name="top_manga">Top Manga</string>
<string name="home">Home</string>
+ <string name="home_page_label">First Fragment</string>
+ <string name="news_page_label">Second Fragment</string>
</resources> \ No newline at end of file