From ac9efa000bc41a4ac8194b9c0a444ff3a8d2c27a Mon Sep 17 00:00:00 2001 From: cny1213 Date: Tue, 9 Apr 2024 16:53:28 +0900 Subject: [PATCH 1/7] =?UTF-8?q?[#21]=20commit=ED=95=98=EA=B3=A0=20checkout?= =?UTF-8?q?=ED=95=98=EA=B8=B0=20=EB=AA=85=EC=8B=AC,,,=20test=EC=9E=85?= =?UTF-8?q?=EB=8B=88=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/co/lion/mungnolza/ui/main/MainActivity.kt | 14 -------------- .../MatchingPetsitterActivity.kt | 1 - .../fragment/PetSitterReviewWriteFragment.kt | 11 +++++++++++ .../app/src/main/res/layout/activity_main.xml | 11 ----------- 4 files changed, 11 insertions(+), 26 deletions(-) delete mode 100644 MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/main/MainActivity.kt delete mode 100644 MungNolZa/app/src/main/res/layout/activity_main.xml diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/main/MainActivity.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/main/MainActivity.kt deleted file mode 100644 index bacb709..0000000 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/main/MainActivity.kt +++ /dev/null @@ -1,14 +0,0 @@ -package kr.co.lion.mungnolza.ui.main - -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle - -class MainActivity : AppCompatActivity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - - } -} - - diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/matching_petsitter/MatchingPetsitterActivity.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/matching_petsitter/MatchingPetsitterActivity.kt index 5362876..b276df3 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/matching_petsitter/MatchingPetsitterActivity.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/matching_petsitter/MatchingPetsitterActivity.kt @@ -9,7 +9,6 @@ import androidx.fragment.app.FragmentManager import com.google.android.material.transition.MaterialSharedAxis import kr.co.lion.mungnolza.R import kr.co.lion.mungnolza.databinding.ActivityMatchingPetsitterBinding -import kr.co.lion.mungnolza.ui.main.MainFragmentName import kr.co.lion.mungnolza.ui.matching_petsitter.fragment.MatchingFragment import kr.co.lion.mungnolza.ui.matching_petsitter.fragment.PaymentFragment import kr.co.lion.mungnolza.ui.matching_petsitter.fragment.PetSitterInfoFragment diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt index 22f7922..ca2cb8f 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt @@ -10,18 +10,29 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder 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.ui.reservation_list.viewmodel.PetSitterReviewWriteViewModel import kr.co.lion.mungnolza.util.ReservationListFragmentName class PetSitterReviewWriteFragment : Fragment() { lateinit var fragmentPetSitterReviewWriteBinding: FragmentPetSitterReviewWriteBinding lateinit var reservationListActivity: ReservationListActivity + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { // Inflate the layout for this fragment fragmentPetSitterReviewWriteBinding = FragmentPetSitterReviewWriteBinding.inflate(layoutInflater) reservationListActivity = activity as ReservationListActivity + // ViewModel 객체를 생성한다. + //petSitterReviewWriteViewModel = PetSitterReviewWriteViewModel() + // 생성한 ViewModel 객체를 layout 파일에 설정해준다. + //fragmentPetSitterReviewWriteBinding.petSitterReviewWriteViewModel = petSitterReviewWriteViewModel + // ViewModel의 생명주기를 Fragment와 일치시킨다. Fragment가 살아 있을 때 ViewModel 객체도 살아있게끔 해준다. + //fragmentPetSitterReviewWriteBinding.lifecycleOwner = this + + // 왜 따라서 바뀌는거얌 !! 왜 !! + setToolbar() setEvent() initData() diff --git a/MungNolZa/app/src/main/res/layout/activity_main.xml b/MungNolZa/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index 5122e7f..0000000 --- a/MungNolZa/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - \ No newline at end of file From 9e312d2cd9bcfa63e1368c9f49c145a7edc70b96 Mon Sep 17 00:00:00 2001 From: cny1213 Date: Tue, 9 Apr 2024 19:18:23 +0900 Subject: [PATCH 2/7] =?UTF-8?q?[#21]=20PetSitterReviewWriteFragment=20?= =?UTF-8?q?=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EA=B2=80=EC=82=AC=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20+=20AppointmentActivity=EC=97=90=EC=84=9C=20Main?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20import=20=EC=A7=80=EC=9B=80.=20(=EC=97=90?= =?UTF-8?q?=EB=9F=AC=EA=B3=A0=EC=B9=A8=20=EC=99=84=EB=A3=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/appointment/AppointmentActivity.kt | 1 - .../AppointmentDogTimeSelectionFragment.kt | 1 - .../fragment/AppointmentRequestFragment.kt | 1 - .../AppointmentUserAddressFragment.kt | 1 - .../fragment/PetSitterReviewWriteFragment.kt | 78 +++++++++++++++---- .../PetSitterReviewWriteViewModel.kt | 13 ++++ .../java/kr/co/lion/mungnolza/util/Tools.kt | 46 +++++++++++ .../fragment_pet_sitter_review_write.xml | 23 ++++-- 8 files changed, 138 insertions(+), 26 deletions(-) create mode 100644 MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/viewmodel/PetSitterReviewWriteViewModel.kt diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/AppointmentActivity.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/AppointmentActivity.kt index ae83309..d68a667 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/AppointmentActivity.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/AppointmentActivity.kt @@ -9,7 +9,6 @@ import androidx.fragment.app.FragmentManager import com.google.android.material.transition.MaterialSharedAxis import kr.co.lion.mungnolza.R import kr.co.lion.mungnolza.databinding.ActivityAppointmentBinding -import kr.co.lion.mungnolza.databinding.ActivityMainBinding import kr.co.lion.mungnolza.ui.main.MainFragmentName import kr.co.lion.mungnolza.ui.appointment.fragment.AppointmentDateTimeSelectionFragment import kr.co.lion.mungnolza.ui.appointment.fragment.AppointmentDogTimeSelectionFragment diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentDogTimeSelectionFragment.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentDogTimeSelectionFragment.kt index 056f711..8cb66af 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentDogTimeSelectionFragment.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentDogTimeSelectionFragment.kt @@ -9,7 +9,6 @@ import android.view.ViewGroup import androidx.core.content.ContextCompat import kr.co.lion.mungnolza.R import kr.co.lion.mungnolza.databinding.FragmentAppointmentDogTimeSelectionBinding -import kr.co.lion.mungnolza.ui.main.MainActivity import kr.co.lion.mungnolza.ui.main.MainFragmentName diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentRequestFragment.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentRequestFragment.kt index e299688..f8f1545 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentRequestFragment.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentRequestFragment.kt @@ -8,7 +8,6 @@ import android.view.ViewGroup import kr.co.lion.mungnolza.R import kr.co.lion.mungnolza.databinding.FragmentAppointmentMainBinding import kr.co.lion.mungnolza.databinding.FragmentAppointmentRequestBinding -import kr.co.lion.mungnolza.ui.main.MainActivity import kr.co.lion.mungnolza.ui.main.MainFragmentName class AppointmentRequestFragment : Fragment() { diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentUserAddressFragment.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentUserAddressFragment.kt index c557be0..7e9d94a 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentUserAddressFragment.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentUserAddressFragment.kt @@ -7,7 +7,6 @@ import android.view.View import android.view.ViewGroup import kr.co.lion.mungnolza.R import kr.co.lion.mungnolza.databinding.FragmentAppointmentUserAddressBinding -import kr.co.lion.mungnolza.ui.main.MainActivity import kr.co.lion.mungnolza.ui.main.MainFragmentName diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt index ca2cb8f..7a06c87 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt @@ -1,5 +1,6 @@ package kr.co.lion.mungnolza.ui.reservation_list.fragment +import android.content.Context import android.content.DialogInterface import android.os.Bundle import androidx.fragment.app.Fragment @@ -12,12 +13,15 @@ import kr.co.lion.mungnolza.R import kr.co.lion.mungnolza.databinding.FragmentPetSitterReviewWriteBinding import kr.co.lion.mungnolza.ui.reservation_list.viewmodel.PetSitterReviewWriteViewModel import kr.co.lion.mungnolza.util.ReservationListFragmentName +import kr.co.lion.mungnolza.util.Tools class PetSitterReviewWriteFragment : Fragment() { lateinit var fragmentPetSitterReviewWriteBinding: FragmentPetSitterReviewWriteBinding lateinit var reservationListActivity: ReservationListActivity + lateinit var petSitterReviewWriteViewModel : PetSitterReviewWriteViewModel + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { // Inflate the layout for this fragment @@ -25,16 +29,16 @@ class PetSitterReviewWriteFragment : Fragment() { reservationListActivity = activity as ReservationListActivity // ViewModel 객체를 생성한다. - //petSitterReviewWriteViewModel = PetSitterReviewWriteViewModel() + petSitterReviewWriteViewModel = PetSitterReviewWriteViewModel() // 생성한 ViewModel 객체를 layout 파일에 설정해준다. - //fragmentPetSitterReviewWriteBinding.petSitterReviewWriteViewModel = petSitterReviewWriteViewModel - // ViewModel의 생명주기를 Fragment와 일치시킨다. Fragment가 살아 있을 때 ViewModel 객체도 살아있게끔 해준다. - //fragmentPetSitterReviewWriteBinding.lifecycleOwner = this + fragmentPetSitterReviewWriteBinding.petSitterReviewWriteViewModel = petSitterReviewWriteViewModel + // ViewModel의 생명주기를 Fragment와 일치시킨다. Fragment가 살아 있을 때 ViewModel 객체도 살아 있게끔 해준다. + fragmentPetSitterReviewWriteBinding.lifecycleOwner = this - // 왜 따라서 바뀌는거얌 !! 왜 !! setToolbar() - setEvent() + setButtonDone() + setTextField() initData() return fragmentPetSitterReviewWriteBinding.root @@ -54,27 +58,69 @@ class PetSitterReviewWriteFragment : Fragment() { } } - // 이벤트 설정 - fun setEvent(){ + // 작성 완료 버튼 (이벤트 설정) + fun setButtonDone(){ // buttonPetsitterReviewWriteDone 작성완료 버튼 설정 fragmentPetSitterReviewWriteBinding.apply { buttonPetsitterReviewWriteDone.apply { // 버튼을 눌럿을 때 setOnClickListener { - // 작성완료 다이어로그를 띄운다 - val materialAlertDialogBuilder = MaterialAlertDialogBuilder(reservationListActivity) - materialAlertDialogBuilder.setTitle("작성 완료") - materialAlertDialogBuilder.setMessage("후기 작성이 완료되었습니다 !") - materialAlertDialogBuilder.setPositiveButton("확인"){ dialogInterface: DialogInterface, i: Int -> - // 메인화면으로 넘어간다. + // 입력을 검사한다. -유효성 검사 + val chk = checkTextInput() + + // 입력이 모두 잘 되어 있다면.. + // 데이터를 저장하고 이동한다. + if(chk == true){ + // (추가예정) 사용자가 입력한 데이터를 저장한다. + + // 키보드를 내려준다 + Tools.hideSoftInput(reservationListActivity) + + // 작성완료 다이어로그를 띄운다 + val materialAlertDialogBuilder = MaterialAlertDialogBuilder(reservationListActivity) + materialAlertDialogBuilder.setTitle("작성 완료") + materialAlertDialogBuilder.setMessage("후기 작성이 완료되었습니다 !") + materialAlertDialogBuilder.setPositiveButton("확인"){ dialogInterface: DialogInterface, i: Int -> + // (추가예정) 메인화면으로 넘어간다. + } + materialAlertDialogBuilder.show() } - materialAlertDialogBuilder.show() } } } } - // 초기 데이터 셋팅 + // 입력요소 유효성 검사 메서드 + fun checkTextInput(): Boolean { + // 사용자가 입력한 내용을 가져온다 + val starCount = petSitterReviewWriteViewModel.ratingBar2.value + val reviewText = petSitterReviewWriteViewModel.textfieldPetsitterReviewWrite.value!! + + // 별점수를 입력하지 않았다면 + if(starCount == 0f){ + // 다이어로그 띄워준다 + Tools.showErrorDialog(reservationListActivity, fragmentPetSitterReviewWriteBinding.ratingBar2, "별점 입력 오류", "펫시터에게 별점을 남겨주세요.") + return false + } + + // 후기 내용을 입력하지 않았다면 + if(reviewText.isEmpty()){ + // 다이어로그 띄워준다 + // 다이어로그의 확인 클릭시, 뷰에 포커스를 주고 키보드를 올린다. + Tools.showErrorDialog(reservationListActivity, fragmentPetSitterReviewWriteBinding.textfieldPetsitterReviewWrite, "후기 작성 오류", "펫시터에게 후기를 작성해주세요.") + return false + } + return true + } + + // 입력요소 초기설정 + fun setTextField(){ + // 입력 요소들을 초기화 한다. + petSitterReviewWriteViewModel.ratingBar2.value = 0f + petSitterReviewWriteViewModel.textfieldPetsitterReviewWrite.value = "" + } + + // 임시 가짜 데이터 셋팅 fun initData(){ fragmentPetSitterReviewWriteBinding.apply { imageViewPetSitterReviewWrite.setImageResource(R.drawable.petsitter) diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/viewmodel/PetSitterReviewWriteViewModel.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/viewmodel/PetSitterReviewWriteViewModel.kt new file mode 100644 index 0000000..e088f83 --- /dev/null +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/viewmodel/PetSitterReviewWriteViewModel.kt @@ -0,0 +1,13 @@ +package kr.co.lion.mungnolza.ui.reservation_list.viewmodel + +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel + +// 펫시터 후기 작성 + +class PetSitterReviewWriteViewModel : ViewModel() { + // 별점 → starCount + val ratingBar2 = MutableLiveData() + // 후기내용 → ReviewText + val textfieldPetsitterReviewWrite = MutableLiveData() +} \ No newline at end of file diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/util/Tools.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/util/Tools.kt index 05fc4f2..dbc63c7 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/util/Tools.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/util/Tools.kt @@ -1,8 +1,54 @@ package kr.co.lion.mungnolza.util +import android.app.Activity +import android.content.Context +import android.content.DialogInterface +import android.os.SystemClock +import android.view.View +import android.view.inputmethod.InputMethodManager +import androidx.appcompat.app.AppCompatActivity +import com.google.android.material.dialog.MaterialAlertDialogBuilder +import kotlin.concurrent.thread + class Tools { companion object{ + // 뷰에 포커스를 주고 키보드를 올린다. + fun showSoftInput(context: Context, view: View){ + // 뷰에 포커스를 준다. + view.requestFocus() + thread { + // 딜레이 + SystemClock.sleep(200) + // 키보드 관리 객체를 가져온다. + val inputMethodManger = context.getSystemService(AppCompatActivity.INPUT_METHOD_SERVICE) as InputMethodManager + // 키보드를 올린다. + inputMethodManger.showSoftInput(view, 0) + } + } + // 키보드를 내려주고 포커스를 제거한다. + fun hideSoftInput(activity: Activity){ + // 포커스를 가지고 있는 뷰가 있다면.. + if(activity.window.currentFocus != null){ + // 키보드 관리 객체를 가져온다. + val inputMethodManger = activity.getSystemService(AppCompatActivity.INPUT_METHOD_SERVICE) as + InputMethodManager + // 키보드를 내려준다. + inputMethodManger.hideSoftInputFromWindow(activity.window.currentFocus?.windowToken, 0) + // 포커스를 제거해준다. + activity.window.currentFocus?.clearFocus() + } + } + // 입력 요소가 비어있을때 보여줄 다이얼로그를 구성하는 메서드 + fun showErrorDialog(context: Context, view: View, title:String, message:String){ + val materialAlertDialogBuilder = MaterialAlertDialogBuilder(context) + materialAlertDialogBuilder.setTitle(title) + materialAlertDialogBuilder.setMessage(message) + materialAlertDialogBuilder.setPositiveButton("확인"){ dialogInterface: DialogInterface, i: Int -> + showSoftInput(context, view) + } + materialAlertDialogBuilder.show() + } } } diff --git a/MungNolZa/app/src/main/res/layout/fragment_pet_sitter_review_write.xml b/MungNolZa/app/src/main/res/layout/fragment_pet_sitter_review_write.xml index 4891984..84a3f6d 100644 --- a/MungNolZa/app/src/main/res/layout/fragment_pet_sitter_review_write.xml +++ b/MungNolZa/app/src/main/res/layout/fragment_pet_sitter_review_write.xml @@ -1,7 +1,15 @@ - + + + + + + + android:rating="@={petSitterReviewWriteViewModel.ratingBar2}" /> + android:inputType="text|textLongMessage|textMultiLine" + android:text="@={petSitterReviewWriteViewModel.textfieldPetsitterReviewWrite}" /> - \ No newline at end of file + + + \ No newline at end of file From 4da360b2964b577c8ab64dc367ce75cf2b9675bd Mon Sep 17 00:00:00 2001 From: cny1213 Date: Thu, 11 Apr 2024 15:21:46 +0900 Subject: [PATCH 3/7] =?UTF-8?q?[#21]=20(1)=20PetSitterReviewDao=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(2)=20PetSitterReviewModel=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20(3)=20firebase=EC=97=90=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=97=B0=EB=8F=99=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (보완사항) model 변수 더 넣어야함. 주석처리 해놨음. 사용자정보모델, 펫시터정보모델에서 부터 받아와야 하는 데이터. [petsitterIdx, reviewWriterIdx, reviewWriterName] --- .../lion/mungnolza/dao/PetsitterReviewDao.kt | 65 +++++++++++++++++++ .../mungnolza/model/PetsitterReviewModel.kt | 22 +++++++ .../fragment/PetSitterReviewWriteFragment.kt | 37 ++++++++++- 3 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 MungNolZa/app/src/main/java/kr/co/lion/mungnolza/dao/PetsitterReviewDao.kt create mode 100644 MungNolZa/app/src/main/java/kr/co/lion/mungnolza/model/PetsitterReviewModel.kt diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/dao/PetsitterReviewDao.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/dao/PetsitterReviewDao.kt new file mode 100644 index 0000000..b3ec1e4 --- /dev/null +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/dao/PetsitterReviewDao.kt @@ -0,0 +1,65 @@ +package kr.co.lion.mungnolza.dao + +import com.google.firebase.Firebase +import com.google.firebase.firestore.firestore +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import kotlinx.coroutines.tasks.await +import kr.co.lion.mungnolza.model.PetsitterReviewModel + +class PetsitterReviewDao { + + companion object{ + // 후기글 번호 시퀀스값을 가져온다. + suspend fun getReviewIdx() : Int{ + + var reviewIdxSequence = 0 + + val job1 = CoroutineScope(Dispatchers.IO).launch { + // 컬렉션에 접근할 수 있는 객체를 가져온다 + val collectionReference = Firebase.firestore.collection("petsitterReviewModel") + // 후기글 번호 시퀀스값을 가지고 있는 문서에 접근할 수 있는 객체를 가져온다. + val documentReference = collectionReference.document("reviewIdxSequence") + // 문서내에 있는 데이터를 가져올 수 있는 객체를 가져온다. + val documentSnapShot = documentReference.get().await() + //reviewIdxSequence = documentSnapShot.getLong("petsitterIdx")?.toInt()!! + reviewIdxSequence = documentSnapShot.getLong("reviewIdx")?.toInt() ?: 0 + + } + job1.join() + + return reviewIdxSequence + } + + // 후기글번호 시퀀스값을 업데이트 한다. + suspend fun updateReviewIdx(reviewIdxSequence:Int){ + val job1 = CoroutineScope(Dispatchers.IO).launch { + // 컬렉션에 접근할 수 있는 객체를 가져온다. + val collectionReference = Firebase.firestore.collection("petsitterReviewModel") + // 후기글 번호 시퀀스값을 가지고 있는 문서에 접근할 수 있는 객체를 가져온다. + val documentReference = collectionReference.document("reviewIdxSequence") + // 저장할 데이터를 담을 HaskMap을 만들어준다. + val map = mutableMapOf() + map["reviewIdx"] = reviewIdxSequence.toLong() + // 저장한다 + documentReference.set(map) + } + job1.join() + } + + // 펫시터후기 정보를 저장한다. + suspend fun insertPetsitterReviewData(petsitterReviewModel: PetsitterReviewModel){ + val job1 = CoroutineScope(Dispatchers.IO).launch { + // 컬렉션에 접근할 수 있는 객체를 가져온다. + val collectionReference = Firebase.firestore.collection("petsitterReviewModel") + // 컬렉션에 문서를 추가한다. + // 문서를 추가할 때 객체나 맵을 지정한다. + // 추가된 문서 내부의 필드는 객체가 가진 프로퍼티의 이름이나 맵에 있는 데이터의 이름과 동일하게 결정된다. + collectionReference.add(petsitterReviewModel) + } + job1.join() + } + } + +} \ No newline at end of file diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/model/PetsitterReviewModel.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/model/PetsitterReviewModel.kt new file mode 100644 index 0000000..44bd09e --- /dev/null +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/model/PetsitterReviewModel.kt @@ -0,0 +1,22 @@ +package kr.co.lion.mungnolza.model + +data class PetsitterReviewModel( + // 후기글번호 → reviewIdx + // 펫시터 번호 → petsitterIdx + // 사용자(작성자) 번호 → reviewWriterIdx + // 사용자 이름 → reviewWriterName + // 작성날짜 → reviewWriteDate + // 별점 → reviewStarCount + // 후기내용 → reviewText + + var reviewIdx: Int, + /*var petsitterIdx : Int, + var reviewWriterIdx : Int, + var reviewWriterName : String,*/ + var reviewWriteDate : String, + var reviewStarCount: Float?, + var reviewText: String +) + + + diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt index 7a06c87..69cb35c 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt @@ -1,19 +1,26 @@ package kr.co.lion.mungnolza.ui.reservation_list.fragment -import android.content.Context import android.content.DialogInterface 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.dao.PetsitterReviewDao import kr.co.lion.mungnolza.databinding.FragmentPetSitterReviewWriteBinding +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 kr.co.lion.mungnolza.util.Tools +import java.text.SimpleDateFormat +import java.util.Date class PetSitterReviewWriteFragment : Fragment() { @@ -72,6 +79,7 @@ class PetSitterReviewWriteFragment : Fragment() { // 데이터를 저장하고 이동한다. if(chk == true){ // (추가예정) 사용자가 입력한 데이터를 저장한다. + savePetsitterReviewData() // 키보드를 내려준다 Tools.hideSoftInput(reservationListActivity) @@ -90,6 +98,33 @@ class PetSitterReviewWriteFragment : Fragment() { } } + // 데잍 + fun savePetsitterReviewData() { + CoroutineScope(Dispatchers.Main).launch { + // 펫시터 후기 번호 시퀀스 값을 가져온다. + val reviewIdxSequence = PetsitterReviewDao.getReviewIdx() + Log.d("test1234", "reviewIdxSequence : $reviewIdxSequence") + // 시퀀스 값을 1 증가시켜 덮어씌워준다. + PetsitterReviewDao.updateReviewIdx(reviewIdxSequence + 1) + + // 저장할 데이터를 가져온다 + val reviewIdx = reviewIdxSequence + 1 + //val petsitterIdx + //val reviewWriterIdx + //val reviewWriterName + val simpleDateFormat = SimpleDateFormat("yyyy-MM-dd") + val reviewWriteDate = simpleDateFormat.format(Date()) + val reviewStarCount = petSitterReviewWriteViewModel.ratingBar2.value + val reviewText = petSitterReviewWriteViewModel.textfieldPetsitterReviewWrite.value!! + + // 저장할 데이터를 객체에 담는다. + val petsitterReviewModel = PetsitterReviewModel(reviewIdx, reviewWriteDate, reviewStarCount, reviewText) + + // 펫시터 후기 정보를 저장한다. + PetsitterReviewDao.insertPetsitterReviewData(petsitterReviewModel) + } + } + // 입력요소 유효성 검사 메서드 fun checkTextInput(): Boolean { // 사용자가 입력한 내용을 가져온다 From 733470154d92594019e424338ec3fd22b8ec9a45 Mon Sep 17 00:00:00 2001 From: cny1213 Date: Fri, 12 Apr 2024 09:09:19 +0900 Subject: [PATCH 4/7] =?UTF-8?q?[#21]=20(1)=20[ext]-[ContextExt.kt]=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20(2)=20=EA=B7=B8=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=9D=BC=20[Tools.kt]=20=EC=88=98=EC=A0=95=20(3)=20[colors.xml?= =?UTF-8?q?]=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/co/lion/mungnolza/ext/ContextExt.kt | 65 +++++++++++++++++++ .../fragment/PetSitterReviewWriteFragment.kt | 10 ++- .../java/kr/co/lion/mungnolza/util/Tools.kt | 65 +++++-------------- MungNolZa/app/src/main/res/values/colors.xml | 10 ++- 4 files changed, 99 insertions(+), 51 deletions(-) create mode 100644 MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ext/ContextExt.kt diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ext/ContextExt.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ext/ContextExt.kt new file mode 100644 index 0000000..1ea12c8 --- /dev/null +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ext/ContextExt.kt @@ -0,0 +1,65 @@ +package kr.co.lion.mungnolza.ext + +import android.app.Activity +import android.content.Context +import android.content.DialogInterface +import android.content.pm.PackageManager +import android.view.View +import android.view.inputmethod.InputMethodManager +import androidx.appcompat.app.AppCompatActivity +import androidx.core.content.ContextCompat +import com.google.android.material.dialog.MaterialAlertDialogBuilder +import kr.co.lion.mungnolza.R +import kr.co.lion.mungnolza.util.BoardUtil +import kr.co.lion.mungnolza.util.Tools + +fun Context.hasPermission(permission: String): Boolean { + return ContextCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_GRANTED +} +fun Context.hasImagePermission(): Boolean = Tools.REQUEST_IMAGE_PERMISSIONS.any { this.hasPermission(it) } + +fun Context.hasLocationPermission(): Boolean = Tools.REQUEST_LOCATION_PERMISSIONS.any { this.hasPermission(it) } + +fun Context.setColorWhite() = ContextCompat.getColorStateList(this, R.color.white) +fun Context.setColorBlack() = ContextCompat.getColorStateList(this, R.color.black) +fun Context.setColorkakaoYellow() = ContextCompat.getColorStateList(this, R.color.kakao_color) +fun Context.setColorPrimary() = ContextCompat.getColorStateList(this, R.color.colorPrimary2) +fun Context.setSelectTimeButtonColor() = ContextCompat.getColorStateList(this, R.color.v) +fun Context.setColorGreenBlue() = ContextCompat.getColorStateList(this, R.color.green_blue) + +// 키보드를 내려주고 포커스를 제거한다. +fun Context.hideSoftInput(activity: Activity) { + // 포커스를 가지고 있는 뷰가 있다면.. + if (activity.window.currentFocus != null) { + // 키보드 관리 객체를 가져온다. + val inputMethodManger = + activity.getSystemService(AppCompatActivity.INPUT_METHOD_SERVICE) as InputMethodManager + // 키보드를 내려준다. + inputMethodManger.hideSoftInputFromWindow(activity.window.currentFocus?.windowToken, 0) + // 포커스를 제거해준다. + activity.window.currentFocus?.clearFocus() + } +} + +// 뷰에 포커스를 주고 키보드를 올린다. +fun Context.showSoftInput(view: View) { + // 뷰에 포커스를 준다. + view.requestFocus() + + // 키보드 관리 객체를 가져온다. + val inputMethodManger = + this.getSystemService(AppCompatActivity.INPUT_METHOD_SERVICE) as InputMethodManager + // 키보드를 올린다. + inputMethodManger.showSoftInput(view, 0) +} + +// 입력 요소가 비어있을때 보여줄 다이얼로그를 구성하는 메서드 +fun showErrorDialog(context: Context, view: View, title: String, message: String) { + val materialAlertDialogBuilder = MaterialAlertDialogBuilder(context) + materialAlertDialogBuilder.setTitle(title) + materialAlertDialogBuilder.setMessage(message) + materialAlertDialogBuilder.setPositiveButton("확인") { dialogInterface: DialogInterface, i: Int -> + BoardUtil.showSoftInput(context, view) + } + materialAlertDialogBuilder.show() +} diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt index 69cb35c..dfd663d 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt @@ -21,6 +21,10 @@ import kr.co.lion.mungnolza.util.ReservationListFragmentName import kr.co.lion.mungnolza.util.Tools import java.text.SimpleDateFormat import java.util.Date +// ContextExt.kt에 정의된 확장 함수를 import +import kr.co.lion.mungnolza.ext.hideSoftInput +import kr.co.lion.mungnolza.ext.showSoftInput +import kr.co.lion.mungnolza.ext.showErrorDialog class PetSitterReviewWriteFragment : Fragment() { @@ -82,7 +86,7 @@ class PetSitterReviewWriteFragment : Fragment() { savePetsitterReviewData() // 키보드를 내려준다 - Tools.hideSoftInput(reservationListActivity) + context.hideSoftInput(reservationListActivity) // 작성완료 다이어로그를 띄운다 val materialAlertDialogBuilder = MaterialAlertDialogBuilder(reservationListActivity) @@ -134,7 +138,7 @@ class PetSitterReviewWriteFragment : Fragment() { // 별점수를 입력하지 않았다면 if(starCount == 0f){ // 다이어로그 띄워준다 - Tools.showErrorDialog(reservationListActivity, fragmentPetSitterReviewWriteBinding.ratingBar2, "별점 입력 오류", "펫시터에게 별점을 남겨주세요.") + showErrorDialog(reservationListActivity, fragmentPetSitterReviewWriteBinding.ratingBar2, "별점 입력 오류", "펫시터에게 별점을 남겨주세요.") return false } @@ -142,7 +146,7 @@ class PetSitterReviewWriteFragment : Fragment() { if(reviewText.isEmpty()){ // 다이어로그 띄워준다 // 다이어로그의 확인 클릭시, 뷰에 포커스를 주고 키보드를 올린다. - Tools.showErrorDialog(reservationListActivity, fragmentPetSitterReviewWriteBinding.textfieldPetsitterReviewWrite, "후기 작성 오류", "펫시터에게 후기를 작성해주세요.") + showErrorDialog(reservationListActivity, fragmentPetSitterReviewWriteBinding.textfieldPetsitterReviewWrite, "후기 작성 오류", "펫시터에게 후기를 작성해주세요.") return false } return true diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/util/Tools.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/util/Tools.kt index dbc63c7..15f6d36 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/util/Tools.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/util/Tools.kt @@ -1,57 +1,28 @@ package kr.co.lion.mungnolza.util -import android.app.Activity -import android.content.Context -import android.content.DialogInterface -import android.os.SystemClock -import android.view.View -import android.view.inputmethod.InputMethodManager -import androidx.appcompat.app.AppCompatActivity -import com.google.android.material.dialog.MaterialAlertDialogBuilder -import kotlin.concurrent.thread +import android.Manifest +import android.os.Build -class Tools { - companion object{ - - // 뷰에 포커스를 주고 키보드를 올린다. - fun showSoftInput(context: Context, view: View){ - // 뷰에 포커스를 준다. - view.requestFocus() - thread { - // 딜레이 - SystemClock.sleep(200) - // 키보드 관리 객체를 가져온다. - val inputMethodManger = context.getSystemService(AppCompatActivity.INPUT_METHOD_SERVICE) as InputMethodManager - // 키보드를 올린다. - inputMethodManger.showSoftInput(view, 0) - } - } - // 키보드를 내려주고 포커스를 제거한다. - fun hideSoftInput(activity: Activity){ - // 포커스를 가지고 있는 뷰가 있다면.. - if(activity.window.currentFocus != null){ - // 키보드 관리 객체를 가져온다. - val inputMethodManger = activity.getSystemService(AppCompatActivity.INPUT_METHOD_SERVICE) as - InputMethodManager - // 키보드를 내려준다. - inputMethodManger.hideSoftInputFromWindow(activity.window.currentFocus?.windowToken, 0) - // 포커스를 제거해준다. - activity.window.currentFocus?.clearFocus() - } - } - // 입력 요소가 비어있을때 보여줄 다이얼로그를 구성하는 메서드 - fun showErrorDialog(context: Context, view: View, title:String, message:String){ - val materialAlertDialogBuilder = MaterialAlertDialogBuilder(context) - materialAlertDialogBuilder.setTitle(title) - materialAlertDialogBuilder.setMessage(message) - materialAlertDialogBuilder.setPositiveButton("확인"){ dialogInterface: DialogInterface, i: Int -> - showSoftInput(context, view) - } - materialAlertDialogBuilder.show() +object Tools { + val REQUEST_IMAGE_PERMISSIONS by lazy{ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + arrayOf(Manifest.permission.READ_MEDIA_IMAGES, Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED) + } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + arrayOf(Manifest.permission.READ_MEDIA_IMAGES) + } else { + arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE) } } + + val REQUEST_LOCATION_PERMISSIONS by lazy { + arrayOf( + Manifest.permission.ACCESS_FINE_LOCATION, + Manifest.permission.ACCESS_COARSE_LOCATION, + ) + } } + // MainFragment 에서 보여줄 프래그먼트들의 이름 enum class MatchingPetsitterFragmentName(var str:String){ // 매칭화면 diff --git a/MungNolZa/app/src/main/res/values/colors.xml b/MungNolZa/app/src/main/res/values/colors.xml index 68856f1..792416b 100644 --- a/MungNolZa/app/src/main/res/values/colors.xml +++ b/MungNolZa/app/src/main/res/values/colors.xml @@ -22,4 +22,12 @@ #ffea9f #e0e0e0 - \ No newline at end of file + + + #BB86FC + #6750A4 + #FEE500 + #36BC9B + + + From 43fb579ce19a31c29c6e66e624c9e1d3399cb39b Mon Sep 17 00:00:00 2001 From: cny1213 Date: Fri, 12 Apr 2024 10:33:23 +0900 Subject: [PATCH 5/7] =?UTF-8?q?[#21]=20(1)=20[Dao]=EC=97=90=EC=84=9C=20[Re?= =?UTF-8?q?pository]=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20(2)=20=EA=B7=B8?= =?UTF-8?q?=EC=97=90=20=EB=94=B0=EB=9D=BC=20PetsitterReviewRepository.kt?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PetsitterReviewRepository.kt} | 4 ++-- .../fragment/PetSitterReviewWriteFragment.kt | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) rename MungNolZa/app/src/main/java/kr/co/lion/mungnolza/{dao/PetsitterReviewDao.kt => repository/PetsitterReviewRepository.kt} (97%) diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/dao/PetsitterReviewDao.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/repository/PetsitterReviewRepository.kt similarity index 97% rename from MungNolZa/app/src/main/java/kr/co/lion/mungnolza/dao/PetsitterReviewDao.kt rename to MungNolZa/app/src/main/java/kr/co/lion/mungnolza/repository/PetsitterReviewRepository.kt index b3ec1e4..899185f 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/dao/PetsitterReviewDao.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/repository/PetsitterReviewRepository.kt @@ -1,4 +1,4 @@ -package kr.co.lion.mungnolza.dao +package kr.co.lion.mungnolza.repository import com.google.firebase.Firebase import com.google.firebase.firestore.firestore @@ -8,7 +8,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.tasks.await import kr.co.lion.mungnolza.model.PetsitterReviewModel -class PetsitterReviewDao { +class PetsitterReviewRepository { companion object{ // 후기글 번호 시퀀스값을 가져온다. diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt index dfd663d..a0ce6a8 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/reservation_list/fragment/PetSitterReviewWriteFragment.kt @@ -13,17 +13,15 @@ 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.dao.PetsitterReviewDao +import kr.co.lion.mungnolza.repository.PetsitterReviewRepository import kr.co.lion.mungnolza.databinding.FragmentPetSitterReviewWriteBinding 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 kr.co.lion.mungnolza.util.Tools import java.text.SimpleDateFormat import java.util.Date // ContextExt.kt에 정의된 확장 함수를 import import kr.co.lion.mungnolza.ext.hideSoftInput -import kr.co.lion.mungnolza.ext.showSoftInput import kr.co.lion.mungnolza.ext.showErrorDialog class PetSitterReviewWriteFragment : Fragment() { @@ -106,10 +104,10 @@ class PetSitterReviewWriteFragment : Fragment() { fun savePetsitterReviewData() { CoroutineScope(Dispatchers.Main).launch { // 펫시터 후기 번호 시퀀스 값을 가져온다. - val reviewIdxSequence = PetsitterReviewDao.getReviewIdx() + val reviewIdxSequence = PetsitterReviewRepository.getReviewIdx() Log.d("test1234", "reviewIdxSequence : $reviewIdxSequence") // 시퀀스 값을 1 증가시켜 덮어씌워준다. - PetsitterReviewDao.updateReviewIdx(reviewIdxSequence + 1) + PetsitterReviewRepository.updateReviewIdx(reviewIdxSequence + 1) // 저장할 데이터를 가져온다 val reviewIdx = reviewIdxSequence + 1 @@ -125,7 +123,7 @@ class PetSitterReviewWriteFragment : Fragment() { val petsitterReviewModel = PetsitterReviewModel(reviewIdx, reviewWriteDate, reviewStarCount, reviewText) // 펫시터 후기 정보를 저장한다. - PetsitterReviewDao.insertPetsitterReviewData(petsitterReviewModel) + PetsitterReviewRepository.insertPetsitterReviewData(petsitterReviewModel) } } From fcac9591d2fc4492553bfb723b96a658b7f53ed4 Mon Sep 17 00:00:00 2001 From: cny1213 Date: Fri, 12 Apr 2024 10:48:32 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[#21]=20merge=EB=A5=BC=20=EC=9C=84=ED=95=9C?= =?UTF-8?q?=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/appointment/fragment/AppointmentMainFragment.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentMainFragment.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentMainFragment.kt index a4b5e4b..bf79f34 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentMainFragment.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ui/appointment/fragment/AppointmentMainFragment.kt @@ -14,9 +14,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import kr.co.lion.mungnolza.R import kr.co.lion.mungnolza.databinding.FragmentAppointmentMainBinding import kr.co.lion.mungnolza.model.PetInfo -import kr.co.lion.mungnolza.ui.main.MainFragmentName import kr.co.lion.mungnolza.ui.appointment.adapter.SelectPetAdapter -import kr.co.lion.mungnolza.ui.main.showAlertDialog class AppointmentMainFragment : Fragment() { @@ -41,8 +39,10 @@ class AppointmentMainFragment : Fragment() { private fun initView(){ // 테스트용 입니다! - dataList.add(PetInfo(getBitmapFromDrawable(requireContext(), R.drawable.doog), - "바둑이", "진돗개", "남자아이", 6, "20.2", "했어요", "")) + dataList.add( + PetInfo(getBitmapFromDrawable(requireContext(), R.drawable.doog), + "바둑이", "진돗개", "남자아이", 6, "20.2", "했어요", "") + ) with(binding){ with(rv){ From 9046818031add4d97ba2ed8b3c3772e24faf9897 Mon Sep 17 00:00:00 2001 From: cny1213 Date: Fri, 12 Apr 2024 11:24:53 +0900 Subject: [PATCH 7/7] =?UTF-8?q?[#21]=20merge=EB=A5=BC=20=EC=9C=84=ED=95=9C?= =?UTF-8?q?=20conflict=ED=95=B4=EA=B2=B0=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/kr/co/lion/mungnolza/ext/ContextExt.kt | 3 +-- MungNolZa/app/src/main/res/values/colors.xml | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ext/ContextExt.kt b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ext/ContextExt.kt index 1ea12c8..e55638c 100644 --- a/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ext/ContextExt.kt +++ b/MungNolZa/app/src/main/java/kr/co/lion/mungnolza/ext/ContextExt.kt @@ -10,7 +10,6 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import com.google.android.material.dialog.MaterialAlertDialogBuilder import kr.co.lion.mungnolza.R -import kr.co.lion.mungnolza.util.BoardUtil import kr.co.lion.mungnolza.util.Tools fun Context.hasPermission(permission: String): Boolean { @@ -59,7 +58,7 @@ fun showErrorDialog(context: Context, view: View, title: String, message: String materialAlertDialogBuilder.setTitle(title) materialAlertDialogBuilder.setMessage(message) materialAlertDialogBuilder.setPositiveButton("확인") { dialogInterface: DialogInterface, i: Int -> - BoardUtil.showSoftInput(context, view) + context.showSoftInput(view) } materialAlertDialogBuilder.show() } diff --git a/MungNolZa/app/src/main/res/values/colors.xml b/MungNolZa/app/src/main/res/values/colors.xml index 6b2eaa0..66e0f03 100644 --- a/MungNolZa/app/src/main/res/values/colors.xml +++ b/MungNolZa/app/src/main/res/values/colors.xml @@ -24,11 +24,4 @@ #ffea9f #e0e0e0 - - #BB86FC - #6750A4 - #FEE500 - #36BC9B - -