diff --git a/app/src/main/java/org/sopt/official/config/messaging/SoptFirebaseMessagingService.kt b/app/src/main/java/org/sopt/official/config/messaging/SoptFirebaseMessagingService.kt index 066506175..60f1c9a7d 100644 --- a/app/src/main/java/org/sopt/official/config/messaging/SoptFirebaseMessagingService.kt +++ b/app/src/main/java/org/sopt/official/config/messaging/SoptFirebaseMessagingService.kt @@ -32,7 +32,6 @@ class SoptFirebaseMessagingService : FirebaseMessagingService() { private val job = SupervisorJob() private val scope = CoroutineScope(Dispatchers.IO + job) - override fun onNewToken(token: String) { if (dataStore.userStatus == UserStatus.UNAUTHENTICATED.name) return scope.launch { @@ -82,7 +81,6 @@ class SoptFirebaseMessagingService : FirebaseMessagingService() { link: String, notificationId: Int ): NotificationCompat.Builder { - val intent = Intent(this@SoptFirebaseMessagingService, AuthActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK) putExtra(REMOTE_MESSAGE_EVENT_TYPE, remoteMessageLinkType.name) @@ -96,7 +94,9 @@ class SoptFirebaseMessagingService : FirebaseMessagingService() { intent, if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE - } else PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE + } else { + PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE + } ) ) } diff --git a/app/src/main/java/org/sopt/official/data/service/AuthService.kt b/app/src/main/java/org/sopt/official/data/service/AuthService.kt index 0030d7869..f4047826f 100644 --- a/app/src/main/java/org/sopt/official/data/service/AuthService.kt +++ b/app/src/main/java/org/sopt/official/data/service/AuthService.kt @@ -25,7 +25,7 @@ interface AuthService { @DELETE("user") suspend fun withdraw() - @HTTP(method = "DELETE", path="user/logout", hasBody = true) + @HTTP(method = "DELETE", path = "user/logout", hasBody = true) suspend fun logOut( @Body body: LogOutRequest ): LogOutResponse diff --git a/app/src/main/java/org/sopt/official/data/service/notification/NotificationService.kt b/app/src/main/java/org/sopt/official/data/service/notification/NotificationService.kt index 747cf8ebd..8d8e17114 100644 --- a/app/src/main/java/org/sopt/official/data/service/notification/NotificationService.kt +++ b/app/src/main/java/org/sopt/official/data/service/notification/NotificationService.kt @@ -25,7 +25,6 @@ interface NotificationService { @Body body: UpdatePushTokenRequest ): UpdatePushTokenResponse - @GET("notification") suspend fun getNotificationHistory( @Query("page") page: Int @@ -36,13 +35,11 @@ interface NotificationService { @Path("notificationId") notificationId: Long ): NotificationDetailResponse - @PATCH("notification/{notificationId}") suspend fun updateNotificationReadingState( @Path("notificationId") notificationId: Long ): NotificationReadingStateResponse @PATCH("notification") - suspend fun updateEntireNotificationReadingState( - ): NotificationReadingStateResponse + suspend fun updateEntireNotificationReadingState(): NotificationReadingStateResponse } \ No newline at end of file diff --git a/app/src/main/java/org/sopt/official/di/NotificationModule.kt b/app/src/main/java/org/sopt/official/di/NotificationModule.kt index 16854b72a..c095d0e7c 100644 --- a/app/src/main/java/org/sopt/official/di/NotificationModule.kt +++ b/app/src/main/java/org/sopt/official/di/NotificationModule.kt @@ -1,5 +1,6 @@ package org.sopt.official.di +import dagger.Binds import dagger.Module import dagger.Provides import dagger.hilt.InstallIn @@ -23,11 +24,11 @@ object NotificationModule { return retrofit.create(NotificationService::class.java) } - @Provides - @Singleton - fun provideNotificationRepository( - repository: NotificationRepositoryImpl - ): NotificationRepository { - return repository + @Module + @InstallIn(SingletonComponent::class) + interface Binder { + @Binds + @Singleton + fun bindNotificationRepository(repository: NotificationRepositoryImpl): NotificationRepository } } diff --git a/app/src/main/java/org/sopt/official/feature/auth/AuthActivity.kt b/app/src/main/java/org/sopt/official/feature/auth/AuthActivity.kt index 0b4b6a482..49bb82643 100644 --- a/app/src/main/java/org/sopt/official/feature/auth/AuthActivity.kt +++ b/app/src/main/java/org/sopt/official/feature/auth/AuthActivity.kt @@ -72,17 +72,20 @@ class AuthActivity : AppCompatActivity() { val remoteMessageEventLink = it.getStringExtra(REMOTE_MESSAGE_EVENT_LINK) ?: "" if ( - dataStore.userStatus.isNotBlank() - && dataStore.userStatus != UserStatus.UNAUTHENTICATED.name - && remoteMessageEventType.isNotBlank() + dataStore.userStatus.isNotBlank() && + dataStore.userStatus != UserStatus.UNAUTHENTICATED.name && + remoteMessageEventType.isNotBlank() ) { - startActivity(HomeActivity.getIntent(this, - HomeActivity.StartArgs( - UserStatus.of(dataStore.userStatus), - remoteMessageEventType, - remoteMessageEventLink + startActivity( + HomeActivity.getIntent( + this, + HomeActivity.StartArgs( + UserStatus.of(dataStore.userStatus), + remoteMessageEventType, + remoteMessageEventLink + ) ) - )) + ) } } } @@ -109,13 +112,16 @@ class AuthActivity : AppCompatActivity() { val remoteMessageEventLink = intent.getStringExtra(REMOTE_MESSAGE_EVENT_LINK) ?: "" when (event) { is AuthUiEvent.Success -> { - startActivity(HomeActivity.getIntent(this, - HomeActivity.StartArgs( - event.userStatus, - remoteMessageEventType, - remoteMessageEventLink + startActivity( + HomeActivity.getIntent( + this, + HomeActivity.StartArgs( + event.userStatus, + remoteMessageEventType, + remoteMessageEventLink + ) ) - )) + ) } is AuthUiEvent.Failure -> { @@ -175,9 +181,14 @@ class AuthActivity : AppCompatActivity() { } } binding.btnSoptNotMember.setOnSingleClickListener { - startActivity(HomeActivity.getIntent(this, HomeActivity.StartArgs( - UserStatus.UNAUTHENTICATED - ))) + startActivity( + HomeActivity.getIntent( + this, + HomeActivity.StartArgs( + UserStatus.UNAUTHENTICATED + ) + ) + ) } } diff --git a/app/src/main/java/org/sopt/official/feature/notification/NotificationDetailActivity.kt b/app/src/main/java/org/sopt/official/feature/notification/NotificationDetailActivity.kt index 80485ce64..e67a55baf 100644 --- a/app/src/main/java/org/sopt/official/feature/notification/NotificationDetailActivity.kt +++ b/app/src/main/java/org/sopt/official/feature/notification/NotificationDetailActivity.kt @@ -51,8 +51,8 @@ class NotificationDetailActivity : AppCompatActivity() { textViewNotificationTitle.text = notification.title textViewNotificationContent.text = notification.content linearLayoutNewsDetailButton.visibility = when ( - notification.deepLink.isNullOrBlank() - && notification.webLink.isNullOrBlank() + notification.deepLink.isNullOrBlank() && + notification.webLink.isNullOrBlank() ) { true -> View.GONE false -> View.VISIBLE diff --git a/app/src/main/java/org/sopt/official/feature/notification/NotificationHistoryActivity.kt b/app/src/main/java/org/sopt/official/feature/notification/NotificationHistoryActivity.kt index 701bca65a..b9f30b5be 100644 --- a/app/src/main/java/org/sopt/official/feature/notification/NotificationHistoryActivity.kt +++ b/app/src/main/java/org/sopt/official/feature/notification/NotificationHistoryActivity.kt @@ -16,7 +16,6 @@ import org.sopt.official.R import org.sopt.official.databinding.ActivityNotificationHistoryBinding import org.sopt.official.util.viewBinding - @AndroidEntryPoint class NotificationHistoryActivity : AppCompatActivity() { diff --git a/app/src/main/java/org/sopt/official/feature/notification/NotificationHistoryListViewAdapter.kt b/app/src/main/java/org/sopt/official/feature/notification/NotificationHistoryListViewAdapter.kt index 10df3f673..c571f4290 100644 --- a/app/src/main/java/org/sopt/official/feature/notification/NotificationHistoryListViewAdapter.kt +++ b/app/src/main/java/org/sopt/official/feature/notification/NotificationHistoryListViewAdapter.kt @@ -67,7 +67,6 @@ class NotificationHistoryListViewAdapter( notifyDataSetChanged() } - inner class ViewHolder( private val viewBinding: ItemNotificationHistoryBinding ) : RecyclerView.ViewHolder(viewBinding.root) { @@ -98,8 +97,8 @@ class NotificationHistoryListViewAdapter( return when { diffInDays >= 1 -> "${diffInDays}일 전" - diffInHours >= 1 ->"${diffInHours}시간 전" - diffInMinutes >= 1 ->"${diffInMinutes}분 전" + diffInHours >= 1 -> "${diffInHours}시간 전" + diffInMinutes >= 1 -> "${diffInMinutes}분 전" else -> "방금" } }