From 143a65df1ba7b675823bd26ed65804f843c926ba Mon Sep 17 00:00:00 2001 From: heechokim Date: Sun, 17 Jul 2022 17:49:58 +0900 Subject: [PATCH] =?UTF-8?q?[#39]=20=EB=AA=A8=EC=97=AC=EB=9F=B0=20=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20UI=20=EA=B5=AC=ED=98=84=ED=95=98=EA=B8=B0=20-=20?= =?UTF-8?q?=EB=B0=A9=20=EC=83=9D=EC=84=B1=20=ED=99=94=EB=A9=B4=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99=20=EC=95=A1=EC=85=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 5 ++++- .../home/CreateRoomActivity.kt | 14 ++++++++++++++ .../moyeorun_android/home/HomeFragment.kt | 7 +++++++ .../main/res/layout/activity_create_room.xml | 18 ++++++++++++++++++ app/src/main/res/navigation/home_nav_graph.xml | 16 +++++++++++++--- 5 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 app/src/main/java/com/moyerun/moyeorun_android/home/CreateRoomActivity.kt create mode 100644 app/src/main/res/layout/activity_create_room.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 19ebc43..bda36ff 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ - + + \ No newline at end of file diff --git a/app/src/main/java/com/moyerun/moyeorun_android/home/CreateRoomActivity.kt b/app/src/main/java/com/moyerun/moyeorun_android/home/CreateRoomActivity.kt new file mode 100644 index 0000000..6d9ebad --- /dev/null +++ b/app/src/main/java/com/moyerun/moyeorun_android/home/CreateRoomActivity.kt @@ -0,0 +1,14 @@ +package com.moyerun.moyeorun_android.home + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import com.moyerun.moyeorun_android.R +import dagger.hilt.android.AndroidEntryPoint + +@AndroidEntryPoint +class CreateRoomActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_create_room) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/moyerun/moyeorun_android/home/HomeFragment.kt b/app/src/main/java/com/moyerun/moyeorun_android/home/HomeFragment.kt index d629776..78ac068 100644 --- a/app/src/main/java/com/moyerun/moyeorun_android/home/HomeFragment.kt +++ b/app/src/main/java/com/moyerun/moyeorun_android/home/HomeFragment.kt @@ -5,6 +5,8 @@ import android.view.LayoutInflater import androidx.fragment.app.Fragment import android.view.View import android.view.ViewGroup +import androidx.navigation.findNavController +import com.moyerun.moyeorun_android.common.extension.setOnDebounceClickListener import com.moyerun.moyeorun_android.databinding.FragmentHomeBinding import dagger.hilt.android.AndroidEntryPoint @@ -17,6 +19,11 @@ class HomeFragment : Fragment() { savedInstanceState: Bundle? ): View { val binding = FragmentHomeBinding.inflate(inflater, container, false) + binding.addButton.setOnDebounceClickListener { + val action = HomeFragmentDirections.actionHomeToCreateRoom() + it?.findNavController()?.navigate(action) + } + return binding.root } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_create_room.xml b/app/src/main/res/layout/activity_create_room.xml new file mode 100644 index 0000000..d89555a --- /dev/null +++ b/app/src/main/res/layout/activity_create_room.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/home_nav_graph.xml b/app/src/main/res/navigation/home_nav_graph.xml index 013db57..926d544 100644 --- a/app/src/main/res/navigation/home_nav_graph.xml +++ b/app/src/main/res/navigation/home_nav_graph.xml @@ -3,12 +3,22 @@ xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/home_nav_graph" - app:startDestination="@id/homeFragment"> + app:startDestination="@id/home_fragment"> + tools:layout="@layout/fragment_home"> + + + + +