Skip to content

Commit

Permalink
[#39] 모여런 메인 UI 구현하기
Browse files Browse the repository at this point in the history
- 방 생성 화면으로 이동 액션 추가
  • Loading branch information
heechokim committed Jul 17, 2022
1 parent 2afb815 commit 8349a5b
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 4 deletions.
5 changes: 4 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.moyerun.moyeorun_android">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".MoyeoRunApplication"
Expand All @@ -21,6 +21,9 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".home.CreateRoomActivity"
android:exported="false" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
}
}
18 changes: 18 additions & 0 deletions app/src/main/res/layout/activity_create_room.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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:id="@+id/create_room_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".home.CreateRoomActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="방 생성 화면"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
16 changes: 13 additions & 3 deletions app/src/main/res/navigation/home_nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

<fragment
android:id="@+id/homeFragment"
android:id="@+id/home_fragment"
android:name="com.moyerun.moyeorun_android.home.HomeFragment"
android:label="Home"
tools:layout="@layout/fragment_home" />
tools:layout="@layout/fragment_home">
<action
android:id="@+id/action_home_to_create_room"
app:destination="@id/create_room_activity" />

</fragment>

<activity
android:id="@+id/create_room_activity"
android:name="com.moyerun.moyeorun_android.home.CreateRoomActivity"
tools:layout="@layout/activity_create_room" />

</navigation>

0 comments on commit 8349a5b

Please sign in to comment.