From 3cf91f04e4e25d4001341e9fa19d2c052cf62a66 Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Sat, 18 Jan 2025 18:44:29 +0900 Subject: [PATCH 01/20] =?UTF-8?q?feat:=20=EC=95=BD=EC=86=8D=20=EC=B0=B8?= =?UTF-8?q?=EC=97=AC,=20=EC=95=BD=EC=86=8D=20=EC=95=84=EC=9D=B4=ED=85=9C?= =?UTF-8?q?=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C=20=EC=95=BD=EC=86=8D=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=ED=99=94=EB=A9=B4=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mulberry/ody/presentation/join/MeetingJoinActivity.kt | 3 ++- .../mulberry/ody/presentation/meetings/MeetingsActivity.kt | 6 ++++-- .../ody/presentation/notification/FCMNotification.kt | 4 ++-- .../mulberry/ody/presentation/room/MeetingRoomActivity.kt | 7 +++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/join/MeetingJoinActivity.kt b/android/app/src/main/java/com/mulberry/ody/presentation/join/MeetingJoinActivity.kt index 12f3cc841..0ec7a93fb 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/join/MeetingJoinActivity.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/join/MeetingJoinActivity.kt @@ -18,6 +18,7 @@ import com.mulberry.ody.presentation.common.listener.BackListener import com.mulberry.ody.presentation.common.listener.NextListener import com.mulberry.ody.presentation.join.complete.JoinCompleteActivity import com.mulberry.ody.presentation.room.MeetingRoomActivity +import com.mulberry.ody.presentation.room.MeetingRoomActivity.Companion.NAVIGATE_TO_DETAIL_MEETING import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject @@ -90,7 +91,7 @@ class MeetingJoinActivity : MeetingRoomActivity.getIntent( this, meetingId, - MeetingRoomActivity.NAVIGATE_TO_NOTIFICATION_LOG, + NAVIGATE_TO_DETAIL_MEETING, ) startActivity(intent) finish() diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/meetings/MeetingsActivity.kt b/android/app/src/main/java/com/mulberry/ody/presentation/meetings/MeetingsActivity.kt index 64a8ba5b6..6decf10f3 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/meetings/MeetingsActivity.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/meetings/MeetingsActivity.kt @@ -19,6 +19,8 @@ import com.mulberry.ody.presentation.login.LoginActivity import com.mulberry.ody.presentation.meetings.adapter.MeetingsAdapter import com.mulberry.ody.presentation.meetings.listener.MeetingsListener import com.mulberry.ody.presentation.room.MeetingRoomActivity +import com.mulberry.ody.presentation.room.MeetingRoomActivity.Companion.NAVIGATE_TO_DETAIL_MEETING +import com.mulberry.ody.presentation.room.MeetingRoomActivity.Companion.NAVIGATE_TO_ETA_DASHBOARD import com.mulberry.ody.presentation.setting.SettingActivity import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject @@ -116,7 +118,7 @@ class MeetingsActivity : MeetingRoomActivity.getIntent( this, meetingId, - MeetingRoomActivity.NAVIGATE_TO_NOTIFICATION_LOG, + NAVIGATE_TO_DETAIL_MEETING, ) startActivity(intent) } @@ -126,7 +128,7 @@ class MeetingsActivity : MeetingRoomActivity.getIntent( this, meetingId, - MeetingRoomActivity.NAVIGATE_TO_ETA_DASHBOARD, + NAVIGATE_TO_ETA_DASHBOARD, ) startActivity(intent) } diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/notification/FCMNotification.kt b/android/app/src/main/java/com/mulberry/ody/presentation/notification/FCMNotification.kt index 20b89b8a4..c81ae0611 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/notification/FCMNotification.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/notification/FCMNotification.kt @@ -12,8 +12,8 @@ import com.mulberry.ody.data.local.db.OdyDatastore import com.mulberry.ody.domain.model.NotificationType import com.mulberry.ody.presentation.meetings.MeetingsActivity import com.mulberry.ody.presentation.room.MeetingRoomActivity +import com.mulberry.ody.presentation.room.MeetingRoomActivity.Companion.NAVIGATE_TO_DETAIL_MEETING import com.mulberry.ody.presentation.room.MeetingRoomActivity.Companion.NAVIGATE_TO_ETA_DASHBOARD -import com.mulberry.ody.presentation.room.MeetingRoomActivity.Companion.NAVIGATE_TO_NOTIFICATION_LOG import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.first @@ -93,7 +93,7 @@ class FCMNotification ): PendingIntent? { val navigationTarget = when (type) { - NotificationType.ENTRY, NotificationType.DEPARTURE_REMINDER -> NAVIGATE_TO_NOTIFICATION_LOG + NotificationType.ENTRY, NotificationType.DEPARTURE_REMINDER -> NAVIGATE_TO_DETAIL_MEETING NotificationType.NUDGE, NotificationType.ETA_NOTICE -> NAVIGATE_TO_ETA_DASHBOARD NotificationType.DEFAULT -> "" } diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt index bab4ff575..048c33621 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt @@ -12,6 +12,7 @@ import com.mulberry.ody.databinding.ActivityMeetingRoomBinding import com.mulberry.ody.presentation.collectWhenStarted import com.mulberry.ody.presentation.common.binding.BindingActivity import com.mulberry.ody.presentation.common.listener.BackListener +import com.mulberry.ody.presentation.room.detail.DetailMeetingFragment import com.mulberry.ody.presentation.room.etadashboard.EtaDashboardFragment import com.mulberry.ody.presentation.room.log.NotificationLogFragment import dagger.hilt.android.AndroidEntryPoint @@ -30,6 +31,7 @@ class MeetingRoomActivity : private val fragments: Map by lazy { mapOf( + NAVIGATE_TO_DETAIL_MEETING to DetailMeetingFragment(), NAVIGATE_TO_ETA_DASHBOARD to EtaDashboardFragment(), NAVIGATE_TO_NOTIFICATION_LOG to NotificationLogFragment(), ) @@ -102,14 +104,15 @@ class MeetingRoomActivity : private fun getMeetingId(): Long = intent.getLongExtra(MEETING_ID_KEY, MEETING_ID_DEFAULT_VALUE) - private fun getNavigateView(): String = intent.getStringExtra(NAVIGATE_VIEW_KEY) ?: NAVIGATE_TO_NOTIFICATION_LOG + private fun getNavigateView(): String = intent.getStringExtra(NAVIGATE_VIEW_KEY) ?: NAVIGATE_TO_DETAIL_MEETING companion object { private const val MEETING_ID_KEY = "meeting_id" private const val MEETING_ID_DEFAULT_VALUE = -1L private const val NAVIGATE_VIEW_KEY = "navigate_view" + const val NAVIGATE_TO_DETAIL_MEETING = "detail_meeting" const val NAVIGATE_TO_ETA_DASHBOARD = "eta_dashboard" - const val NAVIGATE_TO_NOTIFICATION_LOG = "notification_log" + private const val NAVIGATE_TO_NOTIFICATION_LOG = "notification_log" fun getIntent( context: Context, From 945537e239f82b3a8bdb58c1e75af3492c3210bd Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Sat, 18 Jan 2025 18:54:58 +0900 Subject: [PATCH 02/20] =?UTF-8?q?feat:=20=ED=88=B4=EB=B0=94=20=EB=82=98?= =?UTF-8?q?=EA=B0=80=EA=B8=B0=20=EB=8B=A4=EC=9D=B4=EC=96=BC=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ody/presentation/room/MeetingRoomActivity.kt | 12 +++++++++++- .../room/detail/DetailMeetingFragment.kt | 12 ++++++++++-- .../room/log/NotificationLogFragment.kt | 14 ++------------ .../main/res/layout/fragment_detail_meeting.xml | 15 ++++++++++++++- .../main/res/layout/fragment_notification_log.xml | 1 + 5 files changed, 38 insertions(+), 16 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt index 048c33621..99d3be2b4 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt @@ -14,6 +14,8 @@ import com.mulberry.ody.presentation.common.binding.BindingActivity import com.mulberry.ody.presentation.common.listener.BackListener import com.mulberry.ody.presentation.room.detail.DetailMeetingFragment import com.mulberry.ody.presentation.room.etadashboard.EtaDashboardFragment +import com.mulberry.ody.presentation.room.listener.MeetingRoomListener +import com.mulberry.ody.presentation.room.log.ExitMeetingRoomDialog import com.mulberry.ody.presentation.room.log.NotificationLogFragment import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject @@ -21,7 +23,8 @@ import javax.inject.Inject @AndroidEntryPoint class MeetingRoomActivity : BindingActivity(R.layout.activity_meeting_room), - BackListener { + BackListener, + MeetingRoomListener { @Inject lateinit var viewModelFactory: MeetingRoomViewModel.MeetingViewModelFactory @@ -106,9 +109,16 @@ class MeetingRoomActivity : private fun getNavigateView(): String = intent.getStringExtra(NAVIGATE_VIEW_KEY) ?: NAVIGATE_TO_DETAIL_MEETING + override fun onExitMeetingRoom() { + ExitMeetingRoomDialog().show(supportFragmentManager, EXIT_MEETING_ROOM_DIALOG_TAG) + } + companion object { + private const val EXIT_MEETING_ROOM_DIALOG_TAG = "exitMeetingRoomDialog" + private const val MEETING_ID_KEY = "meeting_id" private const val MEETING_ID_DEFAULT_VALUE = -1L + private const val NAVIGATE_VIEW_KEY = "navigate_view" const val NAVIGATE_TO_DETAIL_MEETING = "detail_meeting" const val NAVIGATE_TO_ETA_DASHBOARD = "eta_dashboard" diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt index 723e2835e..288381acd 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt @@ -2,12 +2,17 @@ package com.mulberry.ody.presentation.room.detail import android.os.Bundle import android.view.View +import androidx.fragment.app.activityViewModels import com.mulberry.ody.R -import com.mulberry.ody.databinding.FragmentNotificationLogBinding +import com.mulberry.ody.databinding.FragmentDetailMeetingBinding import com.mulberry.ody.presentation.common.binding.BindingFragment +import com.mulberry.ody.presentation.room.MeetingRoomActivity +import com.mulberry.ody.presentation.room.MeetingRoomViewModel class DetailMeetingFragment : - BindingFragment(R.layout.fragment_detail_meeting) { + BindingFragment(R.layout.fragment_detail_meeting) { + private val viewModel: MeetingRoomViewModel by activityViewModels() + override fun onViewCreated( view: View, savedInstanceState: Bundle?, @@ -18,6 +23,9 @@ class DetailMeetingFragment : } fun initializeBinding() { + binding.vm = viewModel + binding.backListener = requireActivity() as MeetingRoomActivity + binding.meetingRoomListener = requireActivity() as MeetingRoomActivity } private fun initializeObserve() { diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt index dc19450a9..0266f12ee 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt @@ -10,13 +10,11 @@ import com.mulberry.ody.presentation.collectWhenStarted import com.mulberry.ody.presentation.common.binding.BindingFragment import com.mulberry.ody.presentation.room.MeetingRoomActivity import com.mulberry.ody.presentation.room.MeetingRoomViewModel -import com.mulberry.ody.presentation.room.listener.MeetingRoomListener import com.mulberry.ody.presentation.room.log.adapter.MatesAdapter import com.mulberry.ody.presentation.room.log.adapter.NotificationLogsAdapter class NotificationLogFragment : - BindingFragment(R.layout.fragment_notification_log), - MeetingRoomListener { + BindingFragment(R.layout.fragment_notification_log) { private val viewModel: MeetingRoomViewModel by activityViewModels() private val notificationLogsAdapter: NotificationLogsAdapter by lazy { NotificationLogsAdapter() } private val matesAdapter: MatesAdapter by lazy { MatesAdapter() } @@ -33,7 +31,7 @@ class NotificationLogFragment : fun initializeBinding() { binding.vm = viewModel binding.backListener = requireActivity() as MeetingRoomActivity - binding.meetingRoomListener = this + binding.meetingRoomListener = requireActivity() as MeetingRoomActivity binding.rvNotificationLog.adapter = notificationLogsAdapter } @@ -58,12 +56,4 @@ class NotificationLogFragment : } } } - - override fun onExitMeetingRoom() { - ExitMeetingRoomDialog().show(parentFragmentManager, EXIT_MEETING_ROOM_DIALOG_TAG) - } - - companion object { - private const val EXIT_MEETING_ROOM_DIALOG_TAG = "exitMeetingRoomDialog" - } } diff --git a/android/app/src/main/res/layout/fragment_detail_meeting.xml b/android/app/src/main/res/layout/fragment_detail_meeting.xml index 18f0c8f2f..414d3ec39 100644 --- a/android/app/src/main/res/layout/fragment_detail_meeting.xml +++ b/android/app/src/main/res/layout/fragment_detail_meeting.xml @@ -5,6 +5,17 @@ + + + + + + app:meetingRoomListener="@{meetingRoomListener}" + app:title="@{vm.meeting.name}" /> Date: Sat, 18 Jan 2025 20:01:37 +0900 Subject: [PATCH 03/20] =?UTF-8?q?feat:=20i=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=20=EC=8B=9C=20=EA=B0=80=EC=9D=B4=EB=93=9C=20?= =?UTF-8?q?=EB=9D=84=EC=9A=B0=EB=8A=94=20=EA=B8=B0=EB=8A=A5=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 --- .../common/DimensionExtensions.kt | 11 +++ .../detail/DetailMeetingBindingAdapter.kt | 16 +++++ .../room/detail/DetailMeetingFragment.kt | 70 ++++++++++++++++++- .../listener/DepartureTimeGuideListener.kt | 7 ++ .../EtaDashboardBindingAdapter.kt | 14 +--- .../res/layout/fragment_detail_meeting.xml | 27 ++++--- android/app/src/main/res/values/strings.xml | 2 +- 7 files changed, 121 insertions(+), 26 deletions(-) create mode 100644 android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt create mode 100644 android/app/src/main/java/com/mulberry/ody/presentation/room/detail/listener/DepartureTimeGuideListener.kt diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/common/DimensionExtensions.kt b/android/app/src/main/java/com/mulberry/ody/presentation/common/DimensionExtensions.kt index c201dc0f7..3b9321659 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/common/DimensionExtensions.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/common/DimensionExtensions.kt @@ -1,8 +1,19 @@ package com.mulberry.ody.presentation.common import android.content.Context +import android.graphics.Point +import android.view.View fun Int.toPixel(context: Context): Int { val density = context.resources.displayMetrics.density return (this * density).toInt() } + +fun View.getPointOnScreen(): Point { + val location = IntArray(2) + this.getLocationOnScreen(location) + return Point().apply { + x = location[0] + y = location[1] + } +} diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt new file mode 100644 index 000000000..9ad2e31e5 --- /dev/null +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt @@ -0,0 +1,16 @@ +package com.mulberry.ody.presentation.room.detail + +import android.widget.ImageView +import androidx.databinding.BindingAdapter +import com.mulberry.ody.presentation.common.getPointOnScreen +import com.mulberry.ody.presentation.room.detail.listener.DepartureTimeGuideListener + +@BindingAdapter("onClickDepartureTimeGuide") +fun ImageView.setOnClickDepartureTimeGuide( + missingToolTipListener: DepartureTimeGuideListener, +) { + setOnClickListener { + val point = this.getPointOnScreen() + missingToolTipListener.toggleDepartureTimeGuide(point) + } +} diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt index 288381acd..722f64928 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt @@ -1,17 +1,29 @@ package com.mulberry.ody.presentation.room.detail +import android.app.Activity +import android.content.Context.LAYOUT_INFLATER_SERVICE +import android.graphics.Point import android.os.Bundle +import android.view.Gravity +import android.view.LayoutInflater import android.view.View +import android.view.ViewGroup +import android.widget.PopupWindow import androidx.fragment.app.activityViewModels import com.mulberry.ody.R import com.mulberry.ody.databinding.FragmentDetailMeetingBinding +import com.mulberry.ody.databinding.LayoutDepartureTimeTooltipBinding import com.mulberry.ody.presentation.common.binding.BindingFragment +import com.mulberry.ody.presentation.common.toPixel import com.mulberry.ody.presentation.room.MeetingRoomActivity import com.mulberry.ody.presentation.room.MeetingRoomViewModel +import com.mulberry.ody.presentation.room.detail.listener.DepartureTimeGuideListener class DetailMeetingFragment : - BindingFragment(R.layout.fragment_detail_meeting) { + BindingFragment(R.layout.fragment_detail_meeting), + DepartureTimeGuideListener { private val viewModel: MeetingRoomViewModel by activityViewModels() + private val parentActivity: Activity by lazy { requireActivity() } override fun onViewCreated( view: View, @@ -24,10 +36,62 @@ class DetailMeetingFragment : fun initializeBinding() { binding.vm = viewModel - binding.backListener = requireActivity() as MeetingRoomActivity - binding.meetingRoomListener = requireActivity() as MeetingRoomActivity + binding.backListener = parentActivity as MeetingRoomActivity + binding.meetingRoomListener = parentActivity as MeetingRoomActivity + binding.departureTimeGuideListener = this } private fun initializeObserve() { } + + override fun toggleDepartureTimeGuide(point: Point) { + val inflater = parentActivity.getSystemService(LAYOUT_INFLATER_SERVICE) as LayoutInflater + val parentViewGroup = parentActivity.findViewById(android.R.id.content) + val binding = LayoutDepartureTimeTooltipBinding.inflate(inflater, parentViewGroup, false) + val popupView = binding.root + + popupView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED) + + val adjustedPoint = calculateDepartureTimeGuidePoint(popupView, point) + showPopup(adjustedPoint, popupView, parentActivity.window.decorView) + } + + private fun calculateDepartureTimeGuidePoint( + popupView: View, + guideButtonPoint: Point + ): Point { + val popupHeight = popupView.measuredHeight + + val guideButtonWidthPixel = GUIDE_BUTTON_WIDTH.toPixel(binding.root.context) + val guideButtonPaddingPixel = GUIDE_BUTTON_PADDING.toPixel(binding.root.context) + val adjustedX = guideButtonPoint.x + guideButtonWidthPixel + guideButtonPaddingPixel + val adjustedY = guideButtonPoint.y - popupHeight + guideButtonPaddingPixel + + return Point(adjustedX, adjustedY) + } + + private fun showPopup( + point: Point, + popupView: View, + decorView: View, + ) { + val popupWindow = + PopupWindow( + popupView, + ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.WRAP_CONTENT, + true, + ) + popupWindow.showAtLocation( + decorView, + Gravity.NO_GRAVITY, + point.x, + point.y, + ) + } + + companion object { + private const val GUIDE_BUTTON_PADDING = 5 + private const val GUIDE_BUTTON_WIDTH = 12 + } } diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/listener/DepartureTimeGuideListener.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/listener/DepartureTimeGuideListener.kt new file mode 100644 index 000000000..d860cb760 --- /dev/null +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/listener/DepartureTimeGuideListener.kt @@ -0,0 +1,7 @@ +package com.mulberry.ody.presentation.room.detail.listener + +import android.graphics.Point + +interface DepartureTimeGuideListener { + fun toggleDepartureTimeGuide(point: Point) +} diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/etadashboard/EtaDashboardBindingAdapter.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/etadashboard/EtaDashboardBindingAdapter.kt index 5d13d8d7b..3cc2c5c9e 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/etadashboard/EtaDashboardBindingAdapter.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/etadashboard/EtaDashboardBindingAdapter.kt @@ -1,12 +1,11 @@ package com.mulberry.ody.presentation.room.etadashboard -import android.graphics.Point -import android.view.View import android.view.animation.AnimationUtils import android.widget.TextView import androidx.core.content.ContextCompat import androidx.databinding.BindingAdapter import com.mulberry.ody.R +import com.mulberry.ody.presentation.common.getPointOnScreen import com.mulberry.ody.presentation.common.listener.setOnSingleClickListener import com.mulberry.ody.presentation.room.etadashboard.listener.MissingToolTipListener import com.mulberry.ody.presentation.room.etadashboard.listener.NudgeListener @@ -29,7 +28,7 @@ fun TextView.setOnClickMissingTooltip( isUserSelf: Boolean, missingToolTipListener: MissingToolTipListener, ) { - setOnSingleClickListener { + setOnClickListener { val point = this.getPointOnScreen() missingToolTipListener.onClickMissingToolTipListener(point, isUserSelf) } @@ -65,12 +64,3 @@ fun TextView.setOnClickNudge( } } } - -private fun View.getPointOnScreen(): Point { - val location = IntArray(2) - this.getLocationOnScreen(location) - return Point().apply { - x = location[0] - y = location[1] - } -} diff --git a/android/app/src/main/res/layout/fragment_detail_meeting.xml b/android/app/src/main/res/layout/fragment_detail_meeting.xml index 414d3ec39..7b57d475c 100644 --- a/android/app/src/main/res/layout/fragment_detail_meeting.xml +++ b/android/app/src/main/res/layout/fragment_detail_meeting.xml @@ -16,6 +16,11 @@ + + + + app:layout_constraintBottom_toBottomOf="@id/detail_meeting_departure_time_title" + app:layout_constraintStart_toEndOf="@id/detail_meeting_departure_time_title" + app:layout_constraintTop_toTopOf="@id/detail_meeting_departure_time_title" + app:onClickDepartureTimeGuide="@{departureTimeGuideListener}" /> 약속 장소 출발 장소 늦지 않으려면 - 출발 시간은 대중교통 지연 등을 고려해\n 여유 있게 알려드리고 있어요. + 출발 시간은 대중교통 지연 등을 고려해\n여유 있게 알려드리고 있어요. %s에 나가야 해요.\n출발 장소부터 약속 장소까지 %s걸려요. 약속 로그 친구를 초대해 보세요! From d32164306d2f9ae87e103d23bef2bec8aa657138 Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Sun, 19 Jan 2025 19:15:16 +0900 Subject: [PATCH 04/20] =?UTF-8?q?feat:=20=EA=B0=80=EC=9A=B4=EB=8D=B0=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=20=EC=8B=9C=20=EC=98=A4=EB=94=94/=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=EB=B2=84=ED=8A=BC=20=EB=82=98=EC=98=A4=EB=8A=94=20?= =?UTF-8?q?=EA=B8=B0=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 --- .../presentation/room/MeetingRoomViewModel.kt | 7 +++++++ .../selector_detail_meeting_button.xml | 2 +- .../res/layout/fragment_detail_meeting.xml | 20 ++++++++++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt index abe9738c0..7baf8effc 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt @@ -104,6 +104,9 @@ class MeetingRoomViewModel private val matesNudgeTimes: MutableMap = mutableMapOf() + private val _isVisibleNavigation: MutableStateFlow = MutableStateFlow(false) + val isVisibleNavigation: StateFlow get() = _isVisibleNavigation + init { fetchMeeting() } @@ -288,6 +291,10 @@ class MeetingRoomViewModel } } + fun handleNavigationVisibility() { + _isVisibleNavigation.value = !_isVisibleNavigation.value + } + @AssistedFactory interface MeetingViewModelFactory { fun create(meetingId: Long): MeetingRoomViewModel diff --git a/android/app/src/main/res/drawable/selector_detail_meeting_button.xml b/android/app/src/main/res/drawable/selector_detail_meeting_button.xml index 0408887be..2c2f99631 100644 --- a/android/app/src/main/res/drawable/selector_detail_meeting_button.xml +++ b/android/app/src/main/res/drawable/selector_detail_meeting_button.xml @@ -1,5 +1,5 @@ - + diff --git a/android/app/src/main/res/layout/fragment_detail_meeting.xml b/android/app/src/main/res/layout/fragment_detail_meeting.xml index 7b57d475c..de6605416 100644 --- a/android/app/src/main/res/layout/fragment_detail_meeting.xml +++ b/android/app/src/main/res/layout/fragment_detail_meeting.xml @@ -193,7 +193,9 @@ android:paddingVertical="6dp" app:layout_constraintBottom_toBottomOf="@id/btn_detail_meeting" app:layout_constraintEnd_toStartOf="@id/btn_detail_meeting" - app:layout_constraintTop_toTopOf="@id/btn_detail_meeting"> + app:layout_constraintTop_toTopOf="@id/btn_detail_meeting" + app:visibility="@{vm.isVisibleNavigation}" + tools:visibility="visible"> + + + app:layout_constraintTop_toTopOf="@id/btn_detail_meeting" + app:visibility="@{vm.isVisibleNavigation}" + tools:visibility="visible"> Date: Sun, 19 Jan 2025 19:29:42 +0900 Subject: [PATCH 05/20] =?UTF-8?q?feat:=20=EC=98=A4=EB=94=94/=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=EB=B2=84=ED=8A=BC=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C?= =?UTF-8?q?=20=ED=99=94=EB=A9=B4=20=EC=9D=B4=EB=8F=99=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/room/MeetingRoomActivity.kt | 9 +++++++-- .../room/MeetingRoomNavigateAction.kt | 7 +++++++ .../presentation/room/MeetingRoomViewModel.kt | 18 ++++++++++++++---- .../res/layout/fragment_detail_meeting.xml | 5 ++++- .../res/layout/fragment_notification_log.xml | 1 + 5 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomNavigateAction.kt diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt index 99d3be2b4..3382586c3 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt @@ -59,8 +59,13 @@ class MeetingRoomActivity : private fun initializeObserve() { onBackPressedDispatcher.addCallback(this, onBackPressedCallback) - collectWhenStarted(viewModel.navigateToEtaDashboardEvent) { - addFragment(EtaDashboardFragment()) + collectWhenStarted(viewModel.navigationEvent) { + val fragment = + when (it) { + MeetingRoomNavigateAction.NavigateToEtaDashboard -> fragments[NAVIGATE_TO_ETA_DASHBOARD] + MeetingRoomNavigateAction.NavigateToNotificationLog -> fragments[NAVIGATE_TO_NOTIFICATION_LOG] + } ?: return@collectWhenStarted + addFragment(fragment) } collectWhenStarted(viewModel.networkErrorEvent) { showRetrySnackBar { viewModel.retryLastAction() } diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomNavigateAction.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomNavigateAction.kt new file mode 100644 index 000000000..512d9090a --- /dev/null +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomNavigateAction.kt @@ -0,0 +1,7 @@ +package com.mulberry.ody.presentation.room + +sealed interface MeetingRoomNavigateAction { + data object NavigateToEtaDashboard : MeetingRoomNavigateAction + + data object NavigateToNotificationLog : MeetingRoomNavigateAction +} diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt index 7baf8effc..9b5a86ce2 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt @@ -84,8 +84,8 @@ class MeetingRoomViewModel private val _notificationLogs = MutableStateFlow>(listOf()) val notificationLogs: StateFlow> = _notificationLogs.asStateFlow() - private val _navigateToEtaDashboardEvent: MutableSharedFlow = MutableSharedFlow() - val navigateToEtaDashboardEvent: SharedFlow get() = _navigateToEtaDashboardEvent.asSharedFlow() + private val _navigationEvent: MutableSharedFlow = MutableSharedFlow() + val navigationEvent: SharedFlow get() = _navigationEvent.asSharedFlow() private val _nudgeSuccessMate: MutableSharedFlow = MutableSharedFlow() val nudgeSuccessMate: SharedFlow get() = _nudgeSuccessMate.asSharedFlow() @@ -201,13 +201,23 @@ class MeetingRoomViewModel fun navigateToEtaDashboard() { viewModelScope.launch { analyticsHelper.logButtonClicked( - eventName = "eta_button_from_notification_log", + eventName = "navigate_to_eta_dashboard", location = TAG, ) - _navigateToEtaDashboardEvent.emit(Unit) + _navigationEvent.emit(MeetingRoomNavigateAction.NavigateToEtaDashboard) } } + fun navigateToNotificationLog() { + viewModelScope.launch { + analyticsHelper.logButtonClicked( + eventName = "navigate_to_notification_log", + location = TAG, + ) + _navigationEvent.emit(MeetingRoomNavigateAction.NavigateToNotificationLog) + } + } + fun shareEtaDashboard( title: String, buttonTitle: String, diff --git a/android/app/src/main/res/layout/fragment_detail_meeting.xml b/android/app/src/main/res/layout/fragment_detail_meeting.xml index de6605416..1d343bf7a 100644 --- a/android/app/src/main/res/layout/fragment_detail_meeting.xml +++ b/android/app/src/main/res/layout/fragment_detail_meeting.xml @@ -25,7 +25,8 @@ + android:layout_height="match_parent" + android:background="@color/primary"> @@ -250,6 +252,7 @@ app:layout_constraintBottom_toBottomOf="@id/btn_detail_meeting" app:layout_constraintStart_toEndOf="@id/btn_detail_meeting" app:layout_constraintTop_toTopOf="@id/btn_detail_meeting" + app:onSingleClick="@{() -> vm.navigateToNotificationLog()}" app:visibility="@{vm.isVisibleNavigation}" tools:visibility="visible"> diff --git a/android/app/src/main/res/layout/fragment_notification_log.xml b/android/app/src/main/res/layout/fragment_notification_log.xml index 1d102b0dc..45a9d8d08 100644 --- a/android/app/src/main/res/layout/fragment_notification_log.xml +++ b/android/app/src/main/res/layout/fragment_notification_log.xml @@ -21,6 +21,7 @@ Date: Sun, 19 Jan 2025 19:33:43 +0900 Subject: [PATCH 06/20] =?UTF-8?q?feat:=2030=EB=B6=84=20=EC=A0=84=EC=97=90?= =?UTF-8?q?=EB=A7=8C=20=EC=98=A4=EB=94=94=20=EB=B2=84=ED=8A=BC=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EA=B8=B0=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 --- .../ody/presentation/meetings/MeetingsActivity.kt | 2 +- .../mulberry/ody/presentation/room/MeetingRoomActivity.kt | 3 +++ .../ody/presentation/room/MeetingRoomViewModel.kt | 8 ++++++++ android/app/src/main/res/values/strings.xml | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/meetings/MeetingsActivity.kt b/android/app/src/main/java/com/mulberry/ody/presentation/meetings/MeetingsActivity.kt index 6decf10f3..78861fd1c 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/meetings/MeetingsActivity.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/meetings/MeetingsActivity.kt @@ -139,7 +139,7 @@ class MeetingsActivity : } override fun guideItemDisabled() { - showSnackBar(R.string.meetings_entrance_unavailable_guide) + showSnackBar(R.string.inaccessible_eta_guide) } override fun onClickSetting() { diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt index 3382586c3..b60c4a296 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomActivity.kt @@ -83,6 +83,9 @@ class MeetingRoomActivity : } hideLoadingDialog() } + collectWhenStarted(viewModel.inaccessibleEtaEvent) { + showSnackBar(R.string.inaccessible_eta_guide) + } } private fun initializeFragment() { diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt index 9b5a86ce2..458d02a16 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt @@ -107,6 +107,9 @@ class MeetingRoomViewModel private val _isVisibleNavigation: MutableStateFlow = MutableStateFlow(false) val isVisibleNavigation: StateFlow get() = _isVisibleNavigation + private val _inaccessibleEtaEvent: MutableSharedFlow = MutableSharedFlow() + val inaccessibleEtaEvent: SharedFlow get() = _inaccessibleEtaEvent + init { fetchMeeting() } @@ -200,6 +203,11 @@ class MeetingRoomViewModel fun navigateToEtaDashboard() { viewModelScope.launch { + if (!meeting.value.isEtaAccessible) { + _inaccessibleEtaEvent.emit(Unit) + return@launch + } + analyticsHelper.logButtonClicked( eventName = "navigate_to_eta_dashboard", location = TAG, diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 6b63619c0..e50e8aad5 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -39,7 +39,6 @@ 알림 권한을 거절하실 경우 푸시 알람을 받으실 수 없어요 알림 권한은 앱 설정에서 확인할 수 있어요 위치 권한을 거절하면 내 위치를 친구에게 공유할 수 없어요 - 약속 시간 30분 전부터 실시간 위치를 확인할 수 있어요 "앱을 종료하려면 뒤로 가기를 한 번 더 눌려주세요." 약속 만들기 약속 참여하기 @@ -183,6 +182,7 @@ 현재 위치를 가져올 수 없어요. 잠시 후 다시 시도해 주세요. 오류가 발생했습니다. 잠시 후 다시 시도해 주세요. 네트워크 연결 확인 후 다시 시도해 주세요. + 약속 시간 30분 전부터 실시간 위치를 확인할 수 있어요 재시도 오디? From 4cef0a6b50c8c084fe635304bf6301f23a597e54 Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Sun, 19 Jan 2025 19:34:14 +0900 Subject: [PATCH 07/20] =?UTF-8?q?style:=20ktLint=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ody/presentation/room/MeetingRoomViewModel.kt | 10 +++++----- .../room/detail/DetailMeetingBindingAdapter.kt | 4 +--- .../presentation/room/detail/DetailMeetingFragment.kt | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt index 458d02a16..0aa410ebb 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt @@ -104,7 +104,7 @@ class MeetingRoomViewModel private val matesNudgeTimes: MutableMap = mutableMapOf() - private val _isVisibleNavigation: MutableStateFlow = MutableStateFlow(false) + private val _isVisibleNavigation: MutableStateFlow = MutableStateFlow(false) val isVisibleNavigation: StateFlow get() = _isVisibleNavigation private val _inaccessibleEtaEvent: MutableSharedFlow = MutableSharedFlow() @@ -224,7 +224,7 @@ class MeetingRoomViewModel ) _navigationEvent.emit(MeetingRoomNavigateAction.NavigateToNotificationLog) } - } + } fun shareEtaDashboard( title: String, @@ -309,9 +309,9 @@ class MeetingRoomViewModel } } - fun handleNavigationVisibility() { - _isVisibleNavigation.value = !_isVisibleNavigation.value - } + fun handleNavigationVisibility() { + _isVisibleNavigation.value = !_isVisibleNavigation.value + } @AssistedFactory interface MeetingViewModelFactory { diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt index 9ad2e31e5..ae56eb9d4 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt @@ -6,9 +6,7 @@ import com.mulberry.ody.presentation.common.getPointOnScreen import com.mulberry.ody.presentation.room.detail.listener.DepartureTimeGuideListener @BindingAdapter("onClickDepartureTimeGuide") -fun ImageView.setOnClickDepartureTimeGuide( - missingToolTipListener: DepartureTimeGuideListener, -) { +fun ImageView.setOnClickDepartureTimeGuide(missingToolTipListener: DepartureTimeGuideListener) { setOnClickListener { val point = this.getPointOnScreen() missingToolTipListener.toggleDepartureTimeGuide(point) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt index 722f64928..c26652610 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt @@ -58,7 +58,7 @@ class DetailMeetingFragment : private fun calculateDepartureTimeGuidePoint( popupView: View, - guideButtonPoint: Point + guideButtonPoint: Point, ): Point { val popupHeight = popupView.measuredHeight From c5481e8d050b5efef58e26d5fcb868c4567ff045 Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Sun, 19 Jan 2025 23:46:42 +0900 Subject: [PATCH 08/20] =?UTF-8?q?feat:=20=EC=95=BD=EC=86=8D=20=EC=B0=B8?= =?UTF-8?q?=EC=97=AC=EC=9E=90=EC=99=80=20=EC=B4=88=EB=8C=80=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=B3=B5=EC=82=AC=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/room/MeetingRoomViewModel.kt | 10 +-- .../room/detail/DetailMeetingFragment.kt | 13 ++++ .../room/detail/adapter/MatesAdapter.kt | 61 +++++++++++++++++++ .../room/detail/adapter/MatesViewHolder.kt | 23 +++++++ .../model/InviteCodeCopyInfo.kt | 2 +- .../model/MateUiModelMapper.kt | 2 +- .../room/detail/model/MatesUiModel.kt | 23 +++++++ .../model/MeetingDetailUiModel.kt | 2 +- .../model/MeetingDetailUiModelMapper.kt | 2 +- .../room/log/NotificationLogFragment.kt | 5 -- .../room/log/adapter/MateViewHolder.kt | 12 ---- .../room/log/adapter/MatesAdapter.kt | 39 ------------ .../room/log/model/MateUiModel.kt | 6 -- .../res/layout/fragment_detail_meeting.xml | 1 + .../main/res/layout/item_invite_code_copy.xml | 11 ++-- android/app/src/main/res/layout/item_mate.xml | 2 +- .../room/MeetingRoomViewModelTest.kt | 2 +- 17 files changed, 139 insertions(+), 77 deletions(-) create mode 100644 android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesAdapter.kt create mode 100644 android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesViewHolder.kt rename android/app/src/main/java/com/mulberry/ody/presentation/room/{log => detail}/model/InviteCodeCopyInfo.kt (60%) rename android/app/src/main/java/com/mulberry/ody/presentation/room/{log => detail}/model/MateUiModelMapper.kt (81%) create mode 100644 android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MatesUiModel.kt rename android/app/src/main/java/com/mulberry/ody/presentation/room/{log => detail}/model/MeetingDetailUiModel.kt (91%) rename android/app/src/main/java/com/mulberry/ody/presentation/room/{log => detail}/model/MeetingDetailUiModelMapper.kt (93%) delete mode 100644 android/app/src/main/java/com/mulberry/ody/presentation/room/log/adapter/MateViewHolder.kt delete mode 100644 android/app/src/main/java/com/mulberry/ody/presentation/room/log/adapter/MatesAdapter.kt delete mode 100644 android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MateUiModel.kt diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt index 0aa410ebb..ab03af567 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt @@ -25,12 +25,12 @@ import com.mulberry.ody.presentation.common.image.ImageShareHelper import com.mulberry.ody.presentation.room.etadashboard.listener.NudgeListener import com.mulberry.ody.presentation.room.etadashboard.model.MateEtaUiModel import com.mulberry.ody.presentation.room.etadashboard.model.toMateEtaUiModels -import com.mulberry.ody.presentation.room.log.model.InviteCodeCopyInfo -import com.mulberry.ody.presentation.room.log.model.MateUiModel -import com.mulberry.ody.presentation.room.log.model.MeetingDetailUiModel +import com.mulberry.ody.presentation.room.detail.model.InviteCodeCopyInfo +import com.mulberry.ody.presentation.room.detail.model.MateUiModel +import com.mulberry.ody.presentation.room.detail.model.MeetingDetailUiModel import com.mulberry.ody.presentation.room.log.model.NotificationLogUiModel -import com.mulberry.ody.presentation.room.log.model.toMateUiModels -import com.mulberry.ody.presentation.room.log.model.toMeetingUiModel +import com.mulberry.ody.presentation.room.detail.model.toMateUiModels +import com.mulberry.ody.presentation.room.detail.model.toMeetingUiModel import com.mulberry.ody.presentation.room.log.model.toNotificationUiModels import dagger.assisted.Assisted import dagger.assisted.AssistedFactory diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt index c26652610..4aa9cdeae 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt @@ -4,26 +4,34 @@ import android.app.Activity import android.content.Context.LAYOUT_INFLATER_SERVICE import android.graphics.Point import android.os.Bundle +import android.util.Log import android.view.Gravity import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.PopupWindow import androidx.fragment.app.activityViewModels +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import com.mulberry.ody.R import com.mulberry.ody.databinding.FragmentDetailMeetingBinding import com.mulberry.ody.databinding.LayoutDepartureTimeTooltipBinding +import com.mulberry.ody.presentation.collectWhenStarted import com.mulberry.ody.presentation.common.binding.BindingFragment import com.mulberry.ody.presentation.common.toPixel import com.mulberry.ody.presentation.room.MeetingRoomActivity import com.mulberry.ody.presentation.room.MeetingRoomViewModel +import com.mulberry.ody.presentation.room.detail.adapter.MatesAdapter import com.mulberry.ody.presentation.room.detail.listener.DepartureTimeGuideListener +import com.mulberry.ody.presentation.room.detail.model.InviteCodeCopyUiModel +import com.mulberry.ody.presentation.room.detail.model.MatesUiModel class DetailMeetingFragment : BindingFragment(R.layout.fragment_detail_meeting), DepartureTimeGuideListener { private val viewModel: MeetingRoomViewModel by activityViewModels() private val parentActivity: Activity by lazy { requireActivity() } + private val matesAdapter: MatesAdapter by lazy { MatesAdapter() } override fun onViewCreated( view: View, @@ -39,9 +47,14 @@ class DetailMeetingFragment : binding.backListener = parentActivity as MeetingRoomActivity binding.meetingRoomListener = parentActivity as MeetingRoomActivity binding.departureTimeGuideListener = this + binding.rvDetailMeetingMates.adapter = matesAdapter } private fun initializeObserve() { + collectWhenStarted(viewModel.mates) { + val mates: List = it + listOf(InviteCodeCopyUiModel()) + matesAdapter.submitList(mates) + } } override fun toggleDepartureTimeGuide(point: Point) { diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesAdapter.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesAdapter.kt new file mode 100644 index 000000000..7bba919be --- /dev/null +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesAdapter.kt @@ -0,0 +1,61 @@ +package com.mulberry.ody.presentation.room.detail.adapter + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.DiffUtil +import androidx.recyclerview.widget.ListAdapter +import com.mulberry.ody.databinding.ItemInviteCodeCopyBinding +import com.mulberry.ody.databinding.ItemMateBinding +import com.mulberry.ody.presentation.room.detail.model.MateUiModel +import com.mulberry.ody.presentation.room.detail.model.MatesUiModel +import java.lang.IllegalStateException + +class MatesAdapter : + ListAdapter(DiffCallback()) { + override fun onCreateViewHolder( + parent: ViewGroup, + viewType: Int, + ): MatesViewHolder { + val inflater = LayoutInflater.from(parent.context) + + return when (viewType) { + MatesUiModel.MATE_VIEW_TYPE -> { + val binding = ItemMateBinding.inflate(inflater, parent, false) + MateViewHolder(binding) + } + + MatesUiModel.INVITE_CODE_COPY_VIEW_TYPE -> { + val binding = ItemInviteCodeCopyBinding.inflate(inflater, parent, false) + InviteCodeCopyViewHolder(binding) + } + + else -> throw IllegalStateException("뷰 타입에 해당하는 뷰홀더가 존재하지 않습니다.") + } + } + + override fun onBindViewHolder( + holder: MatesViewHolder, + position: Int, + ) { + when (holder) { + is MateViewHolder -> holder.bind(getItem(position) as MateUiModel) + is InviteCodeCopyViewHolder -> holder.bind() + } + } + + override fun getItemViewType(position: Int): Int { + return getItem(position).viewType + } + + class DiffCallback : DiffUtil.ItemCallback() { + override fun areItemsTheSame( + oldItem: MatesUiModel, + newItem: MatesUiModel, + ): Boolean = oldItem == newItem + + override fun areContentsTheSame( + oldItem: MatesUiModel, + newItem: MatesUiModel, + ): Boolean = oldItem == newItem + } +} diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesViewHolder.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesViewHolder.kt new file mode 100644 index 000000000..38bfb29e3 --- /dev/null +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesViewHolder.kt @@ -0,0 +1,23 @@ +package com.mulberry.ody.presentation.room.detail.adapter + +import android.view.View +import androidx.recyclerview.widget.RecyclerView +import com.mulberry.ody.databinding.ItemInviteCodeCopyBinding +import com.mulberry.ody.databinding.ItemMateBinding +import com.mulberry.ody.presentation.room.detail.model.MateUiModel + +sealed class MatesViewHolder(view: View) : RecyclerView.ViewHolder(view) + +class MateViewHolder(private val binding: ItemMateBinding) : + MatesViewHolder(binding.root) { + fun bind(mate: MateUiModel) { + binding.mate = mate + } +} + +class InviteCodeCopyViewHolder(private val binding: ItemInviteCodeCopyBinding) : + MatesViewHolder(binding.root) { + fun bind() { + + } +} diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/InviteCodeCopyInfo.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/InviteCodeCopyInfo.kt similarity index 60% rename from android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/InviteCodeCopyInfo.kt rename to android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/InviteCodeCopyInfo.kt index a15fff9c4..b42311608 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/InviteCodeCopyInfo.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/InviteCodeCopyInfo.kt @@ -1,4 +1,4 @@ -package com.mulberry.ody.presentation.room.log.model +package com.mulberry.ody.presentation.room.detail.model class InviteCodeCopyInfo( val meetingName: String, diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MateUiModelMapper.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MateUiModelMapper.kt similarity index 81% rename from android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MateUiModelMapper.kt rename to android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MateUiModelMapper.kt index 4d267329c..f4003025b 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MateUiModelMapper.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MateUiModelMapper.kt @@ -1,4 +1,4 @@ -package com.mulberry.ody.presentation.room.log.model +package com.mulberry.ody.presentation.room.detail.model import com.mulberry.ody.domain.model.Mate import com.mulberry.ody.domain.model.Meeting diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MatesUiModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MatesUiModel.kt new file mode 100644 index 000000000..92a319dba --- /dev/null +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MatesUiModel.kt @@ -0,0 +1,23 @@ +package com.mulberry.ody.presentation.room.detail.model + +import com.mulberry.ody.presentation.room.detail.model.MatesUiModel.Companion.INVITE_CODE_COPY_VIEW_TYPE +import com.mulberry.ody.presentation.room.detail.model.MatesUiModel.Companion.MATE_VIEW_TYPE + +sealed interface MatesUiModel { + val viewType: Int + + companion object { + const val MATE_VIEW_TYPE = 0 + const val INVITE_CODE_COPY_VIEW_TYPE = 1 + } +} + +class MateUiModel( + val nickname: String, + val imageUrl: String, + override val viewType: Int = MATE_VIEW_TYPE, +) : MatesUiModel + +class InviteCodeCopyUiModel( + override val viewType: Int = INVITE_CODE_COPY_VIEW_TYPE, +) : MatesUiModel diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MeetingDetailUiModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModel.kt similarity index 91% rename from android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MeetingDetailUiModel.kt rename to android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModel.kt index 29a433593..3e53a658d 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MeetingDetailUiModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModel.kt @@ -1,4 +1,4 @@ -package com.mulberry.ody.presentation.room.log.model +package com.mulberry.ody.presentation.room.detail.model data class MeetingDetailUiModel( val id: Long, diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MeetingDetailUiModelMapper.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModelMapper.kt similarity index 93% rename from android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MeetingDetailUiModelMapper.kt rename to android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModelMapper.kt index 1f17192b3..31dc9169f 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MeetingDetailUiModelMapper.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModelMapper.kt @@ -1,4 +1,4 @@ -package com.mulberry.ody.presentation.room.log.model +package com.mulberry.ody.presentation.room.detail.model import com.mulberry.ody.domain.model.Meeting import java.time.LocalDate diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt index 0266f12ee..857dd72fd 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt @@ -10,14 +10,12 @@ import com.mulberry.ody.presentation.collectWhenStarted import com.mulberry.ody.presentation.common.binding.BindingFragment import com.mulberry.ody.presentation.room.MeetingRoomActivity import com.mulberry.ody.presentation.room.MeetingRoomViewModel -import com.mulberry.ody.presentation.room.log.adapter.MatesAdapter import com.mulberry.ody.presentation.room.log.adapter.NotificationLogsAdapter class NotificationLogFragment : BindingFragment(R.layout.fragment_notification_log) { private val viewModel: MeetingRoomViewModel by activityViewModels() private val notificationLogsAdapter: NotificationLogsAdapter by lazy { NotificationLogsAdapter() } - private val matesAdapter: MatesAdapter by lazy { MatesAdapter() } override fun onViewCreated( view: View, @@ -39,9 +37,6 @@ class NotificationLogFragment : collectWhenStarted(viewModel.notificationLogs) { notificationLogsAdapter.submitList(it) } - collectWhenStarted(viewModel.mates) { - matesAdapter.submitList(it) - } collectWhenStarted(viewModel.copyInviteCodeEvent) { viewModel.copyInviteCodeEvent.collect { val intent = Intent(Intent.ACTION_SEND_MULTIPLE) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/adapter/MateViewHolder.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/log/adapter/MateViewHolder.kt deleted file mode 100644 index 4a0360d47..000000000 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/adapter/MateViewHolder.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.mulberry.ody.presentation.room.log.adapter - -import androidx.recyclerview.widget.RecyclerView -import com.mulberry.ody.databinding.ItemMateBinding -import com.mulberry.ody.presentation.room.log.model.MateUiModel - -class MateViewHolder(private val binding: ItemMateBinding) : - RecyclerView.ViewHolder(binding.root) { - fun bind(mate: MateUiModel) { - binding.mate = mate - } -} diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/adapter/MatesAdapter.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/log/adapter/MatesAdapter.kt deleted file mode 100644 index a097fc4d8..000000000 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/adapter/MatesAdapter.kt +++ /dev/null @@ -1,39 +0,0 @@ -package com.mulberry.ody.presentation.room.log.adapter - -import android.view.LayoutInflater -import android.view.ViewGroup -import androidx.recyclerview.widget.DiffUtil -import androidx.recyclerview.widget.ListAdapter -import com.mulberry.ody.databinding.ItemMateBinding -import com.mulberry.ody.presentation.room.log.model.MateUiModel - -class MatesAdapter : - ListAdapter(DiffCallback()) { - override fun onCreateViewHolder( - parent: ViewGroup, - viewType: Int, - ): MateViewHolder { - val binding = - ItemMateBinding.inflate(LayoutInflater.from(parent.context), parent, false) - return MateViewHolder(binding) - } - - override fun onBindViewHolder( - holder: MateViewHolder, - position: Int, - ) { - holder.bind(getItem(position)) - } - - class DiffCallback : DiffUtil.ItemCallback() { - override fun areItemsTheSame( - oldItem: MateUiModel, - newItem: MateUiModel, - ): Boolean = oldItem == newItem - - override fun areContentsTheSame( - oldItem: MateUiModel, - newItem: MateUiModel, - ): Boolean = oldItem == newItem - } -} diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MateUiModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MateUiModel.kt deleted file mode 100644 index 3ada9f328..000000000 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/model/MateUiModel.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.mulberry.ody.presentation.room.log.model - -data class MateUiModel( - val nickname: String, - val imageUrl: String, -) diff --git a/android/app/src/main/res/layout/fragment_detail_meeting.xml b/android/app/src/main/res/layout/fragment_detail_meeting.xml index 1d343bf7a..913de7a96 100644 --- a/android/app/src/main/res/layout/fragment_detail_meeting.xml +++ b/android/app/src/main/res/layout/fragment_detail_meeting.xml @@ -52,6 +52,7 @@ app:layout_constraintTop_toTopOf="@id/tb_detail_meeting"> + android:layout_marginEnd="22dp" + android:layout_marginBottom="10dp"> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="packed" /> + app:layout_constraintTop_toBottomOf="@id/tv_invite_code_guide" + app:layout_constraintVertical_chainStyle="packed" /> diff --git a/android/app/src/main/res/layout/item_mate.xml b/android/app/src/main/res/layout/item_mate.xml index 26778ca45..f5321f3ec 100644 --- a/android/app/src/main/res/layout/item_mate.xml +++ b/android/app/src/main/res/layout/item_mate.xml @@ -7,7 +7,7 @@ + type="com.mulberry.ody.presentation.room.detail.model.MateUiModel" /> Date: Sun, 19 Jan 2025 23:51:43 +0900 Subject: [PATCH 09/20] =?UTF-8?q?feat:=20=EC=B4=88=EB=8C=80=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=B3=B5=EC=82=AC=ED=95=98=EB=8A=94=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 --- .../room/detail/DetailMeetingFragment.kt | 27 +++++++++++++++---- .../room/detail/adapter/MatesAdapter.kt | 7 +++-- .../room/detail/adapter/MatesViewHolder.kt | 9 ++++--- .../detail/listener/InviteCodeCopyListener.kt | 5 ++++ .../room/log/NotificationLogFragment.kt | 13 --------- .../main/res/layout/item_invite_code_copy.xml | 6 ++++- 6 files changed, 43 insertions(+), 24 deletions(-) create mode 100644 android/app/src/main/java/com/mulberry/ody/presentation/room/detail/listener/InviteCodeCopyListener.kt diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt index 4aa9cdeae..1bbeec85b 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt @@ -2,17 +2,15 @@ package com.mulberry.ody.presentation.room.detail import android.app.Activity import android.content.Context.LAYOUT_INFLATER_SERVICE +import android.content.Intent import android.graphics.Point import android.os.Bundle -import android.util.Log import android.view.Gravity import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.PopupWindow import androidx.fragment.app.activityViewModels -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView import com.mulberry.ody.R import com.mulberry.ody.databinding.FragmentDetailMeetingBinding import com.mulberry.ody.databinding.LayoutDepartureTimeTooltipBinding @@ -23,15 +21,17 @@ import com.mulberry.ody.presentation.room.MeetingRoomActivity import com.mulberry.ody.presentation.room.MeetingRoomViewModel import com.mulberry.ody.presentation.room.detail.adapter.MatesAdapter import com.mulberry.ody.presentation.room.detail.listener.DepartureTimeGuideListener +import com.mulberry.ody.presentation.room.detail.listener.InviteCodeCopyListener import com.mulberry.ody.presentation.room.detail.model.InviteCodeCopyUiModel import com.mulberry.ody.presentation.room.detail.model.MatesUiModel class DetailMeetingFragment : BindingFragment(R.layout.fragment_detail_meeting), - DepartureTimeGuideListener { + DepartureTimeGuideListener, + InviteCodeCopyListener { private val viewModel: MeetingRoomViewModel by activityViewModels() private val parentActivity: Activity by lazy { requireActivity() } - private val matesAdapter: MatesAdapter by lazy { MatesAdapter() } + private val matesAdapter: MatesAdapter by lazy { MatesAdapter(this) } override fun onViewCreated( view: View, @@ -55,6 +55,19 @@ class DetailMeetingFragment : val mates: List = it + listOf(InviteCodeCopyUiModel()) matesAdapter.submitList(mates) } + collectWhenStarted(viewModel.copyInviteCodeEvent) { + viewModel.copyInviteCodeEvent.collect { + val intent = Intent(Intent.ACTION_SEND_MULTIPLE) + intent.type = "text/plain" + + val shareMessage = + getString(R.string.invite_code_copy, it.meetingName, it.inviteCode) + intent.putExtra(Intent.EXTRA_TEXT, shareMessage) + + val chooserTitle = getString(R.string.invite_code_copy_title) + startActivity(Intent.createChooser(intent, chooserTitle)) + } + } } override fun toggleDepartureTimeGuide(point: Point) { @@ -103,6 +116,10 @@ class DetailMeetingFragment : ) } + override fun onCopy() { + viewModel.copyInviteCode() + } + companion object { private const val GUIDE_BUTTON_PADDING = 5 private const val GUIDE_BUTTON_WIDTH = 12 diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesAdapter.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesAdapter.kt index 7bba919be..d223aa447 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesAdapter.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesAdapter.kt @@ -6,11 +6,14 @@ import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter import com.mulberry.ody.databinding.ItemInviteCodeCopyBinding import com.mulberry.ody.databinding.ItemMateBinding +import com.mulberry.ody.presentation.room.detail.listener.InviteCodeCopyListener import com.mulberry.ody.presentation.room.detail.model.MateUiModel import com.mulberry.ody.presentation.room.detail.model.MatesUiModel import java.lang.IllegalStateException -class MatesAdapter : +class MatesAdapter( + private val inviteCodeCopyListener: InviteCodeCopyListener, +) : ListAdapter(DiffCallback()) { override fun onCreateViewHolder( parent: ViewGroup, @@ -39,7 +42,7 @@ class MatesAdapter : ) { when (holder) { is MateViewHolder -> holder.bind(getItem(position) as MateUiModel) - is InviteCodeCopyViewHolder -> holder.bind() + is InviteCodeCopyViewHolder -> holder.bind(inviteCodeCopyListener) } } diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesViewHolder.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesViewHolder.kt index 38bfb29e3..8533c8f39 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesViewHolder.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/adapter/MatesViewHolder.kt @@ -4,6 +4,7 @@ import android.view.View import androidx.recyclerview.widget.RecyclerView import com.mulberry.ody.databinding.ItemInviteCodeCopyBinding import com.mulberry.ody.databinding.ItemMateBinding +import com.mulberry.ody.presentation.room.detail.listener.InviteCodeCopyListener import com.mulberry.ody.presentation.room.detail.model.MateUiModel sealed class MatesViewHolder(view: View) : RecyclerView.ViewHolder(view) @@ -15,9 +16,11 @@ class MateViewHolder(private val binding: ItemMateBinding) : } } -class InviteCodeCopyViewHolder(private val binding: ItemInviteCodeCopyBinding) : +class InviteCodeCopyViewHolder( + private val binding: ItemInviteCodeCopyBinding, +) : MatesViewHolder(binding.root) { - fun bind() { - + fun bind(inviteCodeCopyListener: InviteCodeCopyListener) { + binding.inviteCodeCopyListener = inviteCodeCopyListener } } diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/listener/InviteCodeCopyListener.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/listener/InviteCodeCopyListener.kt new file mode 100644 index 000000000..023d178c7 --- /dev/null +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/listener/InviteCodeCopyListener.kt @@ -0,0 +1,5 @@ +package com.mulberry.ody.presentation.room.detail.listener + +interface InviteCodeCopyListener { + fun onCopy() +} diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt index 857dd72fd..a3759b490 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt @@ -37,18 +37,5 @@ class NotificationLogFragment : collectWhenStarted(viewModel.notificationLogs) { notificationLogsAdapter.submitList(it) } - collectWhenStarted(viewModel.copyInviteCodeEvent) { - viewModel.copyInviteCodeEvent.collect { - val intent = Intent(Intent.ACTION_SEND_MULTIPLE) - intent.type = "text/plain" - - val shareMessage = - getString(R.string.invite_code_copy, it.meetingName, it.inviteCode) - intent.putExtra(Intent.EXTRA_TEXT, shareMessage) - - val chooserTitle = getString(R.string.invite_code_copy_title) - startActivity(Intent.createChooser(intent, chooserTitle)) - } - } } } diff --git a/android/app/src/main/res/layout/item_invite_code_copy.xml b/android/app/src/main/res/layout/item_invite_code_copy.xml index 831579bcd..6f1049280 100644 --- a/android/app/src/main/res/layout/item_invite_code_copy.xml +++ b/android/app/src/main/res/layout/item_invite_code_copy.xml @@ -4,6 +4,9 @@ + + app:layout_constraintVertical_chainStyle="packed" + app:onSingleClick="@{() -> inviteCodeCopyListener.onCopy()}" /> From 6e34390306021e7649e7da6ecc7fcfd5474c344f Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Sun, 19 Jan 2025 23:51:57 +0900 Subject: [PATCH 10/20] =?UTF-8?q?style:=20ktLint=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ody/presentation/room/MeetingRoomViewModel.kt | 8 ++++---- .../ody/presentation/room/log/NotificationLogFragment.kt | 1 - .../ody/presentation/room/MeetingRoomViewModelTest.kt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt index ab03af567..5143a692b 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt @@ -22,15 +22,15 @@ import com.mulberry.ody.presentation.common.analytics.logButtonClicked import com.mulberry.ody.presentation.common.analytics.logNetworkErrorEvent import com.mulberry.ody.presentation.common.image.ImageShareContent import com.mulberry.ody.presentation.common.image.ImageShareHelper -import com.mulberry.ody.presentation.room.etadashboard.listener.NudgeListener -import com.mulberry.ody.presentation.room.etadashboard.model.MateEtaUiModel -import com.mulberry.ody.presentation.room.etadashboard.model.toMateEtaUiModels import com.mulberry.ody.presentation.room.detail.model.InviteCodeCopyInfo import com.mulberry.ody.presentation.room.detail.model.MateUiModel import com.mulberry.ody.presentation.room.detail.model.MeetingDetailUiModel -import com.mulberry.ody.presentation.room.log.model.NotificationLogUiModel import com.mulberry.ody.presentation.room.detail.model.toMateUiModels import com.mulberry.ody.presentation.room.detail.model.toMeetingUiModel +import com.mulberry.ody.presentation.room.etadashboard.listener.NudgeListener +import com.mulberry.ody.presentation.room.etadashboard.model.MateEtaUiModel +import com.mulberry.ody.presentation.room.etadashboard.model.toMateEtaUiModels +import com.mulberry.ody.presentation.room.log.model.NotificationLogUiModel import com.mulberry.ody.presentation.room.log.model.toNotificationUiModels import dagger.assisted.Assisted import dagger.assisted.AssistedFactory diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt index a3759b490..f665e80d0 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/log/NotificationLogFragment.kt @@ -1,6 +1,5 @@ package com.mulberry.ody.presentation.room.log -import android.content.Intent import android.os.Bundle import android.view.View import androidx.fragment.app.activityViewModels diff --git a/android/app/src/test/java/com/mulberry/ody/presentation/room/MeetingRoomViewModelTest.kt b/android/app/src/test/java/com/mulberry/ody/presentation/room/MeetingRoomViewModelTest.kt index ee384f9f6..3ce4cc19d 100644 --- a/android/app/src/test/java/com/mulberry/ody/presentation/room/MeetingRoomViewModelTest.kt +++ b/android/app/src/test/java/com/mulberry/ody/presentation/room/MeetingRoomViewModelTest.kt @@ -11,8 +11,8 @@ import com.mulberry.ody.mateEtaInfo import com.mulberry.ody.meeting import com.mulberry.ody.meetingId import com.mulberry.ody.notificationLogs -import com.mulberry.ody.presentation.room.etadashboard.model.toMateEtaUiModels import com.mulberry.ody.presentation.room.detail.model.toMeetingUiModel +import com.mulberry.ody.presentation.room.etadashboard.model.toMateEtaUiModels import com.mulberry.ody.presentation.room.log.model.toNotificationUiModels import com.mulberry.ody.util.CoroutinesTestExtension import com.mulberry.ody.util.InstantTaskExecutorExtension From f62bff8833ecd0d3d2dc8430d7a6d0d78fae6b20 Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Mon, 20 Jan 2025 14:27:29 +0900 Subject: [PATCH 11/20] =?UTF-8?q?feat:=20meetingDetailUiModel=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../meeting/mapper/MeetingResponseMapper.kt | 13 +++--- .../meeting/response/MeetingResponse.kt | 6 +++ .../repository/DefaultMeetingRepository.kt | 20 ++++++++- .../remote/core/service/MeetingService.kt | 2 +- .../com/mulberry/ody/domain/model/Meeting.kt | 9 ++-- .../room/detail/model/MeetingDetailUiModel.kt | 14 +++++-- .../model/MeetingDetailUiModelMapper.kt | 41 ++++++++++++------- 7 files changed, 77 insertions(+), 28 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/data/remote/core/entity/meeting/mapper/MeetingResponseMapper.kt b/android/app/src/main/java/com/mulberry/ody/data/remote/core/entity/meeting/mapper/MeetingResponseMapper.kt index 373303171..3da4b380b 100644 --- a/android/app/src/main/java/com/mulberry/ody/data/remote/core/entity/meeting/mapper/MeetingResponseMapper.kt +++ b/android/app/src/main/java/com/mulberry/ody/data/remote/core/entity/meeting/mapper/MeetingResponseMapper.kt @@ -11,19 +11,22 @@ fun MeetingResponse.toMeeting(): Meeting = Meeting( id = id, name = name, - targetPosition = targetAddress, - meetingDate = date.parseToLocalDate(), - meetingTime = time.parseToLocalTime(), + date = date.toLocalDate(), + time = time.toLocalTime(), + destinationAddress = targetAddress, + departureAddress = departureAddress, + departureTime = departureTime.toLocalTime(), + routeTime = routeTime, mates = mates.map { Mate(nickname = it.nickname, imageUrl = it.imageUrl) }, inviteCode = inviteCode, ) -private fun String.parseToLocalDate(): LocalDate { +private fun String.toLocalDate(): LocalDate { val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd") return LocalDate.parse(this, formatter) } -private fun String.parseToLocalTime(): LocalTime { +private fun String.toLocalTime(): LocalTime { val formatter = DateTimeFormatter.ofPattern("HH:mm") return LocalTime.parse(this, formatter) } diff --git a/android/app/src/main/java/com/mulberry/ody/data/remote/core/entity/meeting/response/MeetingResponse.kt b/android/app/src/main/java/com/mulberry/ody/data/remote/core/entity/meeting/response/MeetingResponse.kt index 7de38016e..b8d5ff19a 100644 --- a/android/app/src/main/java/com/mulberry/ody/data/remote/core/entity/meeting/response/MeetingResponse.kt +++ b/android/app/src/main/java/com/mulberry/ody/data/remote/core/entity/meeting/response/MeetingResponse.kt @@ -13,6 +13,12 @@ data class MeetingResponse( val date: String, @Json(name = "time") val time: String, + @Json(name = "departureAddress") + val departureAddress: String, + @Json(name = "departureTime") + val departureTime: String, + @Json(name = "routeTime") + val routeTime: Int, @Json(name = "targetAddress") val targetAddress: String, @Json(name = "targetLatitude") diff --git a/android/app/src/main/java/com/mulberry/ody/data/remote/core/repository/DefaultMeetingRepository.kt b/android/app/src/main/java/com/mulberry/ody/data/remote/core/repository/DefaultMeetingRepository.kt index be34cf16b..f14c6ae84 100644 --- a/android/app/src/main/java/com/mulberry/ody/data/remote/core/repository/DefaultMeetingRepository.kt +++ b/android/app/src/main/java/com/mulberry/ody/data/remote/core/repository/DefaultMeetingRepository.kt @@ -11,12 +11,15 @@ import com.mulberry.ody.data.remote.core.entity.meeting.request.MatesEtaRequest import com.mulberry.ody.data.remote.core.service.MeetingService import com.mulberry.ody.domain.apiresult.ApiResult import com.mulberry.ody.domain.apiresult.map +import com.mulberry.ody.domain.model.Mate import com.mulberry.ody.domain.model.MateEtaInfo import com.mulberry.ody.domain.model.Meeting import com.mulberry.ody.domain.model.MeetingCatalog import com.mulberry.ody.domain.model.MeetingCreationInfo import com.mulberry.ody.domain.model.Nudge import com.mulberry.ody.domain.repository.ody.MeetingRepository +import java.time.LocalDate +import java.time.LocalTime import javax.inject.Inject class DefaultMeetingRepository @@ -30,7 +33,22 @@ class DefaultMeetingRepository } override suspend fun fetchMeeting(meetingId: Long): ApiResult { - return service.fetchMeeting(meetingId).map { it.toMeeting() } + return ApiResult.Success( + Meeting( + id = 1, + name = "약속 이름", + date = LocalDate.of(2025,2,1), + time = LocalTime.of(11,30), + destinationAddress = "서울특별시 강남구 테헤란로 411 (성담빌딩)", + departureAddress="서울특별시 송파구 올림픽로 35다길 (한국루터회관)", + departureTime = LocalTime.of(10,0), + routeTime=70, + mates = listOf(Mate("올리브1",""), Mate("올리브2","")), + inviteCode= "12345" + + ) + ) + //return service.fetchMeeting(meetingId).map { it.toMeeting() } } override suspend fun postNudge(nudge: Nudge): ApiResult = service.postNudge(nudge.toNudgeRequest()) diff --git a/android/app/src/main/java/com/mulberry/ody/data/remote/core/service/MeetingService.kt b/android/app/src/main/java/com/mulberry/ody/data/remote/core/service/MeetingService.kt index 0d657faa4..1aa3749c3 100644 --- a/android/app/src/main/java/com/mulberry/ody/data/remote/core/service/MeetingService.kt +++ b/android/app/src/main/java/com/mulberry/ody/data/remote/core/service/MeetingService.kt @@ -35,7 +35,7 @@ interface MeetingService { @GET("/v1/meetings/me") suspend fun fetchMeetingCatalogs(): ApiResult - @GET("/v1/meetings/{meetingId}") + @GET("/v2/meetings/{meetingId}") suspend fun fetchMeeting( @Path(value = "meetingId") meetingId: Long, ): ApiResult diff --git a/android/app/src/main/java/com/mulberry/ody/domain/model/Meeting.kt b/android/app/src/main/java/com/mulberry/ody/domain/model/Meeting.kt index eb19fa35f..9afda1ad9 100644 --- a/android/app/src/main/java/com/mulberry/ody/domain/model/Meeting.kt +++ b/android/app/src/main/java/com/mulberry/ody/domain/model/Meeting.kt @@ -6,9 +6,12 @@ import java.time.LocalTime data class Meeting( val id: Long, val name: String, - val targetPosition: String, - val meetingDate: LocalDate, - val meetingTime: LocalTime, + val date: LocalDate, + val time: LocalTime, + val destinationAddress: String, + val departureAddress: String, + val departureTime: LocalTime, + val routeTime: Int, val mates: List, val inviteCode: String, ) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModel.kt index 3e53a658d..6ec1aa142 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModel.kt @@ -3,8 +3,11 @@ package com.mulberry.ody.presentation.room.detail.model data class MeetingDetailUiModel( val id: Long, val name: String, - val targetPosition: String, - val meetingTime: String, + val dateTime: String, + val destinationAddress: String, + val departureAddress: String, + val departureTime: String, + val routeTime: String, val mates: List, val inviteCode: String, val isEtaAccessible: Boolean, @@ -16,8 +19,11 @@ data class MeetingDetailUiModel( MeetingDetailUiModel( id = -1L, name = "-", - targetPosition = "-", - meetingTime = "-", + dateTime = "0", + destinationAddress = "-", + departureAddress = "-", + departureTime = "-", + routeTime = "-", mates = listOf("-"), inviteCode = "", isEtaAccessible = false, diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModelMapper.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModelMapper.kt index 31dc9169f..ac8cd7fcf 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModelMapper.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModelMapper.kt @@ -1,30 +1,43 @@ package com.mulberry.ody.presentation.room.detail.model import com.mulberry.ody.domain.model.Meeting -import java.time.LocalDate import java.time.LocalDateTime import java.time.LocalTime import java.time.format.DateTimeFormatter fun Meeting.toMeetingUiModel(): MeetingDetailUiModel { - val meetingDateTime = LocalDateTime.of(meetingDate, meetingTime) + val meetingDateTime = LocalDateTime.of(date, time) return MeetingDetailUiModel( - id, - name, - targetPosition, - toMeetingDateTime(meetingDate, meetingTime), - mates.map { it.nickname }, - inviteCode, - meetingDateTime.minusMinutes(30) <= LocalDateTime.now(), + id = id, + name = name, + dateTime = this.toDateTimeString(), + destinationAddress = departureAddress, + departureAddress = destinationAddress, + departureTime = departureTime.toTimeString(), + routeTime = routeTime.toTimeString(), + mates = mates.map { it.nickname }, + inviteCode = inviteCode, + isEtaAccessible = meetingDateTime.minusMinutes(30) <= LocalDateTime.now(), ) } -private fun toMeetingDateTime( - meetingDate: LocalDate, - meetingTime: LocalTime, -): String { - val dateTime = LocalDateTime.of(meetingDate, meetingTime) +private fun Meeting.toDateTimeString(): String { + val dateTime = LocalDateTime.of(date, time) val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy년 M월 d일 HH시 mm분") return dateTime.format(dateTimeFormatter) } + +private fun LocalTime.toTimeString(): String { + val dateTimeFormatter = DateTimeFormatter.ofPattern("HH시 mm분") + return format(dateTimeFormatter) +} + +private fun Int.toTimeString(): String { + val hour = this / 60 + val minute = this % 60 + val localTime = LocalTime.of(hour, minute) + val formatterPattern = if (hour == 0) "mm분" else "HH시 mm분" + val dateTimeFormatter = DateTimeFormatter.ofPattern(formatterPattern) + return localTime.format(dateTimeFormatter) +} From 8b09e38ea64bc5f451c4f621b3da3d7a89428175 Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Mon, 20 Jan 2025 14:46:43 +0900 Subject: [PATCH 12/20] =?UTF-8?q?feat:=20meetingDetailUiModel=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=EC=97=90=20=EB=9D=84=EC=9A=B0=EB=8A=94=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../room/detail/DetailMeetingBindingAdapter.kt | 13 +++++++++++++ .../src/main/res/layout/fragment_detail_meeting.xml | 13 +++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt index ae56eb9d4..86a6262e3 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt @@ -1,9 +1,12 @@ package com.mulberry.ody.presentation.room.detail import android.widget.ImageView +import android.widget.TextView import androidx.databinding.BindingAdapter +import com.mulberry.ody.R import com.mulberry.ody.presentation.common.getPointOnScreen import com.mulberry.ody.presentation.room.detail.listener.DepartureTimeGuideListener +import com.mulberry.ody.presentation.room.detail.model.MeetingDetailUiModel @BindingAdapter("onClickDepartureTimeGuide") fun ImageView.setOnClickDepartureTimeGuide(missingToolTipListener: DepartureTimeGuideListener) { @@ -12,3 +15,13 @@ fun ImageView.setOnClickDepartureTimeGuide(missingToolTipListener: DepartureTime missingToolTipListener.toggleDepartureTimeGuide(point) } } + +@BindingAdapter("departureTime") +fun TextView.setDepartureTimeText(detailMeetingUiModel: MeetingDetailUiModel) { + text = context.getString( + R.string.detail_meeting_departure_time_content, + detailMeetingUiModel.departureTime, + detailMeetingUiModel.routeTime, + ) +} + diff --git a/android/app/src/main/res/layout/fragment_detail_meeting.xml b/android/app/src/main/res/layout/fragment_detail_meeting.xml index 913de7a96..f612644c0 100644 --- a/android/app/src/main/res/layout/fragment_detail_meeting.xml +++ b/android/app/src/main/res/layout/fragment_detail_meeting.xml @@ -96,10 +96,11 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="6dp" + android:text="@{vm.meeting.dateTime}" android:textColor="@color/tertiary" app:layout_constraintBottom_toTopOf="@id/tv_detail_meeting_address_title" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/detail_meeting_departure_time_title" + app:layout_constraintTop_toBottomOf="@id/tv_detail_meeting_time_title" tools:text="2024년 7월 11일 03시 00분" /> + app:layout_constraintTop_toBottomOf="@id/tv_detail_meeting_address" /> @@ -174,12 +178,13 @@ app:onClickDepartureTimeGuide="@{departureTimeGuideListener}" /> From e85c4178523fb2068c520e07d0fe01dd481def79 Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Mon, 20 Jan 2025 14:48:48 +0900 Subject: [PATCH 13/20] =?UTF-8?q?chore:=20MeetingDetailUiModel=20->=20Deta?= =?UTF-8?q?ilMeetingUiModel=20=ED=81=B4=EB=9E=98=EC=8A=A4=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ody/presentation/room/MeetingRoomViewModel.kt | 11 +++++------ .../room/detail/DetailMeetingBindingAdapter.kt | 4 ++-- ...eetingDetailUiModel.kt => DetailMeetingUiModel.kt} | 6 +++--- ...UiModelMapper.kt => DetailMeetingUiModelMapper.kt} | 4 ++-- .../ody/presentation/room/MeetingRoomViewModelTest.kt | 4 ++-- 5 files changed, 14 insertions(+), 15 deletions(-) rename android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/{MeetingDetailUiModel.kt => DetailMeetingUiModel.kt} (87%) rename android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/{MeetingDetailUiModelMapper.kt => DetailMeetingUiModelMapper.kt} (93%) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt index 5143a692b..4fb30d305 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt @@ -24,9 +24,9 @@ import com.mulberry.ody.presentation.common.image.ImageShareContent import com.mulberry.ody.presentation.common.image.ImageShareHelper import com.mulberry.ody.presentation.room.detail.model.InviteCodeCopyInfo import com.mulberry.ody.presentation.room.detail.model.MateUiModel -import com.mulberry.ody.presentation.room.detail.model.MeetingDetailUiModel +import com.mulberry.ody.presentation.room.detail.model.DetailMeetingUiModel import com.mulberry.ody.presentation.room.detail.model.toMateUiModels -import com.mulberry.ody.presentation.room.detail.model.toMeetingUiModel +import com.mulberry.ody.presentation.room.detail.model.toDetailMeetingUiModel import com.mulberry.ody.presentation.room.etadashboard.listener.NudgeListener import com.mulberry.ody.presentation.room.etadashboard.model.MateEtaUiModel import com.mulberry.ody.presentation.room.etadashboard.model.toMateEtaUiModels @@ -74,9 +74,8 @@ class MeetingRoomViewModel initialValue = null, ) - private val _meeting: MutableStateFlow = - MutableStateFlow(MeetingDetailUiModel.DEFAULT) - val meeting: StateFlow = _meeting.asStateFlow() + private val _meeting: MutableStateFlow = MutableStateFlow(DetailMeetingUiModel.DEFAULT) + val meeting: StateFlow = _meeting.asStateFlow() private val _mates: MutableStateFlow> = MutableStateFlow(listOf()) val mates: StateFlow> = _mates.asStateFlow() @@ -186,7 +185,7 @@ class MeetingRoomViewModel startLoading() meetingRepository.fetchMeeting(meetingId) .onSuccess { - _meeting.value = it.toMeetingUiModel() + _meeting.value = it.toDetailMeetingUiModel() _mates.value = it.toMateUiModels() fetchNotificationLogs() }.onFailure { code, errorMessage -> diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt index 86a6262e3..8db08071d 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt @@ -6,7 +6,7 @@ import androidx.databinding.BindingAdapter import com.mulberry.ody.R import com.mulberry.ody.presentation.common.getPointOnScreen import com.mulberry.ody.presentation.room.detail.listener.DepartureTimeGuideListener -import com.mulberry.ody.presentation.room.detail.model.MeetingDetailUiModel +import com.mulberry.ody.presentation.room.detail.model.DetailMeetingUiModel @BindingAdapter("onClickDepartureTimeGuide") fun ImageView.setOnClickDepartureTimeGuide(missingToolTipListener: DepartureTimeGuideListener) { @@ -17,7 +17,7 @@ fun ImageView.setOnClickDepartureTimeGuide(missingToolTipListener: DepartureTime } @BindingAdapter("departureTime") -fun TextView.setDepartureTimeText(detailMeetingUiModel: MeetingDetailUiModel) { +fun TextView.setDepartureTimeText(detailMeetingUiModel: DetailMeetingUiModel) { text = context.getString( R.string.detail_meeting_departure_time_content, detailMeetingUiModel.departureTime, diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModel.kt similarity index 87% rename from android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModel.kt rename to android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModel.kt index 6ec1aa142..f06a3a5fa 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModel.kt @@ -1,6 +1,6 @@ package com.mulberry.ody.presentation.room.detail.model -data class MeetingDetailUiModel( +data class DetailMeetingUiModel( val id: Long, val name: String, val dateTime: String, @@ -15,8 +15,8 @@ data class MeetingDetailUiModel( fun isDefault(): Boolean = this == DEFAULT companion object { - val DEFAULT: MeetingDetailUiModel = - MeetingDetailUiModel( + val DEFAULT: DetailMeetingUiModel = + DetailMeetingUiModel( id = -1L, name = "-", dateTime = "0", diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModelMapper.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModelMapper.kt similarity index 93% rename from android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModelMapper.kt rename to android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModelMapper.kt index ac8cd7fcf..c4e7f5efa 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/MeetingDetailUiModelMapper.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModelMapper.kt @@ -5,10 +5,10 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.format.DateTimeFormatter -fun Meeting.toMeetingUiModel(): MeetingDetailUiModel { +fun Meeting.toDetailMeetingUiModel(): DetailMeetingUiModel { val meetingDateTime = LocalDateTime.of(date, time) - return MeetingDetailUiModel( + return DetailMeetingUiModel( id = id, name = name, dateTime = this.toDateTimeString(), diff --git a/android/app/src/test/java/com/mulberry/ody/presentation/room/MeetingRoomViewModelTest.kt b/android/app/src/test/java/com/mulberry/ody/presentation/room/MeetingRoomViewModelTest.kt index 3ce4cc19d..ea71d5ab4 100644 --- a/android/app/src/test/java/com/mulberry/ody/presentation/room/MeetingRoomViewModelTest.kt +++ b/android/app/src/test/java/com/mulberry/ody/presentation/room/MeetingRoomViewModelTest.kt @@ -11,7 +11,7 @@ import com.mulberry.ody.mateEtaInfo import com.mulberry.ody.meeting import com.mulberry.ody.meetingId import com.mulberry.ody.notificationLogs -import com.mulberry.ody.presentation.room.detail.model.toMeetingUiModel +import com.mulberry.ody.presentation.room.detail.model.toDetailMeetingUiModel import com.mulberry.ody.presentation.room.etadashboard.model.toMateEtaUiModels import com.mulberry.ody.presentation.room.log.model.toNotificationUiModels import com.mulberry.ody.util.CoroutinesTestExtension @@ -65,7 +65,7 @@ class MeetingRoomViewModelTest { runTest { // then val meetingUiModel = viewModel.meeting.first() - assertThat(meetingUiModel).isEqualTo(meeting.toMeetingUiModel()) + assertThat(meetingUiModel).isEqualTo(meeting.toDetailMeetingUiModel()) val notificationLogUiModel = viewModel.notificationLogs.first() assertThat(notificationLogUiModel).isEqualTo(notificationLogs.toNotificationUiModels()) From 7b774a5e13565f95f1b56aa309a639bc6a77fd0a Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Mon, 20 Jan 2025 15:34:49 +0900 Subject: [PATCH 14/20] =?UTF-8?q?fix:=20=EC=B4=88=EB=8C=80=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EA=B3=B5=EC=9C=A0=EB=90=98=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8A=94=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../room/detail/DetailMeetingFragment.kt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt index 1bbeec85b..eaeb228dc 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingFragment.kt @@ -56,17 +56,15 @@ class DetailMeetingFragment : matesAdapter.submitList(mates) } collectWhenStarted(viewModel.copyInviteCodeEvent) { - viewModel.copyInviteCodeEvent.collect { - val intent = Intent(Intent.ACTION_SEND_MULTIPLE) - intent.type = "text/plain" + val intent = Intent(Intent.ACTION_SEND_MULTIPLE) + intent.type = "text/plain" - val shareMessage = - getString(R.string.invite_code_copy, it.meetingName, it.inviteCode) - intent.putExtra(Intent.EXTRA_TEXT, shareMessage) + val shareMessage = + getString(R.string.invite_code_copy, it.meetingName, it.inviteCode) + intent.putExtra(Intent.EXTRA_TEXT, shareMessage) - val chooserTitle = getString(R.string.invite_code_copy_title) - startActivity(Intent.createChooser(intent, chooserTitle)) - } + val chooserTitle = getString(R.string.invite_code_copy_title) + startActivity(Intent.createChooser(intent, chooserTitle)) } } From 3f261ce2679bd67b92287daae42a8b64d987d65f Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Mon, 20 Jan 2025 15:35:27 +0900 Subject: [PATCH 15/20] =?UTF-8?q?style:=20ktLint=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/DefaultMeetingRepository.kt | 20 +++++++++---------- .../presentation/room/MeetingRoomViewModel.kt | 4 ++-- .../detail/DetailMeetingBindingAdapter.kt | 12 +++++------ 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/data/remote/core/repository/DefaultMeetingRepository.kt b/android/app/src/main/java/com/mulberry/ody/data/remote/core/repository/DefaultMeetingRepository.kt index f14c6ae84..ccb5ea099 100644 --- a/android/app/src/main/java/com/mulberry/ody/data/remote/core/repository/DefaultMeetingRepository.kt +++ b/android/app/src/main/java/com/mulberry/ody/data/remote/core/repository/DefaultMeetingRepository.kt @@ -3,7 +3,6 @@ package com.mulberry.ody.data.remote.core.repository import com.mulberry.ody.data.local.db.MateEtaInfoDao import com.mulberry.ody.data.local.entity.eta.MateEtaInfoEntity import com.mulberry.ody.data.remote.core.entity.meeting.mapper.toMateEtaInfo -import com.mulberry.ody.data.remote.core.entity.meeting.mapper.toMeeting import com.mulberry.ody.data.remote.core.entity.meeting.mapper.toMeetingCatalogs import com.mulberry.ody.data.remote.core.entity.meeting.mapper.toMeetingRequest import com.mulberry.ody.data.remote.core.entity.meeting.mapper.toNudgeRequest @@ -37,18 +36,17 @@ class DefaultMeetingRepository Meeting( id = 1, name = "약속 이름", - date = LocalDate.of(2025,2,1), - time = LocalTime.of(11,30), + date = LocalDate.of(2025, 2, 1), + time = LocalTime.of(11, 30), destinationAddress = "서울특별시 강남구 테헤란로 411 (성담빌딩)", - departureAddress="서울특별시 송파구 올림픽로 35다길 (한국루터회관)", - departureTime = LocalTime.of(10,0), - routeTime=70, - mates = listOf(Mate("올리브1",""), Mate("올리브2","")), - inviteCode= "12345" - - ) + departureAddress = "서울특별시 송파구 올림픽로 35다길 (한국루터회관)", + departureTime = LocalTime.of(10, 0), + routeTime = 70, + mates = listOf(Mate("올리브1", ""), Mate("올리브2", "")), + inviteCode = "12345", + ), ) - //return service.fetchMeeting(meetingId).map { it.toMeeting() } + // return service.fetchMeeting(meetingId).map { it.toMeeting() } } override suspend fun postNudge(nudge: Nudge): ApiResult = service.postNudge(nudge.toNudgeRequest()) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt index 4fb30d305..07fe7ef95 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt @@ -22,11 +22,11 @@ import com.mulberry.ody.presentation.common.analytics.logButtonClicked import com.mulberry.ody.presentation.common.analytics.logNetworkErrorEvent import com.mulberry.ody.presentation.common.image.ImageShareContent import com.mulberry.ody.presentation.common.image.ImageShareHelper +import com.mulberry.ody.presentation.room.detail.model.DetailMeetingUiModel import com.mulberry.ody.presentation.room.detail.model.InviteCodeCopyInfo import com.mulberry.ody.presentation.room.detail.model.MateUiModel -import com.mulberry.ody.presentation.room.detail.model.DetailMeetingUiModel -import com.mulberry.ody.presentation.room.detail.model.toMateUiModels import com.mulberry.ody.presentation.room.detail.model.toDetailMeetingUiModel +import com.mulberry.ody.presentation.room.detail.model.toMateUiModels import com.mulberry.ody.presentation.room.etadashboard.listener.NudgeListener import com.mulberry.ody.presentation.room.etadashboard.model.MateEtaUiModel import com.mulberry.ody.presentation.room.etadashboard.model.toMateEtaUiModels diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt index 8db08071d..178b6f58d 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/DetailMeetingBindingAdapter.kt @@ -18,10 +18,10 @@ fun ImageView.setOnClickDepartureTimeGuide(missingToolTipListener: DepartureTime @BindingAdapter("departureTime") fun TextView.setDepartureTimeText(detailMeetingUiModel: DetailMeetingUiModel) { - text = context.getString( - R.string.detail_meeting_departure_time_content, - detailMeetingUiModel.departureTime, - detailMeetingUiModel.routeTime, - ) + text = + context.getString( + R.string.detail_meeting_departure_time_content, + detailMeetingUiModel.departureTime, + detailMeetingUiModel.routeTime, + ) } - From aaa54fbd3968ea4c7d6973d7fcf81cf5f0bd4cdd Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Mon, 20 Jan 2025 15:42:28 +0900 Subject: [PATCH 16/20] =?UTF-8?q?refactor:=20isEtaAccessible=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=8D=BC=ED=8B=B0=EB=A5=BC=20=ED=95=A8=EC=88=98?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ody/presentation/room/MeetingRoomViewModel.kt | 2 +- .../room/detail/model/DetailMeetingUiModel.kt | 14 ++++++++++++-- .../detail/model/DetailMeetingUiModelMapper.kt | 5 +---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt index 07fe7ef95..0d91fdd28 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/MeetingRoomViewModel.kt @@ -202,7 +202,7 @@ class MeetingRoomViewModel fun navigateToEtaDashboard() { viewModelScope.launch { - if (!meeting.value.isEtaAccessible) { + if (!meeting.value.isEtaAccessible()) { _inaccessibleEtaEvent.emit(Unit) return@launch } diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModel.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModel.kt index f06a3a5fa..8f84e47e8 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModel.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModel.kt @@ -1,5 +1,8 @@ package com.mulberry.ody.presentation.room.detail.model +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + data class DetailMeetingUiModel( val id: Long, val name: String, @@ -10,11 +13,19 @@ data class DetailMeetingUiModel( val routeTime: String, val mates: List, val inviteCode: String, - val isEtaAccessible: Boolean, ) { + fun isEtaAccessible(): Boolean { + val formatter = DateTimeFormatter.ofPattern(DATE_TIME_PATTERN) + val localDateTime = LocalDateTime.parse(dateTime, formatter) + return localDateTime.minusMinutes(ETA_ACCESSIBLE_MINUTE) <= LocalDateTime.now() + } + fun isDefault(): Boolean = this == DEFAULT companion object { + const val DATE_TIME_PATTERN = "yyyy년 M월 d일 HH시 mm분" + private const val ETA_ACCESSIBLE_MINUTE = 30L + val DEFAULT: DetailMeetingUiModel = DetailMeetingUiModel( id = -1L, @@ -26,7 +37,6 @@ data class DetailMeetingUiModel( routeTime = "-", mates = listOf("-"), inviteCode = "", - isEtaAccessible = false, ) } } diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModelMapper.kt b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModelMapper.kt index c4e7f5efa..69cbea062 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModelMapper.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/room/detail/model/DetailMeetingUiModelMapper.kt @@ -6,8 +6,6 @@ import java.time.LocalTime import java.time.format.DateTimeFormatter fun Meeting.toDetailMeetingUiModel(): DetailMeetingUiModel { - val meetingDateTime = LocalDateTime.of(date, time) - return DetailMeetingUiModel( id = id, name = name, @@ -18,13 +16,12 @@ fun Meeting.toDetailMeetingUiModel(): DetailMeetingUiModel { routeTime = routeTime.toTimeString(), mates = mates.map { it.nickname }, inviteCode = inviteCode, - isEtaAccessible = meetingDateTime.minusMinutes(30) <= LocalDateTime.now(), ) } private fun Meeting.toDateTimeString(): String { val dateTime = LocalDateTime.of(date, time) - val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy년 M월 d일 HH시 mm분") + val dateTimeFormatter = DateTimeFormatter.ofPattern(DetailMeetingUiModel.DATE_TIME_PATTERN) return dateTime.format(dateTimeFormatter) } From 10e13d5fb6ecedab1b5378033672f7b85dad48be Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Mon, 20 Jan 2025 15:55:17 +0900 Subject: [PATCH 17/20] =?UTF-8?q?test:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=ED=94=BD=EC=8A=A4=EC=B2=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mulberry/ody/TestFixtures.kt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/android/app/src/test/java/com/mulberry/ody/TestFixtures.kt b/android/app/src/test/java/com/mulberry/ody/TestFixtures.kt index a085742c0..3bc12ce36 100644 --- a/android/app/src/test/java/com/mulberry/ody/TestFixtures.kt +++ b/android/app/src/test/java/com/mulberry/ody/TestFixtures.kt @@ -20,17 +20,18 @@ val meetingId: Long = 0L val meeting: Meeting = Meeting( - 0, - "meetingA", - "선릉 캠퍼스", - LocalDate.of(2024, 1, 1), - LocalTime.of(10, 0), - listOf(Mate("A", ""), Mate("B", ""), Mate("C", "")), - inviteCode, + id = meetingId, + name = "meetingA", + destinationAddress = "선릉 캠퍼스", + departureAddress = "잠실 캠퍼스", + date = LocalDate.of(2024, 1, 1), + time = LocalTime.of(10, 0), + departureTime = LocalTime.of(2, 30), + routeTime = 30, + mates = listOf(Mate("A", ""), Mate("B", ""), Mate("C", "")), + inviteCode = inviteCode, ) -val meetings: List = listOf(meeting) - val meetingCatalog = MeetingCatalog( meetingId, From 703f5d97ca34c01cf92264ae50f9fec3b2589df7 Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Tue, 21 Jan 2025 19:51:15 +0900 Subject: [PATCH 18/20] =?UTF-8?q?design:=20string=20=EB=AC=B8=EA=B5=AC=20?= =?UTF-8?q?=EB=9D=84=EC=96=B4=EC=93=B0=EA=B8=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index e50e8aad5..91cf3ce74 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -166,7 +166,7 @@ 출발 장소 늦지 않으려면 출발 시간은 대중교통 지연 등을 고려해\n여유 있게 알려드리고 있어요. - %s에 나가야 해요.\n출발 장소부터 약속 장소까지 %s걸려요. + %s에 나가야 해요.\n출발 장소부터 약속 장소까지 %s 걸려요. 약속 로그 친구를 초대해 보세요! 초대 코드 복사하기 From ebbbce5e143820fb163132c51e2d420c3f03b409 Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Tue, 21 Jan 2025 19:51:49 +0900 Subject: [PATCH 19/20] =?UTF-8?q?design:=20RecyclerView=20padding=20?= =?UTF-8?q?=EC=98=B5=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/src/main/res/layout/fragment_detail_meeting.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/android/app/src/main/res/layout/fragment_detail_meeting.xml b/android/app/src/main/res/layout/fragment_detail_meeting.xml index f612644c0..39d4f53cd 100644 --- a/android/app/src/main/res/layout/fragment_detail_meeting.xml +++ b/android/app/src/main/res/layout/fragment_detail_meeting.xml @@ -56,6 +56,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginHorizontal="14dp" + android:clipToPadding="false" android:orientation="horizontal" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layout_constraintBottom_toBottomOf="parent" From e7d3b50d79ebb5c545ce29aef2a26afd43968c58 Mon Sep 17 00:00:00 2001 From: kimhyemin Date: Sun, 26 Jan 2025 21:41:27 +0900 Subject: [PATCH 20/20] =?UTF-8?q?refactor:=20Point=EC=9D=98=20apply=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mulberry/ody/presentation/common/DimensionExtensions.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/android/app/src/main/java/com/mulberry/ody/presentation/common/DimensionExtensions.kt b/android/app/src/main/java/com/mulberry/ody/presentation/common/DimensionExtensions.kt index 3b9321659..b1487d16e 100644 --- a/android/app/src/main/java/com/mulberry/ody/presentation/common/DimensionExtensions.kt +++ b/android/app/src/main/java/com/mulberry/ody/presentation/common/DimensionExtensions.kt @@ -12,8 +12,5 @@ fun Int.toPixel(context: Context): Int { fun View.getPointOnScreen(): Point { val location = IntArray(2) this.getLocationOnScreen(location) - return Point().apply { - x = location[0] - y = location[1] - } + return Point(location[0], location[1]) }