From 71c8c304dca1703577cd1f5ec2981b0b25df8b91 Mon Sep 17 00:00:00 2001 From: swit-jim Date: Sat, 16 Mar 2024 18:14:52 +0900 Subject: [PATCH 1/8] =?UTF-8?q?[fix/home=5Fdetail=5Faction]:=20BottomSheet?= =?UTF-8?q?Dialog=20=EC=83=81=ED=83=9C=20=EA=B4=80=EB=A0=A8=20=EC=9D=B4?= =?UTF-8?q?=EC=8A=88=20=EC=B6=94=EA=B0=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/gdsc/presentation/view/custom/BottomSheetDialog.kt | 5 +++++ .../java/org/gdsc/presentation/view/home/HomeFragment.kt | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/presentation/src/main/java/org/gdsc/presentation/view/custom/BottomSheetDialog.kt b/presentation/src/main/java/org/gdsc/presentation/view/custom/BottomSheetDialog.kt index 039e9e51..6d9466d7 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/custom/BottomSheetDialog.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/custom/BottomSheetDialog.kt @@ -40,9 +40,14 @@ class BottomSheetDialog { } fun show() { + if (isShowing) return this.btmDlg.show() } + fun dismiss() { + if (!isShowing) return + this.btmDlg.dismiss() + } fun bindBuilder( binding: T, diff --git a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt index 321e6809..557de4cd 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt @@ -424,10 +424,7 @@ class HomeFragment : Fragment(), ViewHolderBindListener { if (groupList.isEmpty()) { viewModel.setCurrentGroup(null) - - if (bottomSheetDialog.isShowing.not()) { - bottomSheetDialog.show() - } + bottomSheetDialog.show() } else { groupList.forEach { if (it.isSelected) { @@ -435,6 +432,7 @@ class HomeFragment : Fragment(), ViewHolderBindListener { return@forEach } } + bottomSheetDialog.dismiss() } } From 8628467fd806901d75be50d932af552eb4e0f8ae Mon Sep 17 00:00:00 2001 From: swit-jim Date: Sat, 16 Mar 2024 18:15:22 +0900 Subject: [PATCH 2/8] =?UTF-8?q?[fix/home=5Fdetail=5Faction]:=20API=20?= =?UTF-8?q?=EB=8B=A4=EC=A4=91=20=ED=98=B8=EC=B6=9C=20=EC=9D=B4=EC=8A=88=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/gdsc/presentation/view/home/HomeFragment.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt index 557de4cd..e1d0ab6a 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt @@ -13,6 +13,7 @@ import androidx.core.content.res.ResourcesCompat import androidx.core.view.isVisible import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels +import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.ConcatAdapter import androidx.recyclerview.widget.LinearLayoutManager @@ -182,7 +183,7 @@ class HomeFragment : Fragment(), ViewHolderBindListener { private fun setGroup() { binding.groupArrow.setOnClickListener { - repeatWhenUiStarted { + lifecycleScope.launch { viewModel.getMyGroup().let { groupList -> viewModel.setGroupList(groupList) } @@ -254,14 +255,14 @@ class HomeFragment : Fragment(), ViewHolderBindListener { naverMap.uiSettings.isZoomControlEnabled = false naverMap.uiSettings.isScaleBarEnabled = false - repeatWhenUiStarted { + lifecycleScope.launch { viewModel.registeredPagingDataByMap().collect { mapMarkerAdapter.submitData(it) } } - repeatWhenUiStarted { + lifecycleScope.launch { val location = viewModel.getCurrentLocation() location?.let { val cameraUpdate = CameraUpdate.scrollTo(LatLng(it.latitude, it.longitude)) @@ -394,7 +395,7 @@ class HomeFragment : Fragment(), ViewHolderBindListener { private fun observeState() { - repeatWhenUiStarted { + lifecycleScope.launch { viewModel.registeredPagingDataByGroup().collect { restaurantListAdapter.submitData(it) } @@ -410,7 +411,7 @@ class HomeFragment : Fragment(), ViewHolderBindListener { } } - repeatWhenUiStarted { + lifecycleScope.launch { viewModel.getMyGroup().let { groupList -> viewModel.setGroupList(groupList) } From b9d6e067021c06ab52bf9ab1e9b2196243e03107 Mon Sep 17 00:00:00 2001 From: swit-jim Date: Sat, 16 Mar 2024 20:52:32 +0900 Subject: [PATCH 3/8] =?UTF-8?q?[fix/home=5Fdetail=5Faction]:=20=EB=A7=9B?= =?UTF-8?q?=EC=A7=91=20=EC=9C=84=EC=B9=98=20=EC=A0=95=EB=B3=B4=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=ED=95=84=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/gdsc/domain/model/RestaurantLocationInfo.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/domain/src/main/java/org/gdsc/domain/model/RestaurantLocationInfo.kt b/domain/src/main/java/org/gdsc/domain/model/RestaurantLocationInfo.kt index e955a6f4..99172ea2 100644 --- a/domain/src/main/java/org/gdsc/domain/model/RestaurantLocationInfo.kt +++ b/domain/src/main/java/org/gdsc/domain/model/RestaurantLocationInfo.kt @@ -27,6 +27,4 @@ data class RestaurantLocationInfo( val x: String, @SerializedName("y") val y: String, - @SerializedName("differenceInDistance") - val differenceInDistance: String ): java.io.Serializable \ No newline at end of file From a0f8c07bc3249c219c1e2919fbc04aa31fa4d86e Mon Sep 17 00:00:00 2001 From: swit-jim Date: Sat, 16 Mar 2024 20:55:23 +0900 Subject: [PATCH 4/8] =?UTF-8?q?[fix/home=5Fdetail=5Faction]:=20=EC=8B=9D?= =?UTF-8?q?=EB=8B=B9=20=EB=93=B1=EB=A1=9D=20API=20groupId=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 --- .../data/datasource/RestaurantDataSource.kt | 2 +- .../datasource/RestaurantDataSourceImpl.kt | 7 +++++-- .../repository/RestaurantRepositoryImpl.kt | 7 +++++-- .../domain/repository/RestaurantRepository.kt | 2 +- .../usecase/PostRestaurantInfoUseCase.kt | 4 +++- .../gdsc/presentation/view/MainActivity.kt | 14 ++++++------- .../ConfirmRestaurantRegistrationFragment.kt | 6 +++++- .../RegisterRestaurantFragment.kt | 3 ++- .../SearchRestaurantLocationInfoFragment.kt | 9 +++++++- .../viewmodel/RegisterRestaurantViewModel.kt | 4 +++- .../view/webview/SpecificWebViewFragment.kt | 2 +- .../main/res/navigation/main_nav_graph.xml | 21 +++++++++++++++++++ 12 files changed, 62 insertions(+), 19 deletions(-) diff --git a/data/src/main/java/org/gdsc/data/datasource/RestaurantDataSource.kt b/data/src/main/java/org/gdsc/data/datasource/RestaurantDataSource.kt index c0417a97..597b23df 100644 --- a/data/src/main/java/org/gdsc/data/datasource/RestaurantDataSource.kt +++ b/data/src/main/java/org/gdsc/data/datasource/RestaurantDataSource.kt @@ -31,7 +31,7 @@ interface RestaurantDataSource { suspend fun postRestaurantLocationInfo(restaurantLocationInfo: RestaurantLocationInfo): String - suspend fun postRestaurantInfo(restaurantRegistrationRequest: RestaurantRegistrationRequest): String + suspend fun postRestaurantInfo(restaurantRegistrationRequest: RestaurantRegistrationRequest, groupId: Int): String suspend fun getRestaurants( userId: Int, locationData: Location, sortType: SortType, foodCategory: FoodCategory, drinkPossibility: DrinkPossibility diff --git a/data/src/main/java/org/gdsc/data/datasource/RestaurantDataSourceImpl.kt b/data/src/main/java/org/gdsc/data/datasource/RestaurantDataSourceImpl.kt index 2faa69fb..acac844c 100644 --- a/data/src/main/java/org/gdsc/data/datasource/RestaurantDataSourceImpl.kt +++ b/data/src/main/java/org/gdsc/data/datasource/RestaurantDataSourceImpl.kt @@ -87,7 +87,10 @@ class RestaurantDataSourceImpl @Inject constructor( return restaurantAPI.postRestaurantLocationInfo(restaurantLocationInfo).data } - override suspend fun postRestaurantInfo(restaurantRegistrationRequest: RestaurantRegistrationRequest): String { + override suspend fun postRestaurantInfo( + restaurantRegistrationRequest: RestaurantRegistrationRequest, + groupId: Int, + ): String { runCatching { restaurantAPI.postRestaurantInfo( mapOf( @@ -100,7 +103,7 @@ class RestaurantDataSourceImpl @Inject constructor( "goWellWithLiquor" to restaurantRegistrationRequest.goWellWithLiquor.toRequestBody(), "recommendMenu" to restaurantRegistrationRequest.recommendMenu.toRequestBody(), "restaurantLocationId" to restaurantRegistrationRequest.restaurantLocationAggregateId.toRequestBody(), - "groupId" to "10".toRequestBody() + "groupId" to groupId.toString().toRequestBody() ), pictures = restaurantRegistrationRequest.pictures ) diff --git a/data/src/main/java/org/gdsc/data/repository/RestaurantRepositoryImpl.kt b/data/src/main/java/org/gdsc/data/repository/RestaurantRepositoryImpl.kt index aa582bab..24616acd 100644 --- a/data/src/main/java/org/gdsc/data/repository/RestaurantRepositoryImpl.kt +++ b/data/src/main/java/org/gdsc/data/repository/RestaurantRepositoryImpl.kt @@ -47,8 +47,11 @@ class RestaurantRepositoryImpl @Inject constructor( return restaurantDataSource.postRestaurantLocationInfo(restaurantLocationInfo) } - override suspend fun postRestaurantInfo(restaurantRegistrationRequest: RestaurantRegistrationRequest): String { - return restaurantDataSource.postRestaurantInfo(restaurantRegistrationRequest) + override suspend fun postRestaurantInfo( + restaurantRegistrationRequest: RestaurantRegistrationRequest, + groupId: Int, + ): String { + return restaurantDataSource.postRestaurantInfo(restaurantRegistrationRequest, groupId) } override suspend fun getRestaurants( diff --git a/domain/src/main/java/org/gdsc/domain/repository/RestaurantRepository.kt b/domain/src/main/java/org/gdsc/domain/repository/RestaurantRepository.kt index 80e609d2..4288c294 100644 --- a/domain/src/main/java/org/gdsc/domain/repository/RestaurantRepository.kt +++ b/domain/src/main/java/org/gdsc/domain/repository/RestaurantRepository.kt @@ -30,7 +30,7 @@ interface RestaurantRepository { suspend fun postRestaurantLocationInfo(restaurantLocationInfo: RestaurantLocationInfo): String - suspend fun postRestaurantInfo(restaurantRegistrationRequest: RestaurantRegistrationRequest): String + suspend fun postRestaurantInfo(restaurantRegistrationRequest: RestaurantRegistrationRequest, groupId: Int): String suspend fun getRestaurants( userId: Int, locationData: Location, sortType: SortType, foodCategory: FoodCategory, drinkPossibility: DrinkPossibility diff --git a/domain/src/main/java/org/gdsc/domain/usecase/PostRestaurantInfoUseCase.kt b/domain/src/main/java/org/gdsc/domain/usecase/PostRestaurantInfoUseCase.kt index 6dde4707..5cc52689 100644 --- a/domain/src/main/java/org/gdsc/domain/usecase/PostRestaurantInfoUseCase.kt +++ b/domain/src/main/java/org/gdsc/domain/usecase/PostRestaurantInfoUseCase.kt @@ -17,7 +17,8 @@ class PostRestaurantInfoUseCase @Inject constructor( canDrinkLiquor: Boolean, goWellWithLiquor: String, recommendMenu: String, - restaurantLocationAggregateIdg: String + restaurantLocationAggregateIdg: String, + groupId: Int, ): String { return restaurantRepository.postRestaurantInfo( RestaurantRegistrationRequest( @@ -30,6 +31,7 @@ class PostRestaurantInfoUseCase @Inject constructor( recommendMenu, restaurantLocationAggregateIdg ), + groupId, ) } } \ No newline at end of file diff --git a/presentation/src/main/java/org/gdsc/presentation/view/MainActivity.kt b/presentation/src/main/java/org/gdsc/presentation/view/MainActivity.kt index 2aeea933..6f2046a2 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/MainActivity.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/MainActivity.kt @@ -164,13 +164,13 @@ class MainActivity : BaseActivity() { binding.toolBar.isVisible = isVisible } - fun navigateToEditRestaurantInfo(restaurantId: Int) { - - val action = HomeFragmentDirections.actionHomeFragmentToRegisterRestaurantFragment( - targetRestaurantId = restaurantId - ) - navController.navigate(action) - } +// fun navigateToEditRestaurantInfo(restaurantId: Int) { +// +// val action = HomeFragmentDirections.actionHomeFragmentToRegisterRestaurantFragment( +// targetRestaurantId = restaurantId +// ) +// navController.navigate(action) +// } override fun onOptionsItemSelected(item: MenuItem): Boolean { if (item.itemId == android.R.id.home) { diff --git a/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/ConfirmRestaurantRegistrationFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/ConfirmRestaurantRegistrationFragment.kt index 376acb3f..04c14051 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/ConfirmRestaurantRegistrationFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/ConfirmRestaurantRegistrationFragment.kt @@ -29,6 +29,7 @@ class ConfirmRestaurantRegistrationFragment : Fragment() { private var _binding: FragmentConfirmRestaurantRegistrationBinding? = null private val binding get() = _binding!! private val navArgs by navArgs() + private val groupId by lazy { navArgs.groupId } private lateinit var mapView: MapView @@ -52,7 +53,10 @@ class ConfirmRestaurantRegistrationFragment : Fragment() { binding.selectButton.setOnClickListener { val action = ConfirmRestaurantRegistrationFragmentDirections - .actionConfirmRestaurantRegistrationFragmentToRegisterRestaurantFragment(navArgs.restaurantLocationInfo) + .actionConfirmRestaurantRegistrationFragmentToRegisterRestaurantFragment( + groupId, + navArgs.restaurantLocationInfo + ) findNavController().navigate(action) } diff --git a/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/RegisterRestaurantFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/RegisterRestaurantFragment.kt index 090ccd7d..2462fe80 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/RegisterRestaurantFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/RegisterRestaurantFragment.kt @@ -49,6 +49,7 @@ class RegisterRestaurantFragment : BaseFragment() { private val viewModel: RegisterRestaurantViewModel by viewModels() private val navArgs by navArgs() + private val groupId by lazy { navArgs.groupId } private val foodCategoryDialog by lazy { FoodCategoryBottomSheetDialog { selectedItem -> @@ -341,7 +342,6 @@ class RegisterRestaurantFragment : BaseFragment() { MediaType.parse("image/png"), imageFile ) - val body = MultipartBody.Part.createFormData( "pictures", @@ -358,6 +358,7 @@ class RegisterRestaurantFragment : BaseFragment() { lifecycleScope.launch(Dispatchers.IO) { viewModel.registerRestaurant( pictures, + groupId, navArgs.restaurantLocationInfo ?: throw Exception() ) { restaurantId -> diff --git a/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/SearchRestaurantLocationInfoFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/SearchRestaurantLocationInfoFragment.kt index f7b8829c..bf0ced5d 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/SearchRestaurantLocationInfoFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/SearchRestaurantLocationInfoFragment.kt @@ -1,6 +1,7 @@ package org.gdsc.presentation.view.restaurantregistration import android.os.Bundle +import android.util.Log import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View @@ -9,6 +10,7 @@ import androidx.annotation.DrawableRes import androidx.fragment.app.viewModels import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController +import androidx.navigation.fragment.navArgs import androidx.recyclerview.widget.LinearLayoutManager import com.google.android.material.snackbar.Snackbar import dagger.hilt.android.AndroidEntryPoint @@ -29,6 +31,10 @@ class SearchRestaurantLocationInfoFragment : Fragment() { private var _binding: FragmentSearchRestaurantLocationInfoBinding? = null private val binding get() = _binding!! private val viewModel: SearchRestaurantLocationInfoViewModel by viewModels() + + private val navArgs: SearchRestaurantLocationInfoFragmentArgs by navArgs() + private val groupId by lazy { navArgs.groupId } + private val adapter by lazy { RestaurantLocationInfoAdapter { viewLifecycleOwner.lifecycleScope.launch { @@ -36,8 +42,9 @@ class SearchRestaurantLocationInfoFragment : Fragment() { val action = SearchRestaurantLocationInfoFragmentDirections .actionSearchRestaurantLocationInfoFragmentToConfirmRestaurantRegistrationFragment( + groupId, canRegister, - it + it, ) findNavController().navigate(action) } diff --git a/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/viewmodel/RegisterRestaurantViewModel.kt b/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/viewmodel/RegisterRestaurantViewModel.kt index 2a051002..e540d895 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/viewmodel/RegisterRestaurantViewModel.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/restaurantregistration/viewmodel/RegisterRestaurantViewModel.kt @@ -154,6 +154,7 @@ class RegisterRestaurantViewModel @Inject constructor( fun registerRestaurant( pictures: List, + groupId: Int, restaurantLocationInfo: RestaurantLocationInfo, actionAfterRegisterSuccess: (String) -> Unit = {} ) { @@ -170,7 +171,8 @@ class RegisterRestaurantViewModel @Inject constructor( recommendMenu = recommendMenuListState.value.joinToString(" ") { "#$it" }, - restaurantLocationAggregateIdg = restaurantLocationInfoId + restaurantLocationAggregateIdg = restaurantLocationInfoId, + groupId = groupId, ) actionAfterRegisterSuccess(restaurantId) diff --git a/presentation/src/main/java/org/gdsc/presentation/view/webview/SpecificWebViewFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/webview/SpecificWebViewFragment.kt index bd7646cc..49579132 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/webview/SpecificWebViewFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/webview/SpecificWebViewFragment.kt @@ -57,7 +57,7 @@ class SpecificWebViewFragment : Fragment() { parentActivity.slideDownBottomNavigationView() }, { - parentActivity.navigateToEditRestaurantInfo(it) +// parentActivity.navigateToEditRestaurantInfo(it) }, { repeatWhenUiStarted { diff --git a/presentation/src/main/res/navigation/main_nav_graph.xml b/presentation/src/main/res/navigation/main_nav_graph.xml index c32fe705..3d0539c7 100644 --- a/presentation/src/main/res/navigation/main_nav_graph.xml +++ b/presentation/src/main/res/navigation/main_nav_graph.xml @@ -16,6 +16,9 @@ + + + + + + + + + + + + + From 7eea4e4d3cf317eff1b7302e3bd71f60474f9af0 Mon Sep 17 00:00:00 2001 From: swit-jim Date: Sat, 16 Mar 2024 20:56:45 +0900 Subject: [PATCH 5/8] =?UTF-8?q?[fix/home=5Fdetail=5Faction]:=20=EC=8B=9D?= =?UTF-8?q?=EB=8B=B9=20=EB=93=B1=EB=A1=9D=20=EC=95=A1=EC=85=98=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/gdsc/presentation/view/home/HomeFragment.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt index e1d0ab6a..28979a24 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt @@ -321,14 +321,21 @@ class HomeFragment : Fragment(), ViewHolderBindListener { private fun setRestaurantListBottomSheet() { + + binding.registButton.setOnClickListener { + findNavController().navigate(HomeFragmentDirections.actionHomeFragmentToSearchRestaurantLocationInfoFragment( + viewModel.currentGroup.value?.groupId ?: 0 + )) + } binding.scrollUpButton.setOnClickListener { binding.recyclerView.scrollToPosition(0) } binding.registRestaurantButton.setOnClickListener { - // TODO : 식당 등록 버튼 클릭 시 동작 정의 필요 - Log.d("testLog", "식당 등록 버튼 클릭") + findNavController().navigate(HomeFragmentDirections.actionHomeFragmentToSearchRestaurantLocationInfoFragment( + viewModel.currentGroup.value?.groupId ?: 0 + )) } restaurantListAdapter.addLoadStateListener { loadState -> From 1043c82f245e6cbc0397c857d58efec72a248d14 Mon Sep 17 00:00:00 2001 From: swit-jim Date: Sat, 16 Mar 2024 21:34:09 +0900 Subject: [PATCH 6/8] =?UTF-8?q?[fix/home=5Fdetail=5Faction]:=20=EB=B7=B0?= =?UTF-8?q?=20Visible=20=EC=A0=9C=EC=95=BD=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EB=AF=B8=EC=A0=81=EC=9A=A9=20=EC=9D=B4=EC=8A=88=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/gdsc/presentation/view/home/HomeFragment.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt index 28979a24..fbb15d17 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt @@ -103,7 +103,6 @@ class HomeFragment : Fragment(), ViewHolderBindListener { private lateinit var concatAdapter: ConcatAdapter private val recommendPopularRestaurantList = listOf() - private val standardBottomSheetBehavior by lazy { BottomSheetBehavior.from(binding.bottomSheet) } override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -338,6 +337,9 @@ class HomeFragment : Fragment(), ViewHolderBindListener { )) } + + val standardBottomSheetBehavior by lazy { BottomSheetBehavior.from(binding.bottomSheet) } + restaurantListAdapter.addLoadStateListener { loadState -> if (loadState.append.endOfPaginationReached) { if (restaurantListAdapter.itemCount < 1) { @@ -392,12 +394,6 @@ class HomeFragment : Fragment(), ViewHolderBindListener { override fun onSlide(bottomSheet: View, slideOffset: Float) {} }) - - CoroutineScope(Dispatchers.Main).launch { - delay(1000) - if (standardBottomSheetBehavior.state != BottomSheetBehavior.STATE_COLLAPSED) - standardBottomSheetBehavior.state = BottomSheetBehavior.STATE_HALF_EXPANDED - } } private fun observeState() { From 8da7ee80311f696c3ba4b9a775fe11b2375b2fa9 Mon Sep 17 00:00:00 2001 From: swit-jim Date: Sat, 16 Mar 2024 21:47:55 +0900 Subject: [PATCH 7/8] =?UTF-8?q?[fix/home=5Fdetail=5Faction]:=20=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=EB=B2=84=20=EB=A7=B5=20=EA=B9=A8=EC=A7=90=20=EC=9D=B4?= =?UTF-8?q?=EC=8A=88=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/view/home/HomeFragment.kt | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt index fbb15d17..f978a26b 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt @@ -3,7 +3,6 @@ package org.gdsc.presentation.view.home import android.content.Intent import android.graphics.PointF import android.os.Bundle -import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -26,9 +25,6 @@ import com.naver.maps.map.CameraUpdate import com.naver.maps.map.MapView import com.naver.maps.map.Projection import dagger.hilt.android.AndroidEntryPoint -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.delay import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import org.gdsc.domain.DrinkPossibility @@ -472,8 +468,40 @@ class HomeFragment : Fragment(), ViewHolderBindListener { } } + + override fun onStart() { + super.onStart() + mapView.onStart() + } + + override fun onResume() { + super.onResume() + mapView.onResume() + } + + override fun onPause() { + super.onPause() + mapView.onPause() + } + + override fun onSaveInstanceState(outState: Bundle) { + super.onSaveInstanceState(outState) + mapView.onSaveInstanceState(outState) + } + + override fun onStop() { + super.onStop() + mapView.onStop() + } + + override fun onLowMemory() { + super.onLowMemory() + mapView.onLowMemory() + } + override fun onDestroyView() { _binding = null super.onDestroyView() + mapView.onDestroy() } } \ No newline at end of file From 5594396797c6b91272e3dd184ad4e2c6ac1ab390 Mon Sep 17 00:00:00 2001 From: swit-jim Date: Sat, 16 Mar 2024 22:01:53 +0900 Subject: [PATCH 8/8] =?UTF-8?q?[fix/home=5Fdetail=5Faction]:=20=EC=A0=84?= =?UTF-8?q?=EC=B2=B4=20=EA=B2=80=EC=83=89=20=ED=99=94=EB=A9=B4=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99=20=EB=B2=84=ED=8A=BC=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/gdsc/presentation/view/home/HomeFragment.kt | 7 +++++++ presentation/src/main/res/layout/fragment_home.xml | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt index f978a26b..859d37fd 100644 --- a/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt +++ b/presentation/src/main/java/org/gdsc/presentation/view/home/HomeFragment.kt @@ -135,6 +135,7 @@ class HomeFragment : Fragment(), ViewHolderBindListener { setRestaurantListBottomSheet() setGroup() + setView() } @@ -175,6 +176,12 @@ class HomeFragment : Fragment(), ViewHolderBindListener { } } } + + private fun setView() { + binding.groupSearch.setOnClickListener { + findNavController().navigate(HomeFragmentDirections.actionHomeFragmentToAllSearchFragment()) + } + } private fun setGroup() { binding.groupArrow.setOnClickListener { diff --git a/presentation/src/main/res/layout/fragment_home.xml b/presentation/src/main/res/layout/fragment_home.xml index 959a44f5..49bdf6d8 100644 --- a/presentation/src/main/res/layout/fragment_home.xml +++ b/presentation/src/main/res/layout/fragment_home.xml @@ -13,7 +13,7 @@ android:layout_width="match_parent" android:layout_height="65dp" android:layout_weight="0" - android:paddingHorizontal="@dimen/default_spacing" + android:paddingStart="@dimen/default_spacing" android:background="@color/white">