diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/notification/NotificationViewModel.kt b/app/src/main/java/com/polzzak_android/presentation/feature/notification/NotificationViewModel.kt index 1dc7fe9c..2574c692 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/notification/NotificationViewModel.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/notification/NotificationViewModel.kt @@ -111,6 +111,7 @@ class NotificationViewModel @AssistedInject constructor( _notificationLiveData.value = ModelState.Loading(prevData.copy(isRefreshable = true)) notificationMutex.unlock() + notificationHorizontalScrollPositionMap.clear() requestNotifications(accessToken = accessToken) }, ) @@ -352,8 +353,8 @@ private fun getMockNotifications(nextId: Int?, pageSize: Int = 10) = ApiResult.s private val mockNotifications = List(187) { NotificationDto( id = it, - type = "FAMILY_REQUEST", - status = "UNREAD", + type = "FAMILY_REQUEST_COMPLETE", + status = if (it % 2 == 0) "READ" else "UNREAD", title = "title$it", message = "message$it", sender = NotificationDto.Sender(id = it, nickName = "nickName$it", null), diff --git a/app/src/main/java/com/polzzak_android/presentation/feature/notification/list/base/BaseNotificationListFragment.kt b/app/src/main/java/com/polzzak_android/presentation/feature/notification/list/base/BaseNotificationListFragment.kt index b5cbad5d..382c3179 100644 --- a/app/src/main/java/com/polzzak_android/presentation/feature/notification/list/base/BaseNotificationListFragment.kt +++ b/app/src/main/java/com/polzzak_android/presentation/feature/notification/list/base/BaseNotificationListFragment.kt @@ -104,12 +104,9 @@ abstract class BaseNotificationListFragment : BaseFragment>() - var updateCallback: (() -> Unit)? = null binding.srlNotifications.isEnabled = it.data?.isRefreshable ?: false when (it) { is ModelState.Loading -> { @@ -128,11 +125,6 @@ abstract class BaseNotificationListFragment : BaseFragment { items.addAll(createNotificationItems(data = it.data.items)) binding.srlNotifications.isRefreshing = false - if (notificationViewModel.isRefreshed) { - updateCallback = { - layoutManager.scrollToPositionWithOffset(1, 0) - } - } } is ModelState.Error -> { @@ -140,7 +132,7 @@ abstract class BaseNotificationListFragment : BaseFragment + +