Skip to content

Commit

Permalink
[BUD-56] feat : buddy navigation 추가 부분 분리(#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
KDW03 committed Apr 11, 2023
1 parent 403a140 commit ece1d9f
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 33 deletions.
13 changes: 12 additions & 1 deletion .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ class InputBuddyTypeFragment : Fragment() {
// Inflate the layout for this fragment
_binding = FragmentInputBuddyTypeBinding.inflate(inflater, container, false)


(activity as MainActivityUtil).run {
setToolbarTitle("버디 추가")
setVisibilityBottomAppbar(View.GONE)
if (activity is MainActivityUtil){
(activity as MainActivityUtil).run {
setToolbarTitle("버디 추가")
setVisibilityBottomAppbar(View.GONE)
}
}


return binding.root

}
Expand Down
23 changes: 22 additions & 1 deletion buddy/src/main/res/navigation/nav_addbuddy.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/nav_addbuddy">
android:id="@+id/nav_addbuddy"
app:startDestination="@id/inputBuddyTypeFragment">

<fragment
android:id="@+id/inputBuddyInfoFragment"
android:name="com.nocapstone.buddyvet.buddy.ui.InputBuddyInfoFragment"
android:label="InputBuddyInfoFragment">
<action
android:id="@+id/next"
app:destination="@id/completeRegistrationFragment" />
</fragment>
<fragment
android:id="@+id/inputBuddyTypeFragment"
android:name="com.nocapstone.buddyvet.buddy.ui.InputBuddyTypeFragment"
android:label="InputBuddyTypeFragment">
<action
android:id="@+id/next"
app:destination="@id/inputBuddyInfoFragment" />
</fragment>
<fragment
android:id="@+id/completeRegistrationFragment"
android:name="com.nocapstone.buddyvet.buddy.ui.CompleteRegistrationFragment"
android:label="CompleteRegistrationFragment" />
</navigation>
27 changes: 4 additions & 23 deletions buddy/src/main/res/navigation/nav_buddy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,16 @@
android:id="@+id/nav_buddy"
app:startDestination="@id/myBuddyFragment">

<fragment
android:id="@+id/completeRegistrationFragment"
android:name="com.nocapstone.buddyvet.buddy.ui.CompleteRegistrationFragment"
android:label="CompleteRegistrationFragment" />
<fragment
android:id="@+id/inputBuddyTypeFragment"
android:name="com.nocapstone.buddyvet.buddy.ui.InputBuddyTypeFragment"
android:label="InputBuddyTypeFragment" >
<action
android:id="@+id/next"
app:destination="@id/inputBuddyInfoFragment" />
</fragment>
<fragment
android:id="@+id/inputBuddyInfoFragment"
android:name="com.nocapstone.buddyvet.buddy.ui.InputBuddyInfoFragment"
android:label="InputBuddyInfoFragment" >
<action
android:id="@+id/next"
app:destination="@id/completeRegistrationFragment" />
</fragment>
<fragment
android:id="@+id/myBuddyFragment"
android:name="com.nocapstone.buddyvet.buddy.ui.MyBuddyFragment"
android:label="MyBuddyFragment" >
<action
android:id="@+id/next"
app:destination="@id/inputBuddyTypeFragment" />
<action
android:id="@+id/putFragment"
app:destination="@id/putBuddyFragment" />
<action
android:id="@+id/next"
app:destination="@id/nav_addbuddy" />
</fragment>
<fragment
android:id="@+id/putBuddyFragment"
Expand All @@ -43,4 +23,5 @@
android:name="buddyId"
app:argType="long" />
</fragment>
<include app:graph="@navigation/nav_addbuddy" />
</navigation>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.nocapstone.common_ui

import androidx.fragment.app.Fragment

interface MainActivityUtil{
fun setToolbarTitle(newTitle: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class InputUserInfoFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.next.setOnClickListener {
splashViewModel.postUserInfo(binding.nameEt.toString()){
splashViewModel.postUserInfo(binding.nameEt.text.toString()){
findNavController().navigate(R.id.next)
}
}
Expand Down
4 changes: 2 additions & 2 deletions onboarding/src/main/res/navigation/nav_onboarding.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
android:label="InputUserInfoFragment" >
<action
android:id="@+id/next"
app:destination="@id/nav_buddy" />
app:destination="@id/nav_addbuddy" />
</fragment>
<include app:graph="@navigation/nav_buddy" />
<include app:graph="@navigation/nav_addbuddy" />
</navigation>

0 comments on commit ece1d9f

Please sign in to comment.