Skip to content

Commit

Permalink
[#44] 깃 충돌 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ayz1070 committed Apr 17, 2024
1 parent 288be59 commit cfc2445
Show file tree
Hide file tree
Showing 21 changed files with 602 additions and 251 deletions.
3 changes: 3 additions & 0 deletions MungNolZa/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ android {
jvmTarget = "1.8"
}


viewBinding {
enable = true
}

buildFeatures{
dataBinding = true
}


}

dependencies {
Expand Down
10 changes: 9 additions & 1 deletion MungNolZa/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@
tools:targetApi="31">
<activity


android:name=".ui.freeboard.AddBoardActivity"
android:exported="false" />

<activity
android:name=".ui.reservation_list.PetsitterReviewWriteActivity"
android:exported="true" />
<activity
android:name=".ui.petsitter_main.PetsitterMainActivity"
android:exported="true" />

<activity
android:name=".ui.appointment.NoPetActivity"
android:exported="true" />
Expand Down Expand Up @@ -64,7 +73,6 @@
</intent-filter>
</activity>
<activity

android:name=".ui.intro.activity.JoinActivity"
android:exported="true" />
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ class ShowDetailBoardFragment : Fragment() {

var imagePathList = mutableListOf<String>()



override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?,
Expand All @@ -71,10 +69,12 @@ class ShowDetailBoardFragment : Fragment() {

lifecycleScope.launch {
initData()

}

applyUserData()


return binding.root
}

Expand Down Expand Up @@ -115,7 +115,6 @@ class ShowDetailBoardFragment : Fragment() {
imgUri = userRepository.fetchUserProfileImage(userData?.userProfileImgPath!!)!!
Log.d("프로필 이미지 uri","${imgUri}")


}
job1.join()

Expand Down Expand Up @@ -144,9 +143,9 @@ class ShowDetailBoardFragment : Fragment() {


lifecycleScope.launch {
delay(1000)

Log.d("이미지 Uri 리스트 Glide 이전",imgUri.toString())
Glide.with(requireContext())
Glide.with(this@ShowDetailBoardFragment)
.load(imgUri)
.error(R.drawable.eunwoo)
.into(binding.imageViewProfileShowDetailBoard)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

initView()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ class HomeFragment : Fragment(), View.OnClickListener {
private val binding get() = _binding!!
private val viewModel: MainViewModel by activityViewModels { MainViewModelFactory() }
private var myPet: List<PetImgModel>? = null
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
_binding = FragmentHomeBinding.inflate(inflater, container, false)
initView()
return binding.root
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package kr.co.lion.mungnolza.ui.petsitter_main

import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.NavigationUI
import kr.co.lion.mungnolza.R
import kr.co.lion.mungnolza.databinding.ActivityPetsitterMainBinding
import kr.co.lion.mungnolza.model.PetImgModel

class PetsitterMainActivity : AppCompatActivity() {

private lateinit var activityPetsitterMainBinding: ActivityPetsitterMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

activityPetsitterMainBinding = ActivityPetsitterMainBinding.inflate(layoutInflater)
setContentView(activityPetsitterMainBinding.root)

initView()
}

private fun initView(){
val navHostFragment = supportFragmentManager.findFragmentById(R.id.fragment_container_petsitter) as NavHostFragment
val navController = navHostFragment.navController
NavigationUI.setupWithNavController(activityPetsitterMainBinding.navigationView, navController)

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package kr.co.lion.mungnolza.ui.petsitter_main.fragment

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import kr.co.lion.mungnolza.R
import kr.co.lion.mungnolza.databinding.FragmentPetsitterFreeBoardBinding

class PetsitterFreeBoardFragment : Fragment() {

lateinit var fragmentPetsitterFreeBoardBinding: FragmentPetsitterFreeBoardBinding

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
// Inflate the layout for this fragment
fragmentPetsitterFreeBoardBinding = FragmentPetsitterFreeBoardBinding.inflate(inflater, container, false)

return fragmentPetsitterFreeBoardBinding.root
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package kr.co.lion.mungnolza.ui.petsitter_main.fragment

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.divider.MaterialDividerItemDecoration
import kr.co.lion.mungnolza.R
import kr.co.lion.mungnolza.databinding.FragmentPetsitterHomeBinding
import kr.co.lion.mungnolza.databinding.RowPetsitterHomeChatPersonListBinding

class PetsitterHomeFragment : Fragment() {

lateinit var fragmentPetsitterHomeBinding : FragmentPetsitterHomeBinding

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
// Inflate the layout for this fragment
fragmentPetsitterHomeBinding = FragmentPetsitterHomeBinding.inflate(inflater, container, false)

return fragmentPetsitterHomeBinding.root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setRecyclerView()
}

// RecyclerView 설정
fun setRecyclerView(){
fragmentPetsitterHomeBinding.apply {
recyclerViewPetsitterHomeChatList.apply {
// 어뎁터 설정
adapter = RecyclerMainAdapter()
// 레이아웃
layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
// 데코
//val deco = MaterialDividerItemDecoration(requireContext(), MaterialDividerItemDecoration.HORIZONTAL)
//addItemDecoration(deco)
}
}
}

// RecyclerView의 어뎁터
inner class RecyclerMainAdapter : RecyclerView.Adapter<RecyclerMainAdapter.RecyclerMainViewHolder>(){
inner class RecyclerMainViewHolder(rowPetsitterHomeChatPersonListBinding: RowPetsitterHomeChatPersonListBinding) : RecyclerView.ViewHolder(rowPetsitterHomeChatPersonListBinding.root){
val rowPetsitterHomeChatPersonListBinding : RowPetsitterHomeChatPersonListBinding

init {
this.rowPetsitterHomeChatPersonListBinding = rowPetsitterHomeChatPersonListBinding
this.rowPetsitterHomeChatPersonListBinding.root.layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
}
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerMainViewHolder {
val rowPetsitterHomeChatPersonListBinding = RowPetsitterHomeChatPersonListBinding.inflate(layoutInflater, parent, false)
val recyclerMainViewHolder = RecyclerMainViewHolder(rowPetsitterHomeChatPersonListBinding)

return recyclerMainViewHolder
}

override fun getItemCount(): Int {
return 10
}

override fun onBindViewHolder(holder: RecyclerMainViewHolder, position: Int) {
holder.rowPetsitterHomeChatPersonListBinding.imageViewRowPetsitterHomeChatListPerson.setImageResource(R.drawable.eunwoo)
holder.rowPetsitterHomeChatPersonListBinding.textViewRowPetsitterHomeChatListPersonName.text = "영준"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package kr.co.lion.mungnolza.ui.reservation_list.fragment
package kr.co.lion.mungnolza.ui.reservation_list

import android.content.DialogInterface
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kr.co.lion.mungnolza.ui.reservation_list.ReservationListActivity
import kr.co.lion.mungnolza.R
import kr.co.lion.mungnolza.databinding.FragmentPetSitterReviewWriteBinding

import kr.co.lion.mungnolza.databinding.ActivityPetsitterReviewWriteBinding
import kr.co.lion.mungnolza.ext.hideSoftInput
import kr.co.lion.mungnolza.ext.showErrorDialog
import kr.co.lion.mungnolza.model.PetsitterReviewModel

import kr.co.lion.mungnolza.ui.reservation_list.viewmodel.PetSitterReviewWriteViewModel
import kr.co.lion.mungnolza.util.ReservationListFragmentName
import java.text.SimpleDateFormat
Expand All @@ -24,53 +24,34 @@ import kr.co.lion.mungnolza.ext.hideSoftInput
import kr.co.lion.mungnolza.ext.showErrorDialog
import kr.co.lion.mungnolza.repository.PetsitterReviewRepository

class PetSitterReviewWriteFragment : Fragment() {
class PetsitterReviewWriteActivity : AppCompatActivity() {

lateinit var fragmentPetSitterReviewWriteBinding: FragmentPetSitterReviewWriteBinding
lateinit var reservationListActivity: ReservationListActivity
lateinit var activityPetsitterReviewWriteBinding: ActivityPetsitterReviewWriteBinding

lateinit var petSitterReviewWriteViewModel : PetSitterReviewWriteViewModel

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
// Inflate the layout for this fragment
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

fragmentPetSitterReviewWriteBinding = FragmentPetSitterReviewWriteBinding.inflate(layoutInflater)
reservationListActivity = activity as ReservationListActivity
activityPetsitterReviewWriteBinding = ActivityPetsitterReviewWriteBinding.inflate(layoutInflater)
setContentView(activityPetsitterReviewWriteBinding.root)

// ViewModel 객체를 생성한다.
petSitterReviewWriteViewModel = PetSitterReviewWriteViewModel()
// 생성한 ViewModel 객체를 layout 파일에 설정해준다.
fragmentPetSitterReviewWriteBinding.petSitterReviewWriteViewModel = petSitterReviewWriteViewModel
activityPetsitterReviewWriteBinding.petSitterReviewWriteViewModel = petSitterReviewWriteViewModel
// ViewModel의 생명주기를 Fragment와 일치시킨다. Fragment가 살아 있을 때 ViewModel 객체도 살아 있게끔 해준다.
fragmentPetSitterReviewWriteBinding.lifecycleOwner = this
activityPetsitterReviewWriteBinding.lifecycleOwner = this


setToolbar()
setButtonDone()
setTextField()
initData()

return fragmentPetSitterReviewWriteBinding.root
}

// 툴바 설정
fun setToolbar(){
fragmentPetSitterReviewWriteBinding.apply {
toolbarPetSitterReviewWrite.apply {
// 뒤로가기
setNavigationIcon(R.drawable.ic_arrow_back_24px)
setNavigationOnClickListener {
// PetSitterReviewWriteFragment를 사라지게 한다.
reservationListActivity.removeFragment(ReservationListFragmentName.PETSITTER_REVIEW_WRITE_FRAGMENT)
}
}
}
}

// 작성 완료 버튼 (이벤트 설정)
fun setButtonDone(){
// buttonPetsitterReviewWriteDone 작성완료 버튼 설정
fragmentPetSitterReviewWriteBinding.apply {
activityPetsitterReviewWriteBinding.apply {
buttonPetsitterReviewWriteDone.apply {
// 버튼을 눌럿을 때
setOnClickListener {
Expand All @@ -84,10 +65,10 @@ class PetSitterReviewWriteFragment : Fragment() {
savePetsitterReviewData()

// 키보드를 내려준다
context.hideSoftInput(reservationListActivity)
context.hideSoftInput(this@PetsitterReviewWriteActivity)

// 작성완료 다이어로그를 띄운다
val materialAlertDialogBuilder = MaterialAlertDialogBuilder(reservationListActivity)
val materialAlertDialogBuilder = MaterialAlertDialogBuilder(this@PetsitterReviewWriteActivity)
materialAlertDialogBuilder.setTitle("작성 완료")
materialAlertDialogBuilder.setMessage("후기 작성이 완료되었습니다 !")
materialAlertDialogBuilder.setPositiveButton("확인"){ dialogInterface: DialogInterface, i: Int ->
Expand All @@ -101,7 +82,7 @@ class PetSitterReviewWriteFragment : Fragment() {
}

// 데잍
fun savePetsitterReviewData() {
fun savePetsitterReviewData() {
CoroutineScope(Dispatchers.Main).launch {
// 펫시터 후기 번호 시퀀스 값을 가져온다.
val reviewIdxSequence = PetsitterReviewRepository.getReviewIdx()
Expand Down Expand Up @@ -136,15 +117,15 @@ class PetSitterReviewWriteFragment : Fragment() {
// 별점수를 입력하지 않았다면
if(starCount == 0f){
// 다이어로그 띄워준다
showErrorDialog(reservationListActivity, fragmentPetSitterReviewWriteBinding.ratingBar2, "별점 입력 오류", "펫시터에게 별점을 남겨주세요.")
showErrorDialog(this@PetsitterReviewWriteActivity, activityPetsitterReviewWriteBinding.ratingBar2, "별점 입력 오류", "펫시터에게 별점을 남겨주세요.")
return false
}

// 후기 내용을 입력하지 않았다면
if(reviewText.isEmpty()){
// 다이어로그 띄워준다
// 다이어로그의 확인 클릭시, 뷰에 포커스를 주고 키보드를 올린다.
showErrorDialog(reservationListActivity, fragmentPetSitterReviewWriteBinding.textfieldPetsitterReviewWrite, "후기 작성 오류", "펫시터에게 후기를 작성해주세요.")
showErrorDialog(this@PetsitterReviewWriteActivity, activityPetsitterReviewWriteBinding.textfieldPetsitterReviewWrite, "후기 작성 오류", "펫시터에게 후기를 작성해주세요.")
return false
}
return true
Expand All @@ -157,14 +138,16 @@ class PetSitterReviewWriteFragment : Fragment() {
petSitterReviewWriteViewModel.textfieldPetsitterReviewWrite.value = ""
}


// 임시 가짜 데이터 셋팅
fun initData(){
fragmentPetSitterReviewWriteBinding.apply {
activityPetsitterReviewWriteBinding.apply {
imageViewPetSitterReviewWrite.setImageResource(R.drawable.petsitter)
textViewPetSitterReviewWriteName.setText("이영주 펫시터")
textViewPetSitterReviewWriteScore.setText("5점")
ratingBarPetSitterReviewWrite.rating = 5f
textViewPetSitterReviewWriteCountReview.setText("89개의 후기")
}
}

}
Loading

0 comments on commit cfc2445

Please sign in to comment.