diff options
author | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-02-12 11:00:47 +0100 |
---|---|---|
committer | Clyhtsuriva <aimeric@adjutor.xyz> | 2021-02-12 11:00:47 +0100 |
commit | 3decfd9d0d043c710f48cc145027a7b6bd45df8f (patch) | |
tree | 1c9a83333062654fc2477fca074a6e84b664a9fd /app/src/main/java/xyz/adjutor/aniki | |
parent | b96bca561c321fb259895d470b2d01d9c0f34ea9 (diff) |
Renaming and adding some functions for the home buttons.
Diffstat (limited to 'app/src/main/java/xyz/adjutor/aniki')
-rw-r--r-- | app/src/main/java/xyz/adjutor/aniki/FirstFragment.kt | 11 | ||||
-rw-r--r-- | app/src/main/java/xyz/adjutor/aniki/MainActivity.kt | 6 | ||||
-rw-r--r-- | app/src/main/java/xyz/adjutor/aniki/SecondFragment.kt | 3 |
3 files changed, 14 insertions, 6 deletions
diff --git a/app/src/main/java/xyz/adjutor/aniki/FirstFragment.kt b/app/src/main/java/xyz/adjutor/aniki/FirstFragment.kt index 05e5673..e2fa6eb 100644 --- a/app/src/main/java/xyz/adjutor/aniki/FirstFragment.kt +++ b/app/src/main/java/xyz/adjutor/aniki/FirstFragment.kt @@ -7,6 +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. @@ -24,8 +25,16 @@ class FirstFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - view.findViewById<Button>(R.id.button_first).setOnClickListener { + view.findViewById<Button>(R.id.news).setOnClickListener { findNavController().navigate(R.id.action_FirstFragment_to_SecondFragment) } + 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) + .setAction("Action", null).show() + } + view.findViewById<Button>(R.id.top_manga).setOnClickListener { + Snackbar.make(view, "HA? YOU THOUGHT IT WAS A TOP !? BUT IT WAS I, DIO !", Snackbar.LENGTH_LONG) + .setAction("Action", null).show() + } } }
\ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/MainActivity.kt b/app/src/main/java/xyz/adjutor/aniki/MainActivity.kt index 162ed95..4ccae64 100644 --- a/app/src/main/java/xyz/adjutor/aniki/MainActivity.kt +++ b/app/src/main/java/xyz/adjutor/aniki/MainActivity.kt @@ -14,12 +14,10 @@ class MainActivity : AppCompatActivity() { setContentView(R.layout.activity_main) setSupportActionBar(findViewById(R.id.toolbar)) - findViewById<FloatingActionButton>(R.id.fab).setOnClickListener { view -> - Snackbar.make(view, "HA? YOU THOUGHT IT WAS A FEATURE !? BUT IT WAS I, DIO !", Snackbar.LENGTH_LONG) + 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() } - 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.") - } override fun onCreateOptionsMenu(menu: Menu): Boolean { diff --git a/app/src/main/java/xyz/adjutor/aniki/SecondFragment.kt b/app/src/main/java/xyz/adjutor/aniki/SecondFragment.kt index a994c61..2e215c4 100644 --- a/app/src/main/java/xyz/adjutor/aniki/SecondFragment.kt +++ b/app/src/main/java/xyz/adjutor/aniki/SecondFragment.kt @@ -24,8 +24,9 @@ class SecondFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - view.findViewById<Button>(R.id.button_second).setOnClickListener { + view.findViewById<Button>(R.id.home).setOnClickListener { findNavController().navigate(R.id.action_SecondFragment_to_FirstFragment) } + 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 |