From 73597543739802e297774f6f26aac4876b0aea48 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Mon, 23 Oct 2023 15:48:56 +0900 Subject: [PATCH 01/57] =?UTF-8?q?[FEAT]=20data=20type=20notification=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1=20?= =?UTF-8?q?(#145)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lgtm/android/LGTMFirebaseMessagingService.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt index 02ea1534..8f5be774 100644 --- a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt +++ b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt @@ -30,7 +30,11 @@ class LGTMFirebaseMessagingService : FirebaseMessagingService(), LgtmMessagingSe super.onMessageReceived(remoteMessage) if (remoteMessage.data.isNotEmpty()) { - // data 확인 + // todo 추후 디테일한 로직 처리 필요 + val data = remoteMessage.data + val title = data["title"] + val description = data["body"] + generateNotification(title, description) } remoteMessage.notification?.let { From 49beed0f6ecdaf84099d251824442e2a8460e962 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 25 Oct 2023 01:40:25 +0900 Subject: [PATCH 02/57] =?UTF-8?q?[FEAT]=20data=20type=20notification=20?= =?UTF-8?q?=EB=B0=B1=EC=8A=A4=ED=83=9D=20=EC=A7=80=EC=A0=95=20=EB=B0=8F=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=ED=95=A8=EC=88=98=ED=99=94=20(#145)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../android/LGTMFirebaseMessagingService.kt | 58 ++++++++++++++----- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt index 8f5be774..84dca43f 100644 --- a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt +++ b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt @@ -2,20 +2,23 @@ package com.lgtm.android import android.app.NotificationChannel import android.app.NotificationManager +import android.app.PendingIntent +import android.app.TaskStackBuilder import android.content.Context -import android.graphics.Bitmap +import android.content.Intent import android.util.Log import androidx.core.app.NotificationCompat import com.google.firebase.messaging.FirebaseMessaging import com.google.firebase.messaging.FirebaseMessagingService import com.google.firebase.messaging.RemoteMessage import com.lgtm.android.common_ui.R +import com.lgtm.android.main.MainActivity +import com.lgtm.android.manage_mission.dashboard.DashboardActivity import com.lgtm.domain.firebase.LgtmMessagingService import com.lgtm.domain.usecase.DeviceTokenManagerUseCase import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject - @AndroidEntryPoint class LGTMFirebaseMessagingService : FirebaseMessagingService(), LgtmMessagingService { @Inject @@ -30,34 +33,48 @@ class LGTMFirebaseMessagingService : FirebaseMessagingService(), LgtmMessagingSe super.onMessageReceived(remoteMessage) if (remoteMessage.data.isNotEmpty()) { - // todo 추후 디테일한 로직 처리 필요 - val data = remoteMessage.data - val title = data["title"] - val description = data["body"] - generateNotification(title, description) + handleDataType(remoteMessage.data) } remoteMessage.notification?.let { - generateNotification(it.title!!, it.body!!) + handleNotificationType(it) } } - private fun generateNotification( - title: String?, - message: String?, - image: Bitmap? = null, - ) { + private fun handleDataType(data: Map) { val requestCode = System.currentTimeMillis().toInt() - val builder = NotificationCompat.Builder(this, channelID) + val dashboardIntent = Intent(this, DashboardActivity::class.java) + .putExtra(DashboardActivity.MISSION_ID, data["missionId"]?.toInt() ?: return) + val mainIntent = Intent(this, MainActivity::class.java) + + val stackBuilder = TaskStackBuilder.create(this) + .addParentStack(MainActivity::class.java) + .addNextIntent(mainIntent) + .addNextIntent(dashboardIntent) + + val resultPendingIntent = + stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT) + + val builder = createNotificationBuilder(data["title"], data["body"], resultPendingIntent) + notifyWithChannel(requestCode, builder) + } + + private fun createNotificationBuilder( + title: String?, + message: String?, + contentIntent: PendingIntent? + ): NotificationCompat.Builder { + return NotificationCompat.Builder(this, channelID) .setPriority(NotificationCompat.PRIORITY_HIGH) .setSmallIcon(R.drawable.ic_launcher_foreground) -// .setColor(Color.argb(255, 133, 120, 255)) // havit_purple .setAutoCancel(true) .setContentTitle(title) - .setLargeIcon(image) .setStyle(NotificationCompat.BigTextStyle().bigText(message)) + .setContentIntent(contentIntent) + } + private fun notifyWithChannel(requestCode: Int, builder: NotificationCompat.Builder) { val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager @@ -67,6 +84,15 @@ class LGTMFirebaseMessagingService : FirebaseMessagingService(), LgtmMessagingSe notificationManager.notify(requestCode, builder.build()) } + private fun handleNotificationType(notification: RemoteMessage.Notification) { + val title = notification.title ?: "" + val message = notification.body ?: "" + val requestCode = System.currentTimeMillis().toInt() + + val builder = createNotificationBuilder(title, message, null) + notifyWithChannel(requestCode, builder) + } + override fun getDeviceToken(tokenCallBack: (String?) -> Unit) { FirebaseMessaging.getInstance().token.addOnCompleteListener { task -> if (!task.isSuccessful) { From 4e1cd74d1d3f814b9210c5f8aee7f0c3d283be1d Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 25 Oct 2023 02:07:20 +0900 Subject: [PATCH 03/57] =?UTF-8?q?[FIX]=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=ED=9B=84=20=EC=83=88=EB=A1=9C=EC=9A=B4=20=EA=B3=84?= =?UTF-8?q?=EC=A0=95=EC=9C=BC=EB=A1=9C=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=ED=95=98=EA=B2=8C=20=EC=88=98=EC=A0=95=20(#1?= =?UTF-8?q?49)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lgtm/android/auth/ui/github/GithubBottomSheet.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt index 7bb95375..3cd31cba 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt @@ -5,6 +5,7 @@ import android.content.ContentValues.TAG import android.os.Bundle import android.util.Log import android.view.View +import android.webkit.CookieManager import com.google.android.material.bottomsheet.BottomSheetDialog import com.lgtm.android.auth.BuildConfig.DEBUG import com.lgtm.android.auth.BuildConfig.LGTM_BASE_URL_DEBUG @@ -33,6 +34,7 @@ class GithubBottomSheet constructor(private val loginSuccessListener: OnLoginSuc @SuppressLint("SetJavaScriptEnabled") private fun loadGithubLoginUsingWebView() { + clearPreviousLoginCookie() binding.webView.apply { settings.javaScriptEnabled = true webViewClient = @@ -42,6 +44,11 @@ class GithubBottomSheet constructor(private val loginSuccessListener: OnLoginSuc } } + private fun clearPreviousLoginCookie() { + CookieManager.getInstance().removeAllCookies(null) + CookieManager.getInstance().flush() + } + private fun getGithubLoginUrl() = (if (DEBUG) LGTM_BASE_URL_DEBUG else LGTM_BASE_URL_RELEASE) + "login/getGithubAuthUrl" From f10c4addf012a5ade2f690a9555822498e6ac6db Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 25 Oct 2023 02:07:38 +0900 Subject: [PATCH 04/57] =?UTF-8?q?[CHORE]=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20todo=20=ED=95=A8=EC=88=98=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lgtm/android/main/setting/MyPageFragment.kt | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt index 6a788420..326e5ec8 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt @@ -26,7 +26,6 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - setProfileOnClickListener() setMyMissionOnClickListener() setNotificationSettingClickListener() setNoticeOnClickListener() @@ -51,12 +50,13 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ } } - private fun setProfileOnClickListener() { - binding.clMyProfile.setOnClickListener { - // todo move to new intent + private fun setOnProfileClickListener() { + binding.clProfileGlance.setOnClickListener { + navigateToProfile() } } + private fun setMyMissionOnClickListener() { binding.btnMyMission.setOnClickListener { // MVP 구현사항 아님 @@ -79,7 +79,8 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ private fun setNoticeOnClickListener() { // 공지사항 binding.btnNotice.setOnClickListener { - val url = "https://team-hkcc.notion.site/4823db3b781e40fdadd0cf61093c5158?v=3cee323345414e318192b89bfe7dd2d0&pvs=4" + val url = + "https://team-hkcc.notion.site/4823db3b781e40fdadd0cf61093c5158?v=3cee323345414e318192b89bfe7dd2d0&pvs=4" openUrlInBrowser(url) } } @@ -114,6 +115,7 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ private fun logout() { myPageViewModel.clearUserData() + requireContext().cacheDir.deleteRecursively() moveToSignInActivity() } @@ -168,11 +170,6 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ Toast.makeText(requireContext(), "메일 주소가 복사되었습니다", Toast.LENGTH_SHORT).show() } - private fun setOnProfileClickListener() { - binding.clProfileGlance.setOnClickListener { - navigateToProfile() - } - } private fun navigateToProfile() { lgtmNavigator.navigateToProfile(requireContext()) From 9e80983e124a410a6fb7298c83e3e46eb496436c Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 25 Oct 2023 02:18:01 +0900 Subject: [PATCH 05/57] =?UTF-8?q?[CHORE]=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20cache=20=EC=A0=9C=EA=B1=B0=20=EB=A1=9C=EC=A7=81=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 --- .../main/java/com/lgtm/android/main/setting/MyPageFragment.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt index 326e5ec8..ea581b98 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt @@ -79,8 +79,7 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ private fun setNoticeOnClickListener() { // 공지사항 binding.btnNotice.setOnClickListener { - val url = - "https://team-hkcc.notion.site/4823db3b781e40fdadd0cf61093c5158?v=3cee323345414e318192b89bfe7dd2d0&pvs=4" + val url = "https://team-hkcc.notion.site/4823db3b781e40fdadd0cf61093c5158?v=3cee323345414e318192b89bfe7dd2d0&pvs=4" openUrlInBrowser(url) } } @@ -115,7 +114,6 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ private fun logout() { myPageViewModel.clearUserData() - requireContext().cacheDir.deleteRecursively() moveToSignInActivity() } From 3544bbe0482fcab57dcf498db345418ce3ac05f2 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 25 Oct 2023 02:50:37 +0900 Subject: [PATCH 06/57] =?UTF-8?q?[FIX]=20Github=20Login=ED=95=A0=EB=95=8C?= =?UTF-8?q?=20PW=20=EC=98=81=EC=97=AD=EC=9D=B4=20=ED=82=A4=EB=B3=B4?= =?UTF-8?q?=EB=93=9C=EC=97=90=20=EA=B0=80=EB=A0=A4=EC=A7=80=EB=8A=94=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0=20(#151)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lgtm/android/auth/ui/github/GithubBottomSheet.kt | 7 +++++++ .../src/main/res/layout/fragment_create_mission_step3.xml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt index 3cd31cba..bdef44d9 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt @@ -13,7 +13,9 @@ import com.lgtm.android.auth.BuildConfig.LGTM_BASE_URL_RELEASE import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.BottomSheetGithubBinding import com.lgtm.android.auth.ui.OnLoginSuccess +import com.lgtm.android.common_ui.R.* import com.lgtm.android.common_ui.base.BaseBottomSheetFragment +import com.lgtm.android.common_ui.util.KeyboardUtil class GithubBottomSheet constructor(private val loginSuccessListener: OnLoginSuccess) : @@ -23,6 +25,7 @@ class GithubBottomSheet constructor(private val loginSuccessListener: OnLoginSuc super.onViewCreated(view, savedInstanceState) loadGithubLoginUsingWebView() setBottomSheetHeight(0.93) + setSoftKeyboard() } override fun setBottomSheetBehavior() { @@ -32,6 +35,10 @@ class GithubBottomSheet constructor(private val loginSuccessListener: OnLoginSuc } } + private fun setSoftKeyboard() { + KeyboardUtil().setUpAsSoftKeyboard(binding.webView) + } + @SuppressLint("SetJavaScriptEnabled") private fun loadGithubLoginUsingWebView() { clearPreviousLoginCookie() diff --git a/feature/create_mission/src/main/res/layout/fragment_create_mission_step3.xml b/feature/create_mission/src/main/res/layout/fragment_create_mission_step3.xml index 670ee488..fc677ff3 100644 --- a/feature/create_mission/src/main/res/layout/fragment_create_mission_step3.xml +++ b/feature/create_mission/src/main/res/layout/fragment_create_mission_step3.xml @@ -19,7 +19,7 @@ From 384fface1a8b0e0e892fa70a267f52af64f161fa Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 25 Oct 2023 03:43:44 +0900 Subject: [PATCH 07/57] =?UTF-8?q?[FEAT]=20Mission=20=EC=82=AD=EC=A0=9C=20a?= =?UTF-8?q?pi=20=EC=97=B0=EB=8F=99=20(#153)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common-ui/src/main/res/values/strings.xml | 3 ++ .../data/datasource/MissionDataSource.kt | 11 ++++- .../data/repository/MissionRepositoryImpl.kt | 15 +++++- .../android/data/service/MissionService.kt | 7 +++ .../entity/response/DeleteMissionResponse.kt | 6 +++ .../domain/repository/MissionRepository.kt | 2 +- .../com/lgtm/domain/usecase/MissionUseCase.kt | 8 ++++ .../mission_detail/MissionDetailActivity.kt | 46 ++++++++++++++++--- .../mission_detail/MissionDetailViewModel.kt | 21 +++++++++ 9 files changed, 109 insertions(+), 10 deletions(-) create mode 100644 domain/src/main/java/com/lgtm/domain/entity/response/DeleteMissionResponse.kt diff --git a/common-ui/src/main/res/values/strings.xml b/common-ui/src/main/res/values/strings.xml index e97ba700..0afc30e8 100644 --- a/common-ui/src/main/res/values/strings.xml +++ b/common-ui/src/main/res/values/strings.xml @@ -144,6 +144,9 @@ 로그아웃 하시겠어요? 참여한 미션은 취소가 불가능해요 미션에 참여하시겠어요? + 미션을 삭제하시겠어요? + 이미 미션에 참여한 리뷰이가 있다면 미션 삭제가 불가능합니다. + 미션이 삭제되었습니다. Github 방문 diff --git a/data/src/main/java/com/lgtm/android/data/datasource/MissionDataSource.kt b/data/src/main/java/com/lgtm/android/data/datasource/MissionDataSource.kt index bd2c35e2..ae0a83c6 100644 --- a/data/src/main/java/com/lgtm/android/data/datasource/MissionDataSource.kt +++ b/data/src/main/java/com/lgtm/android/data/datasource/MissionDataSource.kt @@ -9,6 +9,7 @@ import com.lgtm.android.data.model.response.PingPongSeniorDTO import com.lgtm.android.data.model.response.PostMissionResponseDTO import com.lgtm.android.data.service.MissionService import com.lgtm.domain.entity.request.PostMissionRequestDTO +import com.lgtm.domain.entity.response.DeleteMissionResponse import com.lgtm.domain.entity.response.PingPongResponse import javax.inject.Inject @@ -69,7 +70,7 @@ class MissionDataSource @Inject constructor( ) } - suspend fun codeReviewCompleted(missionId: Int, juniorId: Int): BaseDTO { + suspend fun codeReviewCompleted(missionId: Int, juniorId: Int): BaseDTO { return checkResponse( missionService.codeReviewCompleted( missionId = missionId, @@ -77,4 +78,12 @@ class MissionDataSource @Inject constructor( ) ) } + + suspend fun deleteMission(missionId: Int): BaseDTO { + return checkResponse( + missionService.deleteMission( + missionId = missionId, + ) + ) + } } \ No newline at end of file diff --git a/data/src/main/java/com/lgtm/android/data/repository/MissionRepositoryImpl.kt b/data/src/main/java/com/lgtm/android/data/repository/MissionRepositoryImpl.kt index 552c167b..324acc2e 100644 --- a/data/src/main/java/com/lgtm/android/data/repository/MissionRepositoryImpl.kt +++ b/data/src/main/java/com/lgtm/android/data/repository/MissionRepositoryImpl.kt @@ -131,7 +131,10 @@ class MissionRepositoryImpl @Inject constructor( ) Result.success(response.data.toVO()) } catch (e: IllegalArgumentException) { - Log.e(TAG, "fetchSeniorMissionStatus: ${this.javaClass} ${e.message} / casting 도중 null 값 발생") + Log.e( + TAG, + "fetchSeniorMissionStatus: ${this.javaClass} ${e.message} / casting 도중 null 값 발생" + ) Result.failure(e) } catch (e: Exception) { Log.e(TAG, "fetchSeniorMissionStatus: ${this.javaClass} ${e.message}") @@ -174,4 +177,14 @@ class MissionRepositoryImpl @Inject constructor( Result.failure(e) } } + + override suspend fun deleteMission(missionId: Int): Result { + return try { + val response = missionDataSource.deleteMission(missionId) + Result.success(response.data.writerId != null) + } catch (e: Exception) { + Log.e(TAG, "deleteMission: ${this.javaClass} ${e.message}") + Result.failure(e) + } + } } diff --git a/data/src/main/java/com/lgtm/android/data/service/MissionService.kt b/data/src/main/java/com/lgtm/android/data/service/MissionService.kt index 914be01c..f25e16f9 100644 --- a/data/src/main/java/com/lgtm/android/data/service/MissionService.kt +++ b/data/src/main/java/com/lgtm/android/data/service/MissionService.kt @@ -9,9 +9,11 @@ import com.lgtm.android.data.model.response.PingPongSeniorDTO import com.lgtm.android.data.model.response.PostMissionResponseDTO import com.lgtm.android.data.model.response.SduiDTO import com.lgtm.domain.entity.request.PostMissionRequestDTO +import com.lgtm.domain.entity.response.DeleteMissionResponse import com.lgtm.domain.entity.response.PingPongResponse import retrofit2.Response import retrofit2.http.Body +import retrofit2.http.DELETE import retrofit2.http.GET import retrofit2.http.POST import retrofit2.http.Path @@ -80,5 +82,10 @@ interface MissionService { @Path("missionId") missionId: Int, @Path("juniorId") juniorId: Int ): Response> + + @DELETE("v1/mission/{missionId}") + suspend fun deleteMission( + @Path("missionId") missionId: Int, + ): Response> } diff --git a/domain/src/main/java/com/lgtm/domain/entity/response/DeleteMissionResponse.kt b/domain/src/main/java/com/lgtm/domain/entity/response/DeleteMissionResponse.kt new file mode 100644 index 00000000..0fd0e113 --- /dev/null +++ b/domain/src/main/java/com/lgtm/domain/entity/response/DeleteMissionResponse.kt @@ -0,0 +1,6 @@ +package com.lgtm.domain.entity.response + +data class DeleteMissionResponse( + val writerId: Int?, + val missionId: Int? +) diff --git a/domain/src/main/java/com/lgtm/domain/repository/MissionRepository.kt b/domain/src/main/java/com/lgtm/domain/repository/MissionRepository.kt index 08599dd7..56c270ce 100644 --- a/domain/src/main/java/com/lgtm/domain/repository/MissionRepository.kt +++ b/domain/src/main/java/com/lgtm/domain/repository/MissionRepository.kt @@ -27,5 +27,5 @@ interface MissionRepository { suspend fun submitPullRequest(missionId: Int, githubPrUrl: String): Result suspend fun codeReviewCompleted(missionId: Int, juniorId: Int): Result - + suspend fun deleteMission(missionId: Int): Result } \ No newline at end of file diff --git a/domain/src/main/java/com/lgtm/domain/usecase/MissionUseCase.kt b/domain/src/main/java/com/lgtm/domain/usecase/MissionUseCase.kt index 4945e3ef..e36d81ca 100644 --- a/domain/src/main/java/com/lgtm/domain/usecase/MissionUseCase.kt +++ b/domain/src/main/java/com/lgtm/domain/usecase/MissionUseCase.kt @@ -208,6 +208,14 @@ class MissionUseCase @Inject constructor( } } + suspend fun deleteMission(missionId: Int): Result { + return try { + missionRepository.deleteMission(missionId) + } catch (e: Exception) { + Result.failure(e) + } + } + companion object { // viewType private const val ONGOING_MISSION_EMPTY_VIEW = "ongoing_mission_empty_view" diff --git a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt index 71a990af..eccf11ce 100644 --- a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt +++ b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt @@ -58,6 +58,7 @@ class MissionDetailActivity : initAdapter() setRecyclerViewLayoutManager() observeParticipateMissionUiState() + observeDeleteMissionStatus() } override fun onResume() { @@ -159,18 +160,13 @@ class MissionDetailActivity : override fun onMenuItemClick(item: MenuItem): Boolean { return when (item.itemId) { - id.report -> { + id.report, id.edit_profile -> { Toast.makeText(this, string.service_under_preparation, Toast.LENGTH_SHORT).show() true } id.delete_mission -> { - Toast.makeText(this, string.service_under_preparation, Toast.LENGTH_SHORT).show() - true - } - - id.edit_profile -> { - Toast.makeText(this, string.service_under_preparation, Toast.LENGTH_SHORT).show() + showDeleteMissionDialog() true } @@ -178,6 +174,42 @@ class MissionDetailActivity : } } + private fun showDeleteMissionDialog() { + val title = getString(string.delete_mission_title) + val description = getString(string.delete_mission_message) + val dialog = LgtmConfirmationDialog( + title = title, + description = description, + doAfterConfirm = ::deleteMission, + confirmBtnBackground = LgtmConfirmationDialog.ConfirmButtonBackground.GREEN + ) + dialog.show(supportFragmentManager, this.javaClass.name) + } + + private fun deleteMission() { + missionDetailViewModel.deleteMission() + } + + private fun observeDeleteMissionStatus() { + missionDetailViewModel.deleteMissionState.observe(this) { + when (it) { + is NetworkState.Init -> {} /* no-op*/ + is NetworkState.Success -> { + showMissionDeleteSuccessToast() + finish() + } + + is NetworkState.Failure -> { + Toast.makeText(this, it.msg, Toast.LENGTH_SHORT).show() + } + } + } + } + + private fun showMissionDeleteSuccessToast() { + Toast.makeText(this, getString(string.delete_mission_success), Toast.LENGTH_SHORT).show() + } + private fun setOnMissionUrlClickListener() { binding.clMissionUrl.setOnClickListener { val url: String = missionDetailViewModel.getMissionUrl() ?: return@setOnClickListener diff --git a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailViewModel.kt b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailViewModel.kt index cf865cab..9043d95b 100644 --- a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailViewModel.kt +++ b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailViewModel.kt @@ -36,6 +36,14 @@ class MissionDetailViewModel @Inject constructor( MutableLiveData(NetworkState.Init) val participateMissionUiState: LiveData> = _participateMissionUiState + private val _deleteMissionState: MutableLiveData> = + MutableLiveData(NetworkState.Init) + val deleteMissionState: LiveData> = _deleteMissionState + + private val _missionDetailStatus: MutableLiveData> = + MutableLiveData(NetworkState.Init) + val missionDetailStatus: LiveData> = _missionDetailStatus + fun isMyMission() = _missionDetailVO.value?.missionDetailStatus == MissionDetailStatus.SENIOR_PARTICIPATE_RECRUITING || _missionDetailVO.value?.missionDetailStatus == MissionDetailStatus.SENIOR_PARTICIPATE_MISSION_FINISH @@ -74,7 +82,9 @@ class MissionDetailViewModel @Inject constructor( .onSuccess { _missionDetailVO.postValue(it) _missionDetailUiState.postValue(it.toUiModel()) + _missionDetailStatus.postValue(NetworkState.Success(true)) }.onFailure { + _missionDetailStatus.postValue(NetworkState.Failure(it.message)) Log.e(TAG, "getMissionDetail: $it") } } @@ -93,4 +103,15 @@ class MissionDetailViewModel @Inject constructor( } fun getMissionId() = _missionDetailVO.value?.missionId ?: -1 + fun deleteMission() { + val missionId = _missionDetailVO.value?.missionId ?: return + viewModelScope.launch(lgtmErrorHandler) { + missionUseCase.deleteMission(missionId) + .onSuccess { + _deleteMissionState.postValue(NetworkState.Success(it)) + }.onFailure { + _deleteMissionState.postValue(NetworkState.Failure(it.message)) + } + } + } } \ No newline at end of file From 6f64cb05a972d65f2f42863462f50466722ed0fe Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 25 Oct 2023 03:44:22 +0900 Subject: [PATCH 08/57] =?UTF-8?q?[FEAT]=20=EC=82=AD=EC=A0=9C=EB=90=9C=20?= =?UTF-8?q?=EB=AF=B8=EC=85=98=EC=9D=84=20=EC=A1=B0=ED=9A=8C=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EA=B2=BD=EC=9A=B0=20toast=EB=A1=9C=20'=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=EB=90=9C=20=EB=AF=B8=EC=85=98'=EC=9E=84=EC=9D=84=20?= =?UTF-8?q?=EC=95=8C=EB=A0=A4=EC=A3=BC=EA=B8=B0=20(#153)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mission_detail/MissionDetailActivity.kt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt index eccf11ce..83a2e497 100644 --- a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt +++ b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt @@ -79,11 +79,20 @@ class MissionDetailActivity : } private fun observeMissionDetailUiState() { - missionDetailViewModel.missionDetailUiState.observe(this) { - missionDetailViewModel.setRecommendToEmptyVisibility() - missionDetailViewModel.setNotRecommendToEmptyVisibility() - techTagAdapter.submitList(it.techTagList) - binding.profileGlance.data = requireNotNull(it.memberProfile) + missionDetailViewModel.missionDetailStatus.observe(this) { + when (it) { + is NetworkState.Init -> {} // no-op + is NetworkState.Success -> { + val missionDetailUi = missionDetailViewModel.missionDetailUiState.value + missionDetailViewModel.setRecommendToEmptyVisibility() + missionDetailViewModel.setNotRecommendToEmptyVisibility() + techTagAdapter.submitList(missionDetailUi?.techTagList) + binding.profileGlance.data = requireNotNull(missionDetailUi?.memberProfile) + } + is NetworkState.Failure -> { + Toast.makeText(this, it.msg, Toast.LENGTH_SHORT).show() + } + } } } From a3fcbb461399c31b179f0b1b737d9ecb71472fe2 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 25 Oct 2023 03:47:31 +0900 Subject: [PATCH 09/57] =?UTF-8?q?[CHORE]=20SonarList=20Code=20Smell=20?= =?UTF-8?q?=EC=97=86=EC=95=A0=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lgtm/android/mission_detail/MissionDetailActivity.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt index 83a2e497..34fc84df 100644 --- a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt +++ b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt @@ -20,7 +20,6 @@ import com.lgtm.android.common_ui.ui.LgtmConfirmationDialog import com.lgtm.android.common_ui.util.NetworkState import com.lgtm.android.common_ui.util.getDrawableCompat import com.lgtm.android.mission_detail.databinding.ActivityMissionDetailBinding -import com.lgtm.domain.constants.MissionDetailStatus import com.lgtm.domain.constants.MissionDetailStatus.JUNIOR_NOT_PARTICIPATE_MISSION_FINISH import com.lgtm.domain.constants.MissionDetailStatus.JUNIOR_NOT_PARTICIPATE_RECRUITING import com.lgtm.domain.constants.MissionDetailStatus.JUNIOR_PARTICIPATE_MISSION_FINISH @@ -81,7 +80,7 @@ class MissionDetailActivity : private fun observeMissionDetailUiState() { missionDetailViewModel.missionDetailStatus.observe(this) { when (it) { - is NetworkState.Init -> {} // no-op + is NetworkState.Init -> { /* no-op */} is NetworkState.Success -> { val missionDetailUi = missionDetailViewModel.missionDetailUiState.value missionDetailViewModel.setRecommendToEmptyVisibility() @@ -89,6 +88,7 @@ class MissionDetailActivity : techTagAdapter.submitList(missionDetailUi?.techTagList) binding.profileGlance.data = requireNotNull(missionDetailUi?.memberProfile) } + is NetworkState.Failure -> { Toast.makeText(this, it.msg, Toast.LENGTH_SHORT).show() } @@ -202,7 +202,7 @@ class MissionDetailActivity : private fun observeDeleteMissionStatus() { missionDetailViewModel.deleteMissionState.observe(this) { when (it) { - is NetworkState.Init -> {} /* no-op*/ + is NetworkState.Init -> { /* no-op*/ } is NetworkState.Success -> { showMissionDeleteSuccessToast() finish() @@ -231,7 +231,7 @@ class MissionDetailActivity : private fun setOnClickBottomButton() { binding.btnMissionDetail.setOnClickListener { - val missionDetailStatus: MissionDetailStatus = + val missionDetailStatus = missionDetailViewModel.getMissionDetailStatus() ?: return@setOnClickListener when (missionDetailStatus) { JUNIOR_PARTICIPATE_RECRUITING -> navigateJuniorMyMission() From e6c1aa09a292f3481d716bdf5c9f9f17bfa69b0a Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 25 Oct 2023 16:10:12 +0900 Subject: [PATCH 10/57] =?UTF-8?q?[FEAT]=20ProductFlavor=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC=20(#158)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e37b75d8..81c0620b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("UnstableApiUsage") + import org.jetbrains.kotlin.konan.properties.Properties val lgtmPropertiesFile = rootProject.file("lgtm.properties") @@ -45,6 +47,23 @@ android { } } + flavorDimensions += "version" + productFlavors { + create("prod") { + dimension = "version" + manifestPlaceholders["appLabel"] = "LGTM" + buildConfigField("boolean", "IS_PROD", "true") + buildConfigField("boolean", "IS_DEV", "false") + } + create("dev") { + dimension = "version" + applicationIdSuffix = ".dev" + manifestPlaceholders["appLabel"] = "(Dev)LGTM" + buildConfigField("boolean", "IS_PROD", "false") + buildConfigField("boolean", "IS_DEV", "true") + } + } + buildFeatures { buildConfig = true } From 75dd744803ecefa355da04b4eb1a5fa909e288ef Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 25 Oct 2023 16:13:42 +0900 Subject: [PATCH 11/57] =?UTF-8?q?[FEAT]=20AppLabel=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?(#158)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3d0d8a3d..13eeb172 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -8,7 +8,7 @@ android:name=".LGTMApplication" android:allowBackup="false" android:icon="@mipmap/ic_launcher" - android:label="@string/app_name" + android:label="${appLabel}" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.LGTMAndroid" From 040b1324d9c6310c9e6bc3f6da2994de998f6697 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Fri, 3 Nov 2023 20:06:39 +0900 Subject: [PATCH 12/57] =?UTF-8?q?[FEAT]=20=EB=A6=AC=EB=B7=B0=EC=96=B4=20?= =?UTF-8?q?=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20=EC=8B=9C=20=EA=B2=BD?= =?UTF-8?q?=EB=A0=A5=20=EC=A0=9C=ED=95=9C=EC=9D=84=2012=EA=B0=9C=EC=9B=94?= =?UTF-8?q?=EC=97=90=EC=84=9C=201=EA=B0=9C=EC=9B=94=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#160)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/lgtm/android/common_ui/constant/InfoType.kt | 4 ++-- common-ui/src/main/res/values/strings.xml | 2 +- .../java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/constant/InfoType.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/constant/InfoType.kt index 318d0094..aa7e21be 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/constant/InfoType.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/constant/InfoType.kt @@ -21,8 +21,8 @@ enum class InfoType( R.drawable.ic_info_red ), VALID_REAL_NAME(R.color.red, R.string.write_correct_name, true, R.drawable.ic_info_red), - OVER_12_MONTHS_EXPERIENCE_REQUIRED( - R.color.red, R.string.over_12_month_experience_required, + EXPERIENCE_REQUIRED( + R.color.red, R.string.career_experience_required, true, R.drawable.ic_info_red ), GITHUB_URL_ONLY(R.color.red, R.string.github_url_only, true, R.drawable.ic_info_red), diff --git a/common-ui/src/main/res/values/strings.xml b/common-ui/src/main/res/values/strings.xml index 0afc30e8..afed75e1 100644 --- a/common-ui/src/main/res/values/strings.xml +++ b/common-ui/src/main/res/values/strings.xml @@ -44,7 +44,7 @@ 띄어쓰기는 사용할 수 없습니다. 띄어쓰기만 입력할 수 없습니다. 올바른 실명을 입력해 주세요. - 경력 12개월 이상만 가입할 수 있습니다. + 현업 개발자만 리뷰어 활동이 가능해요 중복된 닉네임입니다. 사용 가능합니다. diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt index d0e04d5f..1848f7ea 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt @@ -275,7 +275,7 @@ class SignUpViewModel @Inject constructor( val careerPeriod = careerPeriod.value careerPeriodInfoStatus.value = when { careerPeriod == null -> InfoType.NONE - careerPeriod < 12 -> InfoType.OVER_12_MONTHS_EXPERIENCE_REQUIRED + careerPeriod < 1 -> InfoType.EXPERIENCE_REQUIRED else -> InfoType.NONE } } From 217b83e90c843dc8d195bfd361cc9a7e35310e3b Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Sat, 4 Nov 2023 16:50:29 +0900 Subject: [PATCH 13/57] =?UTF-8?q?[FIX]=20Build=20Variants=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=EC=97=90=20=EB=94=B0=EB=A5=B8=20apk=20=EA=B2=BD?= =?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 --- .github/workflows/prBuilder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prBuilder.yml b/.github/workflows/prBuilder.yml index 4cbe91bf..bbf95a81 100644 --- a/.github/workflows/prBuilder.yml +++ b/.github/workflows/prBuilder.yml @@ -60,7 +60,7 @@ jobs: appId: ${{ secrets.FIREBASE_APP_ID }} token: ${{ secrets.FIREBASE_TOKEN }} groups: hello-kitty-coding-club - file: app/build/outputs/apk/debug/app-debug.apk + file: app/build/outputs/apk/dev/debug/app-dev-debug.apk releaseNotes: | ${{ github.event.pull_request.title }} ${{ github.event.pull_request.html_url }} From 083757be137e047fac8f9ad045f4978c06468b31 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Sat, 4 Nov 2023 17:30:51 +0900 Subject: [PATCH 14/57] =?UTF-8?q?[FIX]=20Build=20Variants=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=EC=97=90=20=EB=94=B0=EB=A5=B8=20google-services.json?= =?UTF-8?q?=20=EC=9E=AC=EC=84=A4=EC=A0=95=20(#145)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/dev/google-services.json | 29 ++++++++ .../android/LGTMFirebaseMessagingService.kt | 5 +- app/src/prod/google-services.json | 68 +++++++++++++++++++ 3 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 app/src/prod/google-services.json diff --git a/app/src/dev/google-services.json b/app/src/dev/google-services.json index 7c0e6254..3af481cd 100644 --- a/app/src/dev/google-services.json +++ b/app/src/dev/google-services.json @@ -5,6 +5,35 @@ "storage_bucket": "lgtm-aeb7a.appspot.com" }, "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1090377873764:android:5eb9f699608d0e5994e271", + "android_client_info": { + "package_name": "com.lgtm.android" + } + }, + "oauth_client": [ + { + "client_id": "1090377873764-b6gm8buak4slf1vf8a4osmjfm1ktokle.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAsd0MS5XNM3GoQlHKw09z9X9pK3R2EC3Y" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "1090377873764-b6gm8buak4slf1vf8a4osmjfm1ktokle.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + }, { "client_info": { "mobilesdk_app_id": "1:1090377873764:android:828cd0a400b0f62594e271", diff --git a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt index 84dca43f..db0f7c63 100644 --- a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt +++ b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt @@ -4,6 +4,7 @@ import android.app.NotificationChannel import android.app.NotificationManager import android.app.PendingIntent import android.app.TaskStackBuilder +import android.content.ContentValues.TAG import android.content.Context import android.content.Intent import android.util.Log @@ -32,6 +33,8 @@ class LGTMFirebaseMessagingService : FirebaseMessagingService(), LgtmMessagingSe override fun onMessageReceived(remoteMessage: RemoteMessage) { super.onMessageReceived(remoteMessage) + Log.d(TAG, "onMessageReceived: ${remoteMessage.data}") + if (remoteMessage.data.isNotEmpty()) { handleDataType(remoteMessage.data) } @@ -54,7 +57,7 @@ class LGTMFirebaseMessagingService : FirebaseMessagingService(), LgtmMessagingSe .addNextIntent(dashboardIntent) val resultPendingIntent = - stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT) + stackBuilder.getPendingIntent(0, PendingIntent.FLAG_IMMUTABLE) val builder = createNotificationBuilder(data["title"], data["body"], resultPendingIntent) notifyWithChannel(requestCode, builder) diff --git a/app/src/prod/google-services.json b/app/src/prod/google-services.json new file mode 100644 index 00000000..3af481cd --- /dev/null +++ b/app/src/prod/google-services.json @@ -0,0 +1,68 @@ +{ + "project_info": { + "project_number": "1090377873764", + "project_id": "lgtm-aeb7a", + "storage_bucket": "lgtm-aeb7a.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1090377873764:android:5eb9f699608d0e5994e271", + "android_client_info": { + "package_name": "com.lgtm.android" + } + }, + "oauth_client": [ + { + "client_id": "1090377873764-b6gm8buak4slf1vf8a4osmjfm1ktokle.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAsd0MS5XNM3GoQlHKw09z9X9pK3R2EC3Y" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "1090377873764-b6gm8buak4slf1vf8a4osmjfm1ktokle.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:1090377873764:android:828cd0a400b0f62594e271", + "android_client_info": { + "package_name": "com.lgtm.android.dev" + } + }, + "oauth_client": [ + { + "client_id": "1090377873764-b6gm8buak4slf1vf8a4osmjfm1ktokle.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAsd0MS5XNM3GoQlHKw09z9X9pK3R2EC3Y" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "1090377873764-b6gm8buak4slf1vf8a4osmjfm1ktokle.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file From fbbe38f6c45a7851a338778950d85258ab8d1917 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Sat, 4 Nov 2023 18:58:11 +0900 Subject: [PATCH 15/57] =?UTF-8?q?[FEAT]=20PushCategory=EC=97=90=20?= =?UTF-8?q?=EB=94=B0=EB=A5=B8=20Intent=20=EC=84=A4=EC=A0=95=20(#145)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../android/LGTMFirebaseMessagingService.kt | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt index db0f7c63..7c1b502d 100644 --- a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt +++ b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt @@ -15,6 +15,13 @@ import com.google.firebase.messaging.RemoteMessage import com.lgtm.android.common_ui.R import com.lgtm.android.main.MainActivity import com.lgtm.android.manage_mission.dashboard.DashboardActivity +import com.lgtm.android.manage_mission.ping_pong_junior.PingPongJuniorActivity +import com.lgtm.domain.constants.ProcessState.CODE_REVIEW +import com.lgtm.domain.constants.ProcessState.MISSION_FINISHED +import com.lgtm.domain.constants.ProcessState.MISSION_PROCEEDING +import com.lgtm.domain.constants.ProcessState.PAYMENT_CONFIRMATION +import com.lgtm.domain.constants.ProcessState.WAITING_FOR_PAYMENT +import com.lgtm.domain.constants.ProcessState.valueOf import com.lgtm.domain.firebase.LgtmMessagingService import com.lgtm.domain.usecase.DeviceTokenManagerUseCase import dagger.hilt.android.AndroidEntryPoint @@ -47,26 +54,39 @@ class LGTMFirebaseMessagingService : FirebaseMessagingService(), LgtmMessagingSe private fun handleDataType(data: Map) { val requestCode = System.currentTimeMillis().toInt() - val dashboardIntent = Intent(this, DashboardActivity::class.java) - .putExtra(DashboardActivity.MISSION_ID, data["missionId"]?.toInt() ?: return) + val title = data["title"] + val body = data["body"] + val missionId: Int? = data["missionId"]?.toInt() + val processState = data["pushCategory"]?.let { valueOf(it) } + val intent = when (processState) { + WAITING_FOR_PAYMENT, PAYMENT_CONFIRMATION, CODE_REVIEW -> + Intent(this, DashboardActivity::class.java) + .putExtra(DashboardActivity.MISSION_ID, missionId) + + MISSION_PROCEEDING, MISSION_FINISHED -> + Intent(this, PingPongJuniorActivity::class.java) + .putExtra(DashboardActivity.MISSION_ID, missionId) + + else -> return + } + val mainIntent = Intent(this, MainActivity::class.java) val stackBuilder = TaskStackBuilder.create(this) .addParentStack(MainActivity::class.java) .addNextIntent(mainIntent) - .addNextIntent(dashboardIntent) + .addNextIntent(intent) - val resultPendingIntent = - stackBuilder.getPendingIntent(0, PendingIntent.FLAG_IMMUTABLE) + val resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_IMMUTABLE) - val builder = createNotificationBuilder(data["title"], data["body"], resultPendingIntent) + val builder = createNotificationBuilder(title, body, resultPendingIntent) notifyWithChannel(requestCode, builder) } private fun createNotificationBuilder( title: String?, message: String?, - contentIntent: PendingIntent? + contentIntent: PendingIntent?, ): NotificationCompat.Builder { return NotificationCompat.Builder(this, channelID) .setPriority(NotificationCompat.PRIORITY_HIGH) From d60637dbdcf92ae85a860284b5e1f9a66cf7ab65 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Sat, 4 Nov 2023 19:03:57 +0900 Subject: [PATCH 16/57] [CHORE] Suppress Lint (#145) --- .../main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt index 7c1b502d..041adf09 100644 --- a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt +++ b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt @@ -1,3 +1,5 @@ +@file:Suppress("MoveVariableDeclarationIntoWhen") + package com.lgtm.android import android.app.NotificationChannel From a182de0f892100b5103d556f5fb5cb82aaba151e Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 00:23:39 +0900 Subject: [PATCH 17/57] [ADD] Add Empty NotificationCenterActivity (#161) --- app/src/main/AndroidManifest.xml | 4 + common-ui/src/main/res/values/strings.xml | 5 + .../NotificationCenterActivity.kt | 21 ++++ .../NotificationCenterViewModel.kt | 10 ++ .../layout/activity_notification_center.xml | 100 ++++++++++++++++++ 5 files changed, 140 insertions(+) create mode 100644 feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt create mode 100644 feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt create mode 100644 feature/main/src/main/res/layout/activity_notification_center.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 13eeb172..a2326918 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -65,5 +65,9 @@ android:exported="false" android:windowSoftInputMode="adjustResize" /> + + \ No newline at end of file diff --git a/common-ui/src/main/res/values/strings.xml b/common-ui/src/main/res/values/strings.xml index afed75e1..712ea976 100644 --- a/common-ui/src/main/res/values/strings.xml +++ b/common-ui/src/main/res/values/strings.xml @@ -181,4 +181,9 @@ Github + + 알림 + 아직 알림이 없습니다. + 미션을 시작해 보세요! + \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt new file mode 100644 index 00000000..427966a8 --- /dev/null +++ b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt @@ -0,0 +1,21 @@ +package com.lgtm.android.main.notification + +import androidx.activity.viewModels +import com.lgtm.android.common_ui.base.BaseActivity +import com.lgtm.android.main.R +import com.lgtm.android.main.databinding.ActivityNotificationCenterBinding +import dagger.hilt.android.AndroidEntryPoint + +@AndroidEntryPoint +class NotificationCenterActivity : + BaseActivity(R.layout.activity_notification_center) { + + private val notificationCenterViewModel by viewModels() + + + + override fun initializeViewModel() { + viewModel = notificationCenterViewModel + } + +} \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt new file mode 100644 index 00000000..74182b7b --- /dev/null +++ b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt @@ -0,0 +1,10 @@ +package com.lgtm.android.main.notification + +import com.lgtm.android.common_ui.base.BaseViewModel +import dagger.hilt.android.lifecycle.HiltViewModel +import javax.inject.Inject + +@HiltViewModel +class NotificationCenterViewModel @Inject constructor( +// private val notificationCenterRepository: NotificationCenterRepository +) : BaseViewModel() \ No newline at end of file diff --git a/feature/main/src/main/res/layout/activity_notification_center.xml b/feature/main/src/main/res/layout/activity_notification_center.xml new file mode 100644 index 00000000..fd95bfd6 --- /dev/null +++ b/feature/main/src/main/res/layout/activity_notification_center.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 4535e0ff36ae87aaedabae2722fc5956b19f4d91 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 00:27:07 +0900 Subject: [PATCH 18/57] =?UTF-8?q?[FEAT]=20Home=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=EC=97=90=EC=84=9C=20NotificationCenter=EB=A1=9C=EC=9D=98=20nav?= =?UTF-8?q?igate=20=EB=A1=9C=EC=A7=81=20=EC=9E=91=EC=84=B1=20(#161)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lgtm/android/navigator/LgtmNavigator.kt | 6 ++++++ .../android/common_ui/navigator/FakeLgtmNavigator.kt | 2 ++ .../main/java/com/lgtm/android/main/home/HomeFragment.kt | 9 +++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/lgtm/android/navigator/LgtmNavigator.kt b/app/src/main/java/com/lgtm/android/navigator/LgtmNavigator.kt index 1df5c7d8..02ba30a4 100644 --- a/app/src/main/java/com/lgtm/android/navigator/LgtmNavigator.kt +++ b/app/src/main/java/com/lgtm/android/navigator/LgtmNavigator.kt @@ -6,6 +6,7 @@ import com.lgtm.android.auth.ui.SignInActivity import com.lgtm.android.common_ui.navigator.FakeLgtmNavigator import com.lgtm.android.create_mission.CreateMissionActivity import com.lgtm.android.main.MainActivity +import com.lgtm.android.main.notification.NotificationCenterActivity import com.lgtm.android.manage_mission.dashboard.DashboardActivity import com.lgtm.android.manage_mission.ping_pong_junior.PingPongJuniorActivity import com.lgtm.android.mission_detail.MissionDetailActivity @@ -56,4 +57,9 @@ class LgtmNavigator @Inject constructor( } context.startActivity(intent) } + + override fun navigateToNotificationCenter(context: Context) { + val intent = Intent(context, NotificationCenterActivity::class.java) + context.startActivity(intent) + } } diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/navigator/FakeLgtmNavigator.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/navigator/FakeLgtmNavigator.kt index f075b697..bf08880e 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/navigator/FakeLgtmNavigator.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/navigator/FakeLgtmNavigator.kt @@ -16,4 +16,6 @@ interface FakeLgtmNavigator { fun navigateToProfile(context: Context, userId: Int? = null) fun navigateToPingPongJunior(context: Context, missionId: Int) + + fun navigateToNotificationCenter(context: Context) } \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt b/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt index 2e4e22ee..627d542b 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt @@ -2,9 +2,7 @@ package com.lgtm.android.main.home import android.os.Bundle import android.view.View -import android.widget.Toast import androidx.fragment.app.viewModels -import com.lgtm.android.common_ui.R.string import com.lgtm.android.common_ui.adapter.SduiAdapter import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.main.R @@ -43,8 +41,7 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { private fun setUpNotificationClickListener() { binding.ivNotification.setOnClickListener { - Toast.makeText(requireContext(), getString(string.service_under_preparation), Toast.LENGTH_SHORT).show() -// homeViewModel.shotHomeNotificationClickLogging() + moveToNotificationCenter() } } @@ -57,6 +54,10 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { lgtmNavigator.navigateToMissionDetail(requireContext(), missionId) } + private fun moveToNotificationCenter(){ + lgtmNavigator.navigateToNotificationCenter(requireContext()) + } + private fun submitDataWhenDataChanged() { homeViewModel.sduiList.observe(viewLifecycleOwner) { commonAdapter.submitList(it) From 51e7946df86879f9b89b18fdadaba9abd9b5b6d6 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 01:01:48 +0900 Subject: [PATCH 19/57] =?UTF-8?q?[FEAT]=20NotificationCenter=20=EC=84=9C?= =?UTF-8?q?=EB=B2=84=EC=97=B0=EB=8F=99=20(#161)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lgtm/android/di/RepositoryModule.kt | 7 +++++++ .../lgtm/android/di/RetrofitServiceModule.kt | 7 +++++++ .../data/datasource/NotificationDatasource.kt | 14 +++++++++++++ .../data/model/response/NotificationDTO.kt | 19 ++++++++++++++++++ .../repository/NotificationRepositoryImpl.kt | 19 ++++++++++++++++++ .../data/service/NotificationService.kt | 12 +++++++++++ .../domain/entity/response/NotificationVO.kt | 8 ++++++++ .../repository/NotificationRepository.kt | 7 +++++++ .../NotificationCenterActivity.kt | 12 +++++++++-- .../NotificationCenterViewModel.kt | 20 +++++++++++++++++-- 10 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt create mode 100644 data/src/main/java/com/lgtm/android/data/model/response/NotificationDTO.kt create mode 100644 data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt create mode 100644 data/src/main/java/com/lgtm/android/data/service/NotificationService.kt create mode 100644 domain/src/main/java/com/lgtm/domain/entity/response/NotificationVO.kt create mode 100644 domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt diff --git a/app/src/main/java/com/lgtm/android/di/RepositoryModule.kt b/app/src/main/java/com/lgtm/android/di/RepositoryModule.kt index 5b25d7c6..7f4d97cc 100644 --- a/app/src/main/java/com/lgtm/android/di/RepositoryModule.kt +++ b/app/src/main/java/com/lgtm/android/di/RepositoryModule.kt @@ -3,10 +3,12 @@ package com.lgtm.android.di import com.lgtm.android.data.repository.AuthRepositoryImpl import com.lgtm.android.data.repository.IntroRepositoryImpl import com.lgtm.android.data.repository.MissionRepositoryImpl +import com.lgtm.android.data.repository.NotificationRepositoryImpl import com.lgtm.android.data.repository.ProfileRepositoryImpl import com.lgtm.domain.repository.AuthRepository import com.lgtm.domain.repository.IntroRepository import com.lgtm.domain.repository.MissionRepository +import com.lgtm.domain.repository.NotificationRepository import com.lgtm.domain.repository.ProfileRepository import dagger.Binds import dagger.Module @@ -37,4 +39,9 @@ interface RepositoryModule { profileRepositoryImpl: ProfileRepositoryImpl ): ProfileRepository + @Binds + fun bindsNotificationRepository( + notificationRepositoryImpl: NotificationRepositoryImpl + ): NotificationRepository + } \ No newline at end of file diff --git a/app/src/main/java/com/lgtm/android/di/RetrofitServiceModule.kt b/app/src/main/java/com/lgtm/android/di/RetrofitServiceModule.kt index 8371f7ea..966f5695 100644 --- a/app/src/main/java/com/lgtm/android/di/RetrofitServiceModule.kt +++ b/app/src/main/java/com/lgtm/android/di/RetrofitServiceModule.kt @@ -3,6 +3,7 @@ package com.lgtm.android.di import com.lgtm.android.data.service.AuthService import com.lgtm.android.data.service.IntroService import com.lgtm.android.data.service.MissionService +import com.lgtm.android.data.service.NotificationService import com.lgtm.android.data.service.ProfileService import dagger.Module import dagger.Provides @@ -34,4 +35,10 @@ object RetrofitServiceModule { @Singleton fun providesProfileService(retrofit: Retrofit): ProfileService = retrofit.create(ProfileService::class.java) + + + @Provides + @Singleton + fun providesNotificationService(retrofit: Retrofit): NotificationService = + retrofit.create(NotificationService::class.java) } \ No newline at end of file diff --git a/data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt b/data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt new file mode 100644 index 00000000..6f871b2a --- /dev/null +++ b/data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt @@ -0,0 +1,14 @@ +package com.lgtm.android.data.datasource + +import com.lgtm.android.data.model.response.BaseDTO +import com.lgtm.android.data.model.response.NotificationDTO +import com.lgtm.android.data.service.NotificationService +import javax.inject.Inject + +class NotificationDatasource @Inject constructor( + private val notificationService: NotificationService, +) : BaseNetworkDataSource() { + suspend fun getNotificationList(): BaseDTO> { + return checkResponse(notificationService.getNotificationList()) + } +} \ No newline at end of file diff --git a/data/src/main/java/com/lgtm/android/data/model/response/NotificationDTO.kt b/data/src/main/java/com/lgtm/android/data/model/response/NotificationDTO.kt new file mode 100644 index 00000000..2c3eec59 --- /dev/null +++ b/data/src/main/java/com/lgtm/android/data/model/response/NotificationDTO.kt @@ -0,0 +1,19 @@ +package com.lgtm.android.data.model.response + +import com.lgtm.domain.entity.response.NotificationVO + +data class NotificationDTO( + val body: String?, + val isRead: Boolean?, + val notificationId: Int?, + val title: String?, +) { + fun toVO(): NotificationVO { + return NotificationVO( + title = title ?: "", + body = body ?: "", + isRead = isRead ?: false, + notificationId = notificationId ?: throw IllegalArgumentException("notificationId is null") + ) + } +} \ No newline at end of file diff --git a/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt b/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt new file mode 100644 index 00000000..74a0d2b1 --- /dev/null +++ b/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt @@ -0,0 +1,19 @@ +package com.lgtm.android.data.repository + +import com.lgtm.android.data.datasource.NotificationDatasource +import com.lgtm.domain.entity.response.NotificationVO +import com.lgtm.domain.repository.NotificationRepository +import javax.inject.Inject + +class NotificationRepositoryImpl @Inject constructor( + private val notificationDatasource : NotificationDatasource +) : NotificationRepository { + override suspend fun getNotificationList() :Result>{ + return try { + val response = notificationDatasource.getNotificationList() + Result.success(response.data.map { it.toVO() } as ArrayList) + } catch (e: Exception) { + Result.failure(e) + } + } +} \ No newline at end of file diff --git a/data/src/main/java/com/lgtm/android/data/service/NotificationService.kt b/data/src/main/java/com/lgtm/android/data/service/NotificationService.kt new file mode 100644 index 00000000..c56153b9 --- /dev/null +++ b/data/src/main/java/com/lgtm/android/data/service/NotificationService.kt @@ -0,0 +1,12 @@ +package com.lgtm.android.data.service + +import com.lgtm.android.data.model.response.BaseDTO +import com.lgtm.android.data.model.response.NotificationDTO +import retrofit2.Response +import retrofit2.http.GET + +interface NotificationService { + + @GET("v1/notification") + suspend fun getNotificationList(): Response>> +} \ No newline at end of file diff --git a/domain/src/main/java/com/lgtm/domain/entity/response/NotificationVO.kt b/domain/src/main/java/com/lgtm/domain/entity/response/NotificationVO.kt new file mode 100644 index 00000000..1dd840a0 --- /dev/null +++ b/domain/src/main/java/com/lgtm/domain/entity/response/NotificationVO.kt @@ -0,0 +1,8 @@ +package com.lgtm.domain.entity.response + +data class NotificationVO( + val title: String, + val body: String, + val isRead: Boolean, + val notificationId: Int, +) \ No newline at end of file diff --git a/domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt b/domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt new file mode 100644 index 00000000..2430d9b7 --- /dev/null +++ b/domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt @@ -0,0 +1,7 @@ +package com.lgtm.domain.repository + +import com.lgtm.domain.entity.response.NotificationVO + +interface NotificationRepository { + suspend fun getNotificationList(): Result> +} \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt index 427966a8..4fb47b34 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt @@ -1,5 +1,6 @@ package com.lgtm.android.main.notification +import android.os.Bundle import androidx.activity.viewModels import com.lgtm.android.common_ui.base.BaseActivity import com.lgtm.android.main.R @@ -12,10 +13,17 @@ class NotificationCenterActivity : private val notificationCenterViewModel by viewModels() - - override fun initializeViewModel() { viewModel = notificationCenterViewModel } + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + getNotificationList() + } + + private fun getNotificationList(){ + notificationCenterViewModel.getNotificationList() + } + } \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt index 74182b7b..10c051f3 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt @@ -1,10 +1,26 @@ package com.lgtm.android.main.notification +import android.content.ContentValues.TAG +import android.util.Log +import androidx.lifecycle.viewModelScope import com.lgtm.android.common_ui.base.BaseViewModel +import com.lgtm.domain.repository.NotificationRepository import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.launch import javax.inject.Inject @HiltViewModel class NotificationCenterViewModel @Inject constructor( -// private val notificationCenterRepository: NotificationCenterRepository -) : BaseViewModel() \ No newline at end of file + private val notificationRepository: NotificationRepository, +) : BaseViewModel() { + fun getNotificationList() { + viewModelScope.launch(lgtmErrorHandler) { + notificationRepository.getNotificationList() + .onSuccess { + Log.d(TAG, "getNotificationList: $it") + }.onFailure { + Log.e(TAG, "getNotificationList: $it") + } + } + } +} \ No newline at end of file From fc56675729ad28e3a1de82dae4aa2d68049a4a37 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 05:56:28 +0900 Subject: [PATCH 20/57] =?UTF-8?q?[FEAT]=20NotificationCenter=20UI=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(#161)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../res/drawable/oval_diameter_9_gray_2.xml | 9 +++ .../res/drawable/oval_diameter_9_green.xml | 9 +++ .../main/notification/NotificationAdapter.kt | 34 ++++++++++ .../NotificationCenterActivity.kt | 20 +++++- .../NotificationCenterViewModel.kt | 8 ++- .../layout/activity_notification_center.xml | 13 ++++ .../res/layout/item_notification_center.xml | 63 +++++++++++++++++++ 7 files changed, 154 insertions(+), 2 deletions(-) create mode 100644 common-ui/src/main/res/drawable/oval_diameter_9_gray_2.xml create mode 100644 common-ui/src/main/res/drawable/oval_diameter_9_green.xml create mode 100644 feature/main/src/main/java/com/lgtm/android/main/notification/NotificationAdapter.kt create mode 100644 feature/main/src/main/res/layout/item_notification_center.xml diff --git a/common-ui/src/main/res/drawable/oval_diameter_9_gray_2.xml b/common-ui/src/main/res/drawable/oval_diameter_9_gray_2.xml new file mode 100644 index 00000000..e932f697 --- /dev/null +++ b/common-ui/src/main/res/drawable/oval_diameter_9_gray_2.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/common-ui/src/main/res/drawable/oval_diameter_9_green.xml b/common-ui/src/main/res/drawable/oval_diameter_9_green.xml new file mode 100644 index 00000000..c951d495 --- /dev/null +++ b/common-ui/src/main/res/drawable/oval_diameter_9_green.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationAdapter.kt b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationAdapter.kt new file mode 100644 index 00000000..94ffa386 --- /dev/null +++ b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationAdapter.kt @@ -0,0 +1,34 @@ +package com.lgtm.android.main.notification + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.ListAdapter +import androidx.recyclerview.widget.RecyclerView +import com.lgtm.android.common_ui.util.ItemDiffCallback +import com.lgtm.android.main.databinding.ItemNotificationCenterBinding +import com.lgtm.domain.entity.response.NotificationVO + +class NotificationAdapter : ListAdapter( + ItemDiffCallback( + onContentsTheSame = { old, new -> old == new }, + onItemsTheSame = { old, new -> old.notificationId == new.notificationId }) +) { + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NotificationViewHolder { + val layoutInflater = LayoutInflater.from(parent.context) + val binding = ItemNotificationCenterBinding.inflate(layoutInflater, parent, false) + return NotificationViewHolder(binding) + } + + override fun onBindViewHolder(holder: NotificationViewHolder, position: Int) { + holder.onBind(getItem(position)) + } +} + +class NotificationViewHolder( + private val binding: ItemNotificationCenterBinding, +) : RecyclerView.ViewHolder(binding.root) { + fun onBind(item: NotificationVO) { + binding.data = item + } +} \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt index 4fb47b34..a9e9484b 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt @@ -1,6 +1,7 @@ package com.lgtm.android.main.notification import android.os.Bundle +import android.view.View import androidx.activity.viewModels import com.lgtm.android.common_ui.base.BaseActivity import com.lgtm.android.main.R @@ -12,6 +13,7 @@ class NotificationCenterActivity : BaseActivity(R.layout.activity_notification_center) { private val notificationCenterViewModel by viewModels() + private lateinit var notificationAdapter: NotificationAdapter override fun initializeViewModel() { viewModel = notificationCenterViewModel @@ -20,10 +22,26 @@ class NotificationCenterActivity : override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) getNotificationList() + initAdapter() + observeNotificationList() } - private fun getNotificationList(){ + private fun getNotificationList() { notificationCenterViewModel.getNotificationList() } + private fun initAdapter() { + notificationAdapter = NotificationAdapter() + binding.rvNotification.adapter = notificationAdapter + } + + private fun observeNotificationList() { + notificationCenterViewModel.notificationList.observe(this) { + if (it.isNullOrEmpty()) binding.clEmpty.visibility = View.VISIBLE + else { + binding.clEmpty.visibility = View.GONE + notificationAdapter.submitList(it) + } + } + } } \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt index 10c051f3..64ae6c15 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt @@ -2,8 +2,11 @@ package com.lgtm.android.main.notification import android.content.ContentValues.TAG import android.util.Log +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope import com.lgtm.android.common_ui.base.BaseViewModel +import com.lgtm.domain.entity.response.NotificationVO import com.lgtm.domain.repository.NotificationRepository import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch @@ -13,11 +16,14 @@ import javax.inject.Inject class NotificationCenterViewModel @Inject constructor( private val notificationRepository: NotificationRepository, ) : BaseViewModel() { + + private val _notificationList = MutableLiveData>() + val notificationList: LiveData> = _notificationList fun getNotificationList() { viewModelScope.launch(lgtmErrorHandler) { notificationRepository.getNotificationList() .onSuccess { - Log.d(TAG, "getNotificationList: $it") + _notificationList.postValue(it) }.onFailure { Log.e(TAG, "getNotificationList: $it") } diff --git a/feature/main/src/main/res/layout/activity_notification_center.xml b/feature/main/src/main/res/layout/activity_notification_center.xml index fd95bfd6..b10a2298 100644 --- a/feature/main/src/main/res/layout/activity_notification_center.xml +++ b/feature/main/src/main/res/layout/activity_notification_center.xml @@ -56,6 +56,7 @@ + + \ No newline at end of file diff --git a/feature/main/src/main/res/layout/item_notification_center.xml b/feature/main/src/main/res/layout/item_notification_center.xml new file mode 100644 index 00000000..e878c57c --- /dev/null +++ b/feature/main/src/main/res/layout/item_notification_center.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 95cb1f65b26d0e84ac0e4544e56dbca750ebe84d Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 05:57:03 +0900 Subject: [PATCH 21/57] =?UTF-8?q?[FEAT]=20=EC=B5=9C=EC=8B=A0=20=ED=91=B8?= =?UTF-8?q?=EC=8B=9C=20=EC=95=8C=EB=A6=BC=EC=9D=B4=20=EC=B5=9C=EC=83=81?= =?UTF-8?q?=EB=8B=A8=EC=9C=BC=EB=A1=9C=20=EB=B0=B0=EC=B9=98=EB=90=98?= =?UTF-8?q?=EA=B2=8C=EB=81=94=20reversed=20=EC=84=A4=EC=A0=95=20(#161)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../android/data/repository/NotificationRepositoryImpl.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt b/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt index 74a0d2b1..e6963011 100644 --- a/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt +++ b/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt @@ -6,12 +6,13 @@ import com.lgtm.domain.repository.NotificationRepository import javax.inject.Inject class NotificationRepositoryImpl @Inject constructor( - private val notificationDatasource : NotificationDatasource + private val notificationDatasource: NotificationDatasource, ) : NotificationRepository { - override suspend fun getNotificationList() :Result>{ + override suspend fun getNotificationList(): Result> { return try { val response = notificationDatasource.getNotificationList() - Result.success(response.data.map { it.toVO() } as ArrayList) + val list = response.data.map { it.toVO() } as MutableList + Result.success(list.reversed() as ArrayList) } catch (e: Exception) { Result.failure(e) } From 1be8b39f39dcd69be81e4b358bea03db13884f1d Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 06:19:13 +0900 Subject: [PATCH 22/57] =?UTF-8?q?[UI]=20ItemDecoration=EC=9C=BC=EB=A1=9C?= =?UTF-8?q?=20Divider=20=EC=84=A4=EC=A0=95=20(#161)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common_ui/util/ItemDecorationUtil.kt | 32 ++++++++++++++++++- common-ui/src/main/res/values/dimens.xml | 1 + .../NotificationCenterActivity.kt | 10 ++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/util/ItemDecorationUtil.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/util/ItemDecorationUtil.kt index 2eec98f6..8a1b93ec 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/util/ItemDecorationUtil.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/util/ItemDecorationUtil.kt @@ -1,7 +1,9 @@ package com.lgtm.android.common_ui.util +import android.graphics.Canvas import android.graphics.Rect import android.view.View +import androidx.annotation.ColorRes import androidx.annotation.DimenRes import androidx.recyclerview.widget.RecyclerView @@ -12,7 +14,7 @@ sealed class ItemDecorationUtil { outRect: Rect, view: View, parent: RecyclerView, - state: RecyclerView.State + state: RecyclerView.State, ) { super.getItemOffsets(outRect, view, parent, state) val paddingInt = view.resources.getDimension(padding).toInt() @@ -26,4 +28,32 @@ sealed class ItemDecorationUtil { } } } + + class DividerItemDecoration( + @DimenRes private val padding: Int, + @ColorRes private val color: Int, + ) : + RecyclerView.ItemDecoration() { + override fun onDrawOver(c: Canvas, parent: RecyclerView, state: RecyclerView.State) { + val paddingInt = parent.resources.getDimension(padding) + val height = parent.resources.getDimension(com.lgtm.android.common_ui.R.dimen.dp_1).toInt() + val colorInt = parent.resources.getColor(color, null) + val paint = android.graphics.Paint() + paint.color = colorInt + + val left = parent.paddingStart + paddingInt + val right = parent.width - parent.paddingEnd - paddingInt + + for (i in 0 until parent.childCount - 1) { + val child = parent.getChildAt(i) + val params = child.layoutParams as RecyclerView.LayoutParams + + val top = (child.bottom + params.bottomMargin).toFloat() + val bottom = top + height + + c.drawRect(left, top, right, bottom, paint) + } + + } + } } diff --git a/common-ui/src/main/res/values/dimens.xml b/common-ui/src/main/res/values/dimens.xml index 00d470f7..5ea6746a 100644 --- a/common-ui/src/main/res/values/dimens.xml +++ b/common-ui/src/main/res/values/dimens.xml @@ -13,4 +13,5 @@ 20dp 24dp 4dp + 1dp \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt index a9e9484b..8c700e50 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt @@ -4,6 +4,7 @@ import android.os.Bundle import android.view.View import androidx.activity.viewModels import com.lgtm.android.common_ui.base.BaseActivity +import com.lgtm.android.common_ui.util.ItemDecorationUtil import com.lgtm.android.main.R import com.lgtm.android.main.databinding.ActivityNotificationCenterBinding import dagger.hilt.android.AndroidEntryPoint @@ -41,7 +42,16 @@ class NotificationCenterActivity : else { binding.clEmpty.visibility = View.GONE notificationAdapter.submitList(it) + addItemDecoration() } } } + + private fun addItemDecoration() { + val decoration = ItemDecorationUtil.DividerItemDecoration( + padding = com.lgtm.android.common_ui.R.dimen.base_guideline, + color = com.lgtm.android.common_ui.R.color.gray_3 + ) + binding.rvNotification.addItemDecoration(decoration) + } } \ No newline at end of file From 53cbab248e6e365285f9c2d5019c56d122d08ba6 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 06:23:18 +0900 Subject: [PATCH 23/57] =?UTF-8?q?[CHORE]=20List=20=EC=9E=90=EB=A3=8C?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20(#161)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lgtm/android/data/datasource/NotificationDatasource.kt | 2 +- .../android/data/repository/NotificationRepositoryImpl.kt | 6 +++--- .../com/lgtm/android/data/service/NotificationService.kt | 2 +- .../com/lgtm/domain/repository/NotificationRepository.kt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt b/data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt index 6f871b2a..54933b5a 100644 --- a/data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt +++ b/data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt @@ -8,7 +8,7 @@ import javax.inject.Inject class NotificationDatasource @Inject constructor( private val notificationService: NotificationService, ) : BaseNetworkDataSource() { - suspend fun getNotificationList(): BaseDTO> { + suspend fun getNotificationList(): BaseDTO> { return checkResponse(notificationService.getNotificationList()) } } \ No newline at end of file diff --git a/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt b/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt index e6963011..d376f24d 100644 --- a/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt +++ b/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt @@ -8,11 +8,11 @@ import javax.inject.Inject class NotificationRepositoryImpl @Inject constructor( private val notificationDatasource: NotificationDatasource, ) : NotificationRepository { - override suspend fun getNotificationList(): Result> { + override suspend fun getNotificationList(): Result> { return try { val response = notificationDatasource.getNotificationList() - val list = response.data.map { it.toVO() } as MutableList - Result.success(list.reversed() as ArrayList) + val list = response.data.map { it.toVO() } + Result.success(list.reversed()) } catch (e: Exception) { Result.failure(e) } diff --git a/data/src/main/java/com/lgtm/android/data/service/NotificationService.kt b/data/src/main/java/com/lgtm/android/data/service/NotificationService.kt index c56153b9..47fd3697 100644 --- a/data/src/main/java/com/lgtm/android/data/service/NotificationService.kt +++ b/data/src/main/java/com/lgtm/android/data/service/NotificationService.kt @@ -8,5 +8,5 @@ import retrofit2.http.GET interface NotificationService { @GET("v1/notification") - suspend fun getNotificationList(): Response>> + suspend fun getNotificationList(): Response>> } \ No newline at end of file diff --git a/domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt b/domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt index 2430d9b7..9cc3d52f 100644 --- a/domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt +++ b/domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt @@ -3,5 +3,5 @@ package com.lgtm.domain.repository import com.lgtm.domain.entity.response.NotificationVO interface NotificationRepository { - suspend fun getNotificationList(): Result> + suspend fun getNotificationList(): Result> } \ No newline at end of file From 9c95042f850d6572eae5642713c854ce41744cd4 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 06:49:32 +0900 Subject: [PATCH 24/57] =?UTF-8?q?[FEAT]=20=EA=B2=BD=EB=A0=A5=EC=A0=9C?= =?UTF-8?q?=ED=95=9C=2012=EA=B0=9C=EC=9B=94=20->=201=EA=B0=9C=EC=9B=94?= =?UTF-8?q?=EB=A1=9C=20=EC=B6=95=EC=86=8C=20(#160)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt index 1848f7ea..5f9b3362 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt @@ -292,7 +292,7 @@ class SignUpViewModel @Inject constructor( fun setIsCareerPeriodValid() { val careerPeriod = careerPeriod.value ?: return - _isCareerPeriodValid.value = careerPeriod >= ONE_YEAR + _isCareerPeriodValid.value = careerPeriod >= ONE_MONTH } @@ -407,6 +407,7 @@ class SignUpViewModel @Inject constructor( } companion object { + private const val ONE_MONTH = 1 private const val ONE_YEAR = 12 } } \ No newline at end of file From 4d4caefb0ee70cbec8e95d37c9f802a86759f19b Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 06:56:00 +0900 Subject: [PATCH 25/57] =?UTF-8?q?[UI]=20=EC=98=88=EA=B8=88=EC=A3=BC?= =?UTF-8?q?=EB=AA=85=20=EC=9E=85=EB=A0=A5=20EditText=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20(#160)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common-ui/src/main/res/values/strings.xml | 1 + .../main/res/layout/fragment_bank_account.xml | 125 +++++++++++------- 2 files changed, 78 insertions(+), 48 deletions(-) diff --git a/common-ui/src/main/res/values/strings.xml b/common-ui/src/main/res/values/strings.xml index 712ea976..0f9831f1 100644 --- a/common-ui/src/main/res/values/strings.xml +++ b/common-ui/src/main/res/values/strings.xml @@ -48,6 +48,7 @@ 중복된 닉네임입니다. 사용 가능합니다. + 예금주명을 입력하세요. diff --git a/feature/auth/src/main/res/layout/fragment_bank_account.xml b/feature/auth/src/main/res/layout/fragment_bank_account.xml index 14c654a6..3aafa04a 100644 --- a/feature/auth/src/main/res/layout/fragment_bank_account.xml +++ b/feature/auth/src/main/res/layout/fragment_bank_account.xml @@ -20,56 +20,85 @@ android:background="@color/white" tools:context=".ui.signup.reviewer.BankAccountFragment"> - - - + + - - - + + + + + + + + + + + + + Date: Tue, 7 Nov 2023 07:05:58 +0900 Subject: [PATCH 26/57] =?UTF-8?q?[FEAT]=20=EC=98=88=EA=B8=88=EC=A3=BC?= =?UTF-8?q?=EB=AA=85=20=ED=95=84=EB=93=9C=20=EC=B6=94=EA=B0=80=20(#139)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/request/SignUpSeniorRequestVO.kt | 3 +- .../android/auth/ui/signup/SignUpViewModel.kt | 37 +++++++++++-------- .../ui/signup/reviewer/BankAccountFragment.kt | 8 ++++ .../main/res/layout/fragment_bank_account.xml | 3 +- 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/domain/src/main/java/com/lgtm/domain/entity/request/SignUpSeniorRequestVO.kt b/domain/src/main/java/com/lgtm/domain/entity/request/SignUpSeniorRequestVO.kt index 7ac57b31..0c4b1f2b 100644 --- a/domain/src/main/java/com/lgtm/domain/entity/request/SignUpSeniorRequestVO.kt +++ b/domain/src/main/java/com/lgtm/domain/entity/request/SignUpSeniorRequestVO.kt @@ -13,5 +13,6 @@ data class SignUpSeniorRequestVO( val careerPeriod: Int, val position: String, val accountNumber: String, - val bankName: String + val bankName: String, + val accountHolderName: String ) \ No newline at end of file diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt index 5f9b3362..cb51892d 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt @@ -27,7 +27,7 @@ import javax.inject.Inject @HiltViewModel class SignUpViewModel @Inject constructor( - private val authRepository: AuthRepository + private val authRepository: AuthRepository, ) : BaseViewModel() { /** Device Token */ @@ -310,18 +310,25 @@ class SignUpViewModel @Inject constructor( } private val _accountNumber = MutableLiveData() - val accountNumber: LiveData = _accountNumber + private val accountNumber: LiveData = _accountNumber fun setAccountNumber(number: String) { _accountNumber.value = number } + private val _accountHolder = MutableLiveData() + private val accountHolder: LiveData = _accountHolder + + fun setAccountHolder(holder: String) { + _accountHolder.value = holder + } + private val _isValidAccountInfo = MutableLiveData() val isValidAccountInfo: LiveData = _isValidAccountInfo fun setIsAccountInfoValid() { _isValidAccountInfo.value = selectedBank.value != null - && accountNumber.value?.isNotBlank() == true + && accountNumber.value?.isNotBlank() == true && accountHolder.value?.isNotBlank() == true } private fun createSignUpJuniorRequestVO(): SignUpJuniorRequestVO { @@ -329,37 +336,37 @@ class SignUpViewModel @Inject constructor( SignUpJuniorRequestVO( githubId = requireNotNull(memberData.value?.githubId), githubOauthId = requireNotNull(memberData.value?.githubOauthId), - nickname = requireNotNull(nickname.value), + nickname = requireNotNull(nickname.value).trim(), deviceToken = deviceToken.value, profileImageUrl = requireNotNull(memberData.value?.profileImageUrl), - introduction = requireNotNull(introduction.value), - tagList = requireNotNull(techTagList.value), + introduction = requireNotNull(introduction.value).trim(), + tagList = requireNotNull(techTagList.value).distinct(), educationalHistory = requireNotNull(educationStatus.value?.status), - realName = requireNotNull(realName.value), - isAgreeWithEventInfo = isAgreeWithEventInfo.value ?: false + realName = requireNotNull(realName.value).trim(), + isAgreeWithEventInfo = isAgreeWithEventInfo.value ?: false, ) } catch (e: IllegalArgumentException) { throw SignUpFailedException("입력되지 않은 항목이 있습니다") } } - // todo: Refactor - usecase 에서 trim private fun createSignUpSeniorRequestVO(): SignUpSeniorRequestVO { return try { SignUpSeniorRequestVO( githubId = requireNotNull(memberData.value?.githubId), githubOauthId = requireNotNull(memberData.value?.githubOauthId), - nickname = requireNotNull(nickname.value), + nickname = requireNotNull(nickname.value).trim(), deviceToken = deviceToken.value, profileImageUrl = requireNotNull(memberData.value?.profileImageUrl), - introduction = requireNotNull(introduction.value), - tagList = requireNotNull(techTagList.value), - companyInfo = requireNotNull(companyName.value), - position = requireNotNull(position.value), + introduction = requireNotNull(introduction.value).trim(), + tagList = requireNotNull(techTagList.value).distinct(), + companyInfo = requireNotNull(companyName.value).trim(), + position = requireNotNull(position.value).trim(), careerPeriod = requireNotNull(careerPeriod.value), isAgreeWithEventInfo = isAgreeWithEventInfo.value ?: false, bankName = requireNotNull(selectedBank.value?.bankVO?.bank), - accountNumber = requireNotNull(accountNumber.value) + accountNumber = requireNotNull(accountNumber.value), + accountHolderName = requireNotNull(accountHolder.value).trim(), ) } catch (e: IllegalArgumentException) { throw SignUpFailedException("입력되지 않은 항목이 있습니다") diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt index 3156928d..c0b8443f 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt @@ -31,6 +31,7 @@ class BankAccountFragment : onBankSelectedListener() setupCompleteButtonListener() observeSignUpStatus() + onAccountHolderChanged() } private fun setupViewModel() { @@ -64,6 +65,13 @@ class BankAccountFragment : } } + private fun onAccountHolderChanged() { + binding.etAccountHolder.addTextChangedListener { + signUpViewModel.setAccountHolder(it.toString()) + signUpViewModel.setIsAccountInfoValid() + } + } + private fun setupCompleteButtonListener() { binding.btnComplete.setOnClickListener { signUpViewModel.signUpSenior() diff --git a/feature/auth/src/main/res/layout/fragment_bank_account.xml b/feature/auth/src/main/res/layout/fragment_bank_account.xml index 3aafa04a..3dfd9078 100644 --- a/feature/auth/src/main/res/layout/fragment_bank_account.xml +++ b/feature/auth/src/main/res/layout/fragment_bank_account.xml @@ -82,7 +82,7 @@ tools:listitem="@layout/item_bank_spinner" /> Date: Tue, 7 Nov 2023 07:06:54 +0900 Subject: [PATCH 27/57] [CHORE] Set AdjustPan to SignUpActivity (#139) --- app/src/main/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a2326918..59cc54c3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -37,6 +37,7 @@ Date: Tue, 7 Nov 2023 07:09:32 +0900 Subject: [PATCH 28/57] =?UTF-8?q?[FEAT]=20=EC=98=88=EA=B8=88=EC=A3=BC?= =?UTF-8?q?=EB=AA=85=20=ED=95=84=EB=93=9C=20=EC=B6=94=EA=B0=80=20(#139)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lgtm/android/data/model/request/SignUpSeniorRequestDTO.kt | 3 ++- .../com/lgtm/android/data/repository/AuthRepositoryImpl.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/src/main/java/com/lgtm/android/data/model/request/SignUpSeniorRequestDTO.kt b/data/src/main/java/com/lgtm/android/data/model/request/SignUpSeniorRequestDTO.kt index 35db9c3f..068c941f 100644 --- a/data/src/main/java/com/lgtm/android/data/model/request/SignUpSeniorRequestDTO.kt +++ b/data/src/main/java/com/lgtm/android/data/model/request/SignUpSeniorRequestDTO.kt @@ -17,5 +17,6 @@ data class SignUpSeniorRequestDTO( val nickname: String, val position: String, val profileImageUrl: String, - val tagList: List + val tagList: List, + val accountHolderName: String ) \ No newline at end of file diff --git a/data/src/main/java/com/lgtm/android/data/repository/AuthRepositoryImpl.kt b/data/src/main/java/com/lgtm/android/data/repository/AuthRepositoryImpl.kt index b10b8ecc..eab1cc30 100644 --- a/data/src/main/java/com/lgtm/android/data/repository/AuthRepositoryImpl.kt +++ b/data/src/main/java/com/lgtm/android/data/repository/AuthRepositoryImpl.kt @@ -124,7 +124,8 @@ class AuthRepositoryImpl @Inject constructor( careerPeriod = signUpSeniorVO.careerPeriod, companyInfo = signUpSeniorVO.companyInfo, position = signUpSeniorVO.position, - isAgreeWithEventInfo = signUpSeniorVO.isAgreeWithEventInfo + isAgreeWithEventInfo = signUpSeniorVO.isAgreeWithEventInfo, + accountHolderName = signUpSeniorVO.accountHolderName ) ) return Result.success(response.data.toVO()) From 1e1f937ccf02de74986852f830930b890e325fe0 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 07:33:12 +0900 Subject: [PATCH 29/57] =?UTF-8?q?[FEAT]=20=ED=9A=8C=EC=9B=90=EA=B0=80?= =?UTF-8?q?=EC=9E=85=20=EB=8F=84=EC=A4=91=20=EB=92=A4=EB=A1=9C=EA=B0=80?= =?UTF-8?q?=EA=B8=B0=EB=A5=BC=20=EB=88=8C=EB=A0=80=EC=9D=84=20=EB=95=8C=20?= =?UTF-8?q?=EA=B8=B0=EC=84=A0=ED=83=9D=ED=95=9C=20TechTag=20List=EB=A5=BC?= =?UTF-8?q?=20Selected=20=EC=83=81=ED=83=9C=EB=A1=9C=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20(#139)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lgtm/android/common_ui/util/TechTagChipGroup.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/util/TechTagChipGroup.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/util/TechTagChipGroup.kt index 765d7ef1..286fd079 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/util/TechTagChipGroup.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/util/TechTagChipGroup.kt @@ -55,6 +55,9 @@ class TechTagChipGroup(private val chipGroup: ChipGroup, private val theme: Tech setTextAppearance(R.style.Body2) setTextColor(textStateList) // (순서 중요) textAppearance 후에 배치 setOnClickListener { onChipSelected(this, techTagUI) } + if (selectedTagList.value?.contains(this.text) == true) { + isSelected = true + } } } From ef11ac1b653efc6c9604e300e2637b2c4b8b7598 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 07:39:39 +0900 Subject: [PATCH 30/57] =?UTF-8?q?[CHORE]=20=ED=9A=8C=EC=9B=90=EA=B0=80?= =?UTF-8?q?=EC=9E=85=20Response=20=EC=84=9C=EB=B2=84=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=EC=82=AC=ED=95=AD=EC=97=90=20=EB=A7=9E=EA=B2=8C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#72)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lgtm/android/data/model/response/SignUpResponse.kt | 6 ++++-- .../com/lgtm/domain/entity/response/SignUpResponseVO.kt | 3 ++- .../java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/data/src/main/java/com/lgtm/android/data/model/response/SignUpResponse.kt b/data/src/main/java/com/lgtm/android/data/model/response/SignUpResponse.kt index 58f2fb47..6753c0e4 100644 --- a/data/src/main/java/com/lgtm/android/data/model/response/SignUpResponse.kt +++ b/data/src/main/java/com/lgtm/android/data/model/response/SignUpResponse.kt @@ -6,14 +6,16 @@ data class SignUpResponse( val memberId: Int?, val githubId: String?, val accessToken: String?, - val refreshToken: String? + val refreshToken: String?, + val memberType: String?, ) { fun toVO(): SignUpResponseVO { return SignUpResponseVO( memberId = memberId ?: throw IllegalArgumentException("memberId is null"), githubId = githubId ?: throw IllegalArgumentException("githubId is null"), accessToken = accessToken ?: throw IllegalArgumentException("accessToken is null"), - refreshToken = refreshToken ?: throw IllegalArgumentException("refreshToken is null") + refreshToken = refreshToken ?: throw IllegalArgumentException("refreshToken is null"), + memberType = memberType ?: throw IllegalArgumentException("memberType is null"), ) } } diff --git a/domain/src/main/java/com/lgtm/domain/entity/response/SignUpResponseVO.kt b/domain/src/main/java/com/lgtm/domain/entity/response/SignUpResponseVO.kt index 15567754..0511ecd8 100644 --- a/domain/src/main/java/com/lgtm/domain/entity/response/SignUpResponseVO.kt +++ b/domain/src/main/java/com/lgtm/domain/entity/response/SignUpResponseVO.kt @@ -4,5 +4,6 @@ data class SignUpResponseVO( val memberId: Int, val githubId: String, val accessToken: String, - val refreshToken: String + val refreshToken: String, + val memberType: String ) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt index cb51892d..ab7c4552 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt @@ -386,7 +386,7 @@ class SignUpViewModel @Inject constructor( _signUpState.value = NetworkState.Failure(e.message) return@launch }.onSuccess { - authRepository.saveUserData(it, selectedRole.value?.role) + authRepository.saveUserData(it, it.memberType) _signUpState.value = NetworkState.Success(it) }.onFailure { val errorMessage = if (it is LgtmResponseException) it.message else "로그인 실패" @@ -404,7 +404,7 @@ class SignUpViewModel @Inject constructor( _signUpState.value = NetworkState.Failure(e.message) return@launch }.onSuccess { - authRepository.saveUserData(it, selectedRole.value?.role) + authRepository.saveUserData(it, it.memberType) _signUpState.value = NetworkState.Success(it) }.onFailure { val errorMessage = if (it is LgtmResponseException) it.message else "로그인 실패" From 68263ee00f20084146005171f1f2f26d64d36170 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 07:55:51 +0900 Subject: [PATCH 31/57] =?UTF-8?q?[CHORE]=20=EC=A3=BC=EB=8B=88=EC=96=B4=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20-=20'=ED=95=99=EB=A0=A5'=20?= =?UTF-8?q?=EB=8C=80=EC=8B=A0=20'=EC=86=8C=EC=86=8D'=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=9B=8C=EB=94=A9=20=EB=B3=80=EA=B2=BD=20(#164)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lgtm/android/common_ui/model/mapper/UiMapper.kt | 4 ++-- common-ui/src/main/res/values/strings.xml | 6 +++--- .../auth/src/main/res/layout/fragment_education_status.xml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/model/mapper/UiMapper.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/model/mapper/UiMapper.kt index e33c2ef3..a971c81c 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/model/mapper/UiMapper.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/model/mapper/UiMapper.kt @@ -55,7 +55,7 @@ fun ProfileVO.toUiModel(role: Role): ProfileGlanceUI = ProfileGlanceUI( githubId = githubId, detailInfoLabel = when (company == null) { false -> R.string.company_slash_position - true -> R.string.education + true -> R.string.affiliation }, detailInfo = when (company == null) { false -> "$company / $position" @@ -70,7 +70,7 @@ fun ProfileGlance.toUiModel(): ProfileGlanceUI = ProfileGlanceUI( githubId = githubId, detailInfoLabel = when (company == null) { false -> R.string.company_slash_position - true -> R.string.education + true -> R.string.affiliation }, detailInfo = when (company == null) { false -> "$company / $position" diff --git a/common-ui/src/main/res/values/strings.xml b/common-ui/src/main/res/values/strings.xml index 0f9831f1..8b547c0a 100644 --- a/common-ui/src/main/res/values/strings.xml +++ b/common-ui/src/main/res/values/strings.xml @@ -23,7 +23,7 @@ 개발을 배우고 싶어요. 리뷰어 개발을 알려주고 싶어요. - 학력 정보를\n선택해주세요. + 현재 소속을\n선택해주세요. 고등학생 대학생 대학교 졸업 @@ -47,7 +47,7 @@ 현업 개발자만 리뷰어 활동이 가능해요 중복된 닉네임입니다. 사용 가능합니다. - + 예금주명을 입력하세요. @@ -121,7 +121,7 @@ 현재 버전 1.0.0 최신 버전 설정 - 학력 + 소속 참가자 목록 diff --git a/feature/auth/src/main/res/layout/fragment_education_status.xml b/feature/auth/src/main/res/layout/fragment_education_status.xml index 1d182c3e..432274a5 100644 --- a/feature/auth/src/main/res/layout/fragment_education_status.xml +++ b/feature/auth/src/main/res/layout/fragment_education_status.xml @@ -23,7 +23,7 @@ android:layout_height="wrap_content" android:layout_marginStart="20dp" android:layout_marginTop="121dp" - android:text="@string/select_edu_status" + android:text="@string/select_affiliation" android:textAppearance="@style/Heading4B" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> From 86b075bb08344cbbf5b13baec4e3b1e32fa35cb1 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 08:07:34 +0900 Subject: [PATCH 32/57] =?UTF-8?q?[CHORE]=20=EB=AF=B8=EC=85=98=20=EB=A7=88?= =?UTF-8?q?=EA=B0=90=EC=9D=BC=EC=9D=84=20=EB=82=98=ED=83=80=EB=82=BC=20?= =?UTF-8?q?=EB=95=8C=20=EC=9D=8C=EC=88=98=20=EB=8C=80=EC=8B=A0=20'?= =?UTF-8?q?=EB=AA=A8=EC=A7=91=20=EB=A7=88=EA=B0=90',=200=20=EB=8C=80?= =?UTF-8?q?=EC=8B=A0=20'=EC=98=A4=EB=8A=98=20=EB=A7=88=EA=B0=90'=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=ED=91=9C=EA=B8=B0=20(#164)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common-ui/src/main/res/layout/item_sdui_item.xml | 2 +- .../src/main/res/layout/activity_mission_detail.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common-ui/src/main/res/layout/item_sdui_item.xml b/common-ui/src/main/res/layout/item_sdui_item.xml index 5d850018..77da63b1 100644 --- a/common-ui/src/main/res/layout/item_sdui_item.xml +++ b/common-ui/src/main/res/layout/item_sdui_item.xml @@ -328,7 +328,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="6dp" - android:text="@{data.remainingRegisterDays + `일 후 마감`}" + android:text="@{data.remainingRegisterDays >= 1 ? data.remainingRegisterDays + `일 후 마감` : data.remainingRegisterDays == 0 ? `오늘 마감` : `모집 마감`}" android:textAppearance="@style/Body3M" android:textColor="@color/gray_6" app:layout_constraintBottom_toBottomOf="@id/view_time_divider" diff --git a/feature/mission_detail/src/main/res/layout/activity_mission_detail.xml b/feature/mission_detail/src/main/res/layout/activity_mission_detail.xml index 5cf866b6..41adbb8e 100644 --- a/feature/mission_detail/src/main/res/layout/activity_mission_detail.xml +++ b/feature/mission_detail/src/main/res/layout/activity_mission_detail.xml @@ -201,7 +201,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/inner_guideline" - android:text="@{String.valueOf(viewModel.missionDetailUiState.remainingRegisterDays)+ `일 후 마감`}" + android:text="@{viewModel.missionDetailUiState.remainingRegisterDays >= 1 ? String.valueOf(viewModel.missionDetailUiState.remainingRegisterDays) + `일 후 마감` : viewModel.missionDetailUiState.remainingRegisterDays == 0 ? `오늘 마감` : `모집 마감`}" android:textAppearance="@style/Body2" android:textColor="@color/gray_5" app:layout_constraintEnd_toEndOf="parent" From 6c44a7431ceed717c93c61ffe961c88dc1242e5f Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 08:08:52 +0900 Subject: [PATCH 33/57] =?UTF-8?q?[CHORE]=20=EC=B1=84=ED=8C=85=20=EC=95=88?= =?UTF-8?q?=EB=82=B4=20=EB=A9=94=EC=84=B8=EC=A7=80=20'10=EC=9B=94'=20->=20?= =?UTF-8?q?'11=EC=9B=94=EC=97=90=20=EB=A7=8C=EB=82=98=EC=9A=94!'=20(#164)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common-ui/src/main/res/values/strings.xml | 2 +- feature/main/src/main/res/layout/fragment_chat.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common-ui/src/main/res/values/strings.xml b/common-ui/src/main/res/values/strings.xml index 8b547c0a..710edeaf 100644 --- a/common-ui/src/main/res/values/strings.xml +++ b/common-ui/src/main/res/values/strings.xml @@ -83,7 +83,7 @@ 서비스 준비중입니다. - 10월에 만나요! + 11월에 만나요! 미션 URL diff --git a/feature/main/src/main/res/layout/fragment_chat.xml b/feature/main/src/main/res/layout/fragment_chat.xml index 7cdd9194..ec3600b4 100644 --- a/feature/main/src/main/res/layout/fragment_chat.xml +++ b/feature/main/src/main/res/layout/fragment_chat.xml @@ -40,7 +40,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="3dp" - android:text="@string/coming_soon_oct" + android:text="@string/coming_soon_nov" android:textAppearance="@style/Description" android:textColor="@color/gray_6" app:layout_constraintEnd_toEndOf="parent" From 3851bda07e79d5441d6e627a7ef1e88f55d7efd1 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 08:18:40 +0900 Subject: [PATCH 34/57] =?UTF-8?q?[CHORE]=20=EB=AF=B8=EC=85=98=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EC=8B=9C=20Repository=20Url=EB=A5=BC=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EC=9E=85=EB=A0=A5=EC=82=AC=ED=95=AD=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20(#164)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lgtm/domain/entity/request/PostMissionRequestDTO.kt | 2 +- .../android/create_mission/CreateMissionViewModel.kt | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/domain/src/main/java/com/lgtm/domain/entity/request/PostMissionRequestDTO.kt b/domain/src/main/java/com/lgtm/domain/entity/request/PostMissionRequestDTO.kt index 4a7cdd33..1324486b 100644 --- a/domain/src/main/java/com/lgtm/domain/entity/request/PostMissionRequestDTO.kt +++ b/domain/src/main/java/com/lgtm/domain/entity/request/PostMissionRequestDTO.kt @@ -3,7 +3,7 @@ package com.lgtm.domain.entity.request data class PostMissionRequestDTO( val description: String, val maxPeopleNumber: Int, - val missionRepositoryUrl: String, + val missionRepositoryUrl: String?, val notRecommendTo: String?, val price: Int, val recommendTo: String?, diff --git a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionViewModel.kt b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionViewModel.kt index 849ee4aa..5c3e4d34 100644 --- a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionViewModel.kt +++ b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionViewModel.kt @@ -73,15 +73,12 @@ class CreateMissionViewModel @Inject constructor( else if (repositoryUrl.value?.isNotBlank() == true && !isGithubUrl( repositoryUrl.value ?: "" ) - ) - repoUrlEditTextData.value?.infoStatus?.value = InfoType.GITHUB_URL_ONLY - else - repoUrlEditTextData.value?.infoStatus?.value = InfoType.NONE + ) repoUrlEditTextData.value?.infoStatus?.value = InfoType.GITHUB_URL_ONLY + else repoUrlEditTextData.value?.infoStatus?.value = InfoType.NONE } private fun isMissionRepoUrlValid(): Boolean { return repoUrlEditTextData.value?.infoStatus?.value == InfoType.NONE - && repoUrlEditTextData.value?.text?.value?.isNotBlank() == true } private fun isGithubUrl(url: String): Boolean { @@ -216,7 +213,7 @@ class CreateMissionViewModel @Inject constructor( return PostMissionRequestDTO( description = requireNotNull(description.value), maxPeopleNumber = requireNotNull(numOfRecruits.value), - missionRepositoryUrl = requireNotNull(repositoryUrl.value), + missionRepositoryUrl = repositoryUrl.value, notRecommendTo = notRecommendGroup.value, recommendTo = recommendGroup.value, price = requireNotNull(price.value), From 452fca64eb6310eb57014f0fc1fca20d50879874 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 08:31:52 +0900 Subject: [PATCH 35/57] =?UTF-8?q?[CHORE]=20=EB=A6=AC=EB=B7=B0=EC=96=B4,=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=EC=96=B4=20=EA=B0=81=EA=B0=81=20=EB=8B=A4?= =?UTF-8?q?=EB=A5=B8=20=EC=84=9C=EB=B9=84=EC=8A=A4=20=EC=9D=B4=EC=9A=A9?= =?UTF-8?q?=EB=B0=A9=EB=B2=95=20=EB=A7=81=ED=81=AC=20=ED=83=80=EA=B2=9F=20?= =?UTF-8?q?(#164)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lgtm/android/main/setting/MyPageFragment.kt | 7 ++++++- .../java/com/lgtm/android/main/setting/MyPageViewModel.kt | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt index ea581b98..5c26ec5b 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt @@ -14,6 +14,7 @@ import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.ui.LgtmConfirmationDialog import com.lgtm.android.main.R import com.lgtm.android.main.databinding.FragmentMyPageBinding +import com.lgtm.domain.constants.Role import dagger.hilt.android.AndroidEntryPoint @@ -94,8 +95,12 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ private fun serviceGuidelines() { // 서비스 이용 방법 + val role = myPageViewModel.getUserRole() binding.btnServiceGuidelines.setOnClickListener { - val url = "https://team-hkcc.notion.site/efa704ed9464409dae3a9dbe4c4e3777?pvs=4" + val url =when(role){ + Role.REVIEWER -> "https://www.notion.so/team-hkcc/c1933575315e4b50aedbdd6b39069d3e?pvs=4" + Role.REVIEWEE -> "https://www.notion.so/team-hkcc/5abf8b03763a4f0d90cb2d463f6d46b4?pvs=4" + } openUrlInBrowser(url) } } diff --git a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageViewModel.kt index 4d4d8012..a39263ca 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageViewModel.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageViewModel.kt @@ -36,4 +36,6 @@ class MyPageViewModel @Inject constructor( } } } + + fun getUserRole() = authRepository.getMemberType() } \ No newline at end of file From 99556842492e690ea85f4790daa4a249d4bc8991 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 08:39:20 +0900 Subject: [PATCH 36/57] =?UTF-8?q?[FEAT]=20=ED=99=88=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=EC=83=81=EB=8B=A8=20=EC=84=9C=EB=B9=84=EC=8A=A4=20=EC=9D=B4?= =?UTF-8?q?=EC=9A=A9=EB=B0=A9=EB=B2=95=20=EC=B6=94=EA=B0=80=20(#164)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/drawable-hdpi/ic_question.png | Bin 0 -> 415 bytes .../main/res/drawable-mdpi/ic_question.png | Bin 0 -> 321 bytes .../main/res/drawable-xhdpi/ic_question.png | Bin 0 -> 486 bytes .../main/res/drawable-xxhdpi/ic_question.png | Bin 0 -> 648 bytes .../main/res/drawable-xxxhdpi/ic_question.png | Bin 0 -> 746 bytes .../lgtm/android/main/home/HomeFragment.kt | 24 ++++++++++++++++++ .../lgtm/android/main/home/HomeViewModel.kt | 2 ++ .../src/main/res/layout/fragment_home.xml | 14 ++++++++++ 8 files changed, 40 insertions(+) create mode 100644 common-ui/src/main/res/drawable-hdpi/ic_question.png create mode 100644 common-ui/src/main/res/drawable-mdpi/ic_question.png create mode 100644 common-ui/src/main/res/drawable-xhdpi/ic_question.png create mode 100644 common-ui/src/main/res/drawable-xxhdpi/ic_question.png create mode 100644 common-ui/src/main/res/drawable-xxxhdpi/ic_question.png diff --git a/common-ui/src/main/res/drawable-hdpi/ic_question.png b/common-ui/src/main/res/drawable-hdpi/ic_question.png new file mode 100644 index 0000000000000000000000000000000000000000..c0780d8957cb247b15f4d488dec40b5c135c0019 GIT binary patch literal 415 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|l3?zm1T2})pmUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIB<0X`wF?gc(TCNY40-L!0=I^L2XzhH*<3nv^AZAiH95Kz#6bK8$Vpu{gv z7sn8d^T`PdcwA$=XY%AuPA;il4v}wj99v*JTFQyv;^gB39)YLonNic{!WZJmSV1u~9kERIW z2B$LuU$Wt~$(698W3fh+(3 literal 0 HcmV?d00001 diff --git a/common-ui/src/main/res/drawable-mdpi/ic_question.png b/common-ui/src/main/res/drawable-mdpi/ic_question.png new file mode 100644 index 0000000000000000000000000000000000000000..3d7c88ae1cbdf6002f88b855a976c6d361d256c7 GIT binary patch literal 321 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaN3?zjj6;1;wmUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIDl0X`wF?gc(TCP7fwtHlOX#8VRF7tC;9U_(NILPNm&2@5;~4a0%r3p`yM zLnJOICmdj((Ui(J>wv}F^acl(L(i<3*;o_&cw36Oj-**Kv+_FdDNoP~VilU)AT!@M zy|3vilPBA3<8(elt`~DGizQA>v@CuW!PikNaDwrr?O6e4m4$PX*Q6`REZAhsUUAN0 z%FTu;Z!MV(8J7Ht;G1B<^d#eu1(O3G`x#3dx47k3${*hxR7A*|F;a#SXWOM z#}JFt$q5V8X9TS(&e*BmX0Z9PqydMpgYbJxX4c~YsdLU9a5ULuaa>a6LPJUb@1`S~ z%sW`FONs1x)q+v@xm`1x%mSfBFN977bjomqr!pn;bw&0F+zVWAULsi`r(^dG zg*nX%+XObLt`YEK>Nv}ksNJCY%)x?*XZ9jV3&l5+6FB8L+8Y(02{1Fa)UxO>^71nu zGj>lDI(|?nTVamNX5(80;!Ub04;HF36hBnlz;fsCK^`8X^aL>_@0^C}4?L>^J33k< zM4Klx+-`dlv!VICg7tOwW2{y`cs8*=pL395fn*_W$Kc@EXz9$wpxE$q^>bP0l+XkKAaI|& literal 0 HcmV?d00001 diff --git a/common-ui/src/main/res/drawable-xxhdpi/ic_question.png b/common-ui/src/main/res/drawable-xxhdpi/ic_question.png new file mode 100644 index 0000000000000000000000000000000000000000..5e420a2cbc032560320438fa6fb146ed5505841d GIT binary patch literal 648 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xZ3?!EyURMI7SkfJR9T^xl_H+M9WCijWi-X*q z7}lMWc?slb1^9%xx)=BWnZyA0bUc|n{DK(-?knw|<`7wMq2c`o?#s6nfkr>} zba4#vIR13nS#Ksskpsug?6q1{HM9k~_Pr3$iFNMKb5*#a%W-fQ_ccq!g?@@5%<}=+h?shXsVDB_pxefQ;x8svcoCU zCL@!O$ul)rPDJW&kF9)}dsb61H}|xW-_phL&lTf$E{V7=5OB_a)5<0L^%VC1E0#UF zie~)O%FSLemqAmZtnc1XO%%2`y{!y|DPkYs!QyScycns z`JST}pRThxS?{eC(Cj?l>2lJVD|xr4T;sT8ta+~F%D%_Gd=J-c+5DntwsTdo_e)lx zO#zV^E0*ok=PEi~$70nYQ~t@a>(PUN$i_z@%;~!v_WJ}kE z#zfjU9PheT(o*5u?$oyXi1pVC&YLzZWJ!9N`~Iu!$8*IJUBU+w&qrIRZvHo8`dkga zlYQRG_OeqLDzB_%cl`9Hm(}rS9lQ4IWec_Un7&BN|GM97hNG@RaBOg*?5)e<_c~AQ z349&u={z;&MWD#T`fHT}k0Wfp&yd}G+Wgp)$7%;o{rjj;TlJSQYhFNwwxD7>D7|>P L`njxgN@xNAl$;7# literal 0 HcmV?d00001 diff --git a/common-ui/src/main/res/drawable-xxxhdpi/ic_question.png b/common-ui/src/main/res/drawable-xxxhdpi/ic_question.png new file mode 100644 index 0000000000000000000000000000000000000000..e44704994200b03933d8df00d2007beafb9a6806 GIT binary patch literal 746 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeE3?v1%WpM*3mUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIDl0X`wF?gc(TCP7fwtHlOX#8VRF7tC;9Kw+|10HQ&rnMek#aqAo1FFSO&%@!wzX?k?{q)nP;4)o<24+j9QzVq{vwwLdhhvx3s%8~$izbVJ%pE7z+;XC&GeY?w3!;snwp>j*FwwLY`7n%O`K|uW_ z4f|PhHftHYG5_iO?nuDx_a%-?4rLer><^#*DdZQ+iL37(=f*$O|G*o;BXn*(R.layout.fragment_home) { submitDataWhenDataChanged() setUpNotificationClickListener() onClickNewMissionButton() + onClickServiceGuideButton() } override fun onResume() { @@ -70,4 +74,24 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { lgtmNavigator.navigateToCreateMission(requireContext()) } } + + private fun onClickServiceGuideButton(){ + val role = homeViewModel.getUserRole() + binding.ivServiceGuide.setOnClickListener { + val url =when(role){ + Role.REVIEWER -> "https://www.notion.so/team-hkcc/c1933575315e4b50aedbdd6b39069d3e?pvs=4" + Role.REVIEWEE -> "https://www.notion.so/team-hkcc/5abf8b03763a4f0d90cb2d463f6d46b4?pvs=4" + } + openUrlInBrowser(url) + } + } + + private fun openUrlInBrowser(url: String) { + val intent = Intent(Intent.ACTION_VIEW).apply { + data = Uri.parse(url) + flags = Intent.FLAG_ACTIVITY_NEW_TASK + } + startActivity(intent) + } + } \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt index 2ef8919f..dc3ddbaf 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt @@ -48,6 +48,8 @@ class HomeViewModel @Inject constructor( SWMLogging.logEvent(scheme) } + fun getUserRole() = role + fun shotHomeNotificationClickLogging() { val scheme = getHomeClickLoggingScheme() SWMLogging.logEvent(scheme) diff --git a/feature/main/src/main/res/layout/fragment_home.xml b/feature/main/src/main/res/layout/fragment_home.xml index 815d8f17..dba081cc 100644 --- a/feature/main/src/main/res/layout/fragment_home.xml +++ b/feature/main/src/main/res/layout/fragment_home.xml @@ -40,6 +40,20 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + + Date: Tue, 7 Nov 2023 08:40:28 +0900 Subject: [PATCH 37/57] =?UTF-8?q?[CHORE]=20NotificationCenter=20BackButton?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../android/main/notification/NotificationCenterActivity.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt index 8c700e50..f50a7899 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt @@ -25,6 +25,7 @@ class NotificationCenterActivity : getNotificationList() initAdapter() observeNotificationList() + onClickBackButton() } private fun getNotificationList() { @@ -54,4 +55,8 @@ class NotificationCenterActivity : ) binding.rvNotification.addItemDecoration(decoration) } + + private fun onClickBackButton() { + binding.ivBack.setOnClickListener { finish() } + } } \ No newline at end of file From e6a9fd858c881cb0f353ac3d97353088dfe5e16e Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 15:54:09 +0900 Subject: [PATCH 38/57] =?UTF-8?q?[CHORE]=20=EC=A4=91=EB=B3=B5=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20=EB=B0=A9=EC=A7=80=EB=A5=BC=20=EC=9C=84=ED=95=9C=20?= =?UTF-8?q?throttle=20click=20=EC=84=A4=EC=A0=95=20(#166)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common_ui/adapter/ParticipantAdapter.kt | 5 +-- .../common_ui/ui/LgtmConfirmationDialog.kt | 5 +-- .../common_ui/util/SingleClickListener.kt | 34 +++++++++++++++++++ .../common_ui/util/TechTagChipGroup.kt | 2 +- .../viewholder/ProfileGlanceViewHolder.kt | 3 +- .../viewholder/ProfileMissionViewHolder.kt | 3 +- .../viewholder/SduiItemViewHolder.kt | 5 +-- .../lgtm/android/auth/ui/SignInActivity.kt | 3 +- .../ui/signup/common/ChooseRoleFragment.kt | 3 +- .../ui/signup/common/IntroductionFragment.kt | 3 +- .../auth/ui/signup/common/NicknameFragment.kt | 3 +- .../auth/ui/signup/common/TechTagFragment.kt | 3 +- .../auth/ui/signup/common/TermsFragment.kt | 15 ++++---- .../reviewee/EducationStatusFragment.kt | 5 +-- .../ui/signup/reviewee/RealNameFragment.kt | 3 +- .../ui/signup/reviewer/BankAccountFragment.kt | 3 +- .../signup/reviewer/CareerPeriodFragment.kt | 3 +- .../ui/signup/reviewer/CompanyNameFragment.kt | 3 +- .../ui/signup/reviewer/PositionFragment.kt | 3 +- .../create_mission/CreateMissionActivity.kt | 3 +- .../CreateMissionStep1Fragment.kt | 3 +- .../CreateMissionStep2Fragment.kt | 3 +- .../CreateMissionStep3Fragment.kt | 3 +- .../CreateMissionStep4Fragment.kt | 3 +- .../CreateMissionStep5Fragment.kt | 5 +-- .../lgtm/android/main/home/HomeFragment.kt | 7 ++-- .../NotificationCenterActivity.kt | 3 +- .../android/main/setting/MyPageFragment.kt | 21 ++++++------ .../dashboard/DashboardActivity.kt | 3 +- .../ping_pong_junior/AccountInfoFragment.kt | 3 +- .../PingPongJuniorActivity.kt | 5 +-- .../SubmittedMissionFragment.kt | 3 +- .../PingPongSeniorFragment.kt | 5 +-- .../mission_detail/MissionDetailActivity.kt | 17 +++++----- .../lgtm/android/profile/ProfileActivity.kt | 7 ++-- 35 files changed, 134 insertions(+), 67 deletions(-) create mode 100644 common-ui/src/main/java/com/lgtm/android/common_ui/util/SingleClickListener.kt diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/adapter/ParticipantAdapter.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/adapter/ParticipantAdapter.kt index 0cb1239e..788d0778 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/adapter/ParticipantAdapter.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/adapter/ParticipantAdapter.kt @@ -7,6 +7,7 @@ import androidx.recyclerview.widget.RecyclerView import com.lgtm.android.common_ui.databinding.ItemDashboardParticipantBinding import com.lgtm.android.common_ui.model.MemberMissionStatusUI import com.lgtm.android.common_ui.util.ItemDiffCallback +import com.lgtm.android.common_ui.util.setOnThrottleClickListener class ParticipantAdapter( @@ -35,7 +36,7 @@ class ParticipantViewHolder( ) : RecyclerView.ViewHolder(binding.root) { fun onBind(item: MemberMissionStatusUI) { binding.data = item - binding.clProgress.setOnClickListener { onProcessStateClickListener(item.memberId) } - binding.btnReviewMission.setOnClickListener { onCodeReviewClickListener(item.githubPrUrl) } + binding.clProgress.setOnThrottleClickListener { onProcessStateClickListener(item.memberId) } + binding.btnReviewMission.setOnThrottleClickListener { onCodeReviewClickListener(item.githubPrUrl) } } } diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/ui/LgtmConfirmationDialog.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/ui/LgtmConfirmationDialog.kt index 107e05f7..4268f1b0 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/ui/LgtmConfirmationDialog.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/ui/LgtmConfirmationDialog.kt @@ -9,6 +9,7 @@ import androidx.databinding.DataBindingUtil import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.lgtm.android.common_ui.R import com.lgtm.android.common_ui.databinding.DialogLgtmConfirmationBinding +import com.lgtm.android.common_ui.util.setOnThrottleClickListener class LgtmConfirmationDialog( private val title: String, @@ -54,11 +55,11 @@ class LgtmConfirmationDialog( } private fun onClickCancelListener() { - binding.btnCancel.setOnClickListener { dismiss() } + binding.btnCancel.setOnThrottleClickListener { dismiss() } } private fun onClickConfirmListener() { - binding.btnConfirm.setOnClickListener { + binding.btnConfirm.setOnThrottleClickListener { dismiss() doAfterConfirm() } diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/util/SingleClickListener.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/util/SingleClickListener.kt new file mode 100644 index 00000000..ffe7fb04 --- /dev/null +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/util/SingleClickListener.kt @@ -0,0 +1,34 @@ +package com.lgtm.android.common_ui.util + +import android.content.ContentValues.TAG +import android.util.Log +import android.view.View + + +class OnThrottleClickListener( + private val onClickListener: View.OnClickListener, + private val interval: Long = 300L, +) : View.OnClickListener { + + private var clickable = true + + override fun onClick(v: View?) { + if (clickable) { + clickable = false + v?.run { + postDelayed({ clickable = true }, interval) + onClickListener.onClick(v) + } + } else { + Log.d(TAG, "onClick : operating setOnThrottleClickListener") + } + } +} + +fun View.setOnThrottleClickListener(action: (v: View) -> Unit) { + setOnClickListener(OnThrottleClickListener(action)) +} + +fun View.setOnThrottleClickListener(action: (v: View) -> Unit, interval: Long) { + setOnClickListener(OnThrottleClickListener(action, interval)) +} diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/util/TechTagChipGroup.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/util/TechTagChipGroup.kt index 286fd079..930a6a08 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/util/TechTagChipGroup.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/util/TechTagChipGroup.kt @@ -54,7 +54,7 @@ class TechTagChipGroup(private val chipGroup: ChipGroup, private val theme: Tech setChipIconResource(techTagUI.defaultIcon) setTextAppearance(R.style.Body2) setTextColor(textStateList) // (순서 중요) textAppearance 후에 배치 - setOnClickListener { onChipSelected(this, techTagUI) } + setOnThrottleClickListener { onChipSelected(this, techTagUI) } if (selectedTagList.value?.contains(this.text) == true) { isSelected = true } diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/ProfileGlanceViewHolder.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/ProfileGlanceViewHolder.kt index af1e9c3f..de20d4de 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/ProfileGlanceViewHolder.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/ProfileGlanceViewHolder.kt @@ -2,6 +2,7 @@ package com.lgtm.android.common_ui.viewholder import com.lgtm.android.common_ui.databinding.ItemProfileGlanceBinding import com.lgtm.android.common_ui.model.mapper.toUiModel +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.domain.profile.Profile import com.lgtm.domain.profile.profileViewType.ProfileGlance @@ -18,6 +19,6 @@ class ProfileGlanceViewHolder( override fun bind(data: Profile) { val profileGlanceData: ProfileGlance = data as ProfileGlance binding.data = profileGlanceData.toUiModel() - binding.btnGithub.setOnClickListener { onClickGithubButton() } + binding.btnGithub.setOnThrottleClickListener { onClickGithubButton() } } } \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/ProfileMissionViewHolder.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/ProfileMissionViewHolder.kt index 6d2e7828..a71df4a8 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/ProfileMissionViewHolder.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/ProfileMissionViewHolder.kt @@ -1,6 +1,7 @@ package com.lgtm.android.common_ui.viewholder import com.lgtm.android.common_ui.databinding.ItemSduiItemBinding +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.domain.profile.Profile import com.lgtm.domain.server_drive_ui.SectionItemVO @@ -15,6 +16,6 @@ class ProfileMissionViewHolder( override fun bind(data: Profile) { binding.data = data as SectionItemVO - binding.clMission.setOnClickListener { navigateToMissionDetail(data.missionId) } + binding.clMission.setOnThrottleClickListener { navigateToMissionDetail(data.missionId) } } } \ No newline at end of file diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SduiItemViewHolder.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SduiItemViewHolder.kt index 29699299..28b9a057 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SduiItemViewHolder.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SduiItemViewHolder.kt @@ -1,6 +1,7 @@ package com.lgtm.android.common_ui.viewholder import com.lgtm.android.common_ui.databinding.ItemSduiItemBinding +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.domain.server_drive_ui.SduiContent import com.lgtm.domain.server_drive_ui.SduiTheme import com.lgtm.domain.server_drive_ui.SectionItemVO @@ -13,12 +14,12 @@ class SduiItemViewHolder( override fun bind(theme: SduiTheme, viewContent: SduiContent) { binding.data = viewContent as SectionItemVO binding.theme = theme - binding.clMission.setOnClickListener { navigateToMissionDetail(viewContent.missionId) } + binding.clMission.setOnThrottleClickListener { navigateToMissionDetail(viewContent.missionId) } if (viewContent.isScraped != null) { binding.bookmarkButton.isBookmarked = viewContent.isScraped == true binding.bookmarkButton.bookmarkNum = viewContent.scrapCount ?: 0 - binding.bookmarkButton.btnBookmark.setOnClickListener { + binding.bookmarkButton.btnBookmark.setOnThrottleClickListener { // todo bookmark api 연동 } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInActivity.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInActivity.kt index f1985a1d..23258c5e 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInActivity.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInActivity.kt @@ -13,6 +13,7 @@ import com.lgtm.android.auth.ui.github.GithubBottomSheet import com.lgtm.android.auth.ui.signup.SignUpActivity import com.lgtm.android.common_ui.base.BaseActivity import com.lgtm.android.common_ui.util.NetworkState +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -39,7 +40,7 @@ class SignInActivity : BaseActivity(R.layout.activity_sig } private fun initClickListener() { - binding.clGithub.setOnClickListener { + binding.clGithub.setOnThrottleClickListener { showGithubLoginBottomSheet() } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt index 22f9548a..ba57a398 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/ChooseRoleFragment.kt @@ -8,6 +8,7 @@ import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.FragmentChooseRoleBinding import com.lgtm.android.auth.ui.signup.SignUpViewModel import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.domain.constants.Role import dagger.hilt.android.AndroidEntryPoint @@ -35,7 +36,7 @@ class ChooseRoleFragment : BaseFragment(R.layout.frag } private fun setupNextButtonListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { if (signUpViewModel.selectedRole.value == Role.REVIEWEE) { navigateToEducationStatusFragment() } else { diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt index 16bb954d..3db93144 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/IntroductionFragment.kt @@ -8,6 +8,7 @@ import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.FragmentIntroductionBinding import com.lgtm.android.auth.ui.signup.SignUpViewModel import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -45,7 +46,7 @@ class IntroductionFragment : private fun setupNextButtonListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { navigateToSelectRoleFragment() } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt index 1a247639..8df858fd 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/NicknameFragment.kt @@ -8,6 +8,7 @@ import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.FragmentNicknameBinding import com.lgtm.android.auth.ui.signup.SignUpViewModel import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import dagger.hilt.android.AndroidEntryPoint @@ -44,7 +45,7 @@ class NicknameFragment : BaseFragment(R.layout.fragment } private fun setupNextButtonListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { navigateToTechTagFragment() } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt index d18b74bb..7924ada3 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TechTagFragment.kt @@ -10,6 +10,7 @@ import com.lgtm.android.auth.ui.signup.SignUpViewModel import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.util.TechTagChipGroup import com.lgtm.android.common_ui.util.TechTagTheme +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -44,7 +45,7 @@ class TechTagFragment : BaseFragment(R.layout.fragment_t private fun setupNextButtonListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { navigateToIntroductionFragment() } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt index 9d33b542..37a5ec71 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/common/TermsFragment.kt @@ -10,6 +10,7 @@ import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.FragmentTermsBinding import com.lgtm.android.auth.ui.signup.SignUpViewModel import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -27,7 +28,7 @@ class TermsFragment : BaseFragment(R.layout.fragment_terms } private fun setupNextButtonListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { setEventInfoAgreeState() navigateToNicknameFragment() } @@ -43,10 +44,10 @@ class TermsFragment : BaseFragment(R.layout.fragment_terms private fun setUpTextViewListener() { - binding.tvTermsService.setOnClickListener { + binding.tvTermsService.setOnThrottleClickListener { openUrlInBrowser(TERMS_SERVICE_URL) } - binding.tvTermsPrivacy.setOnClickListener { + binding.tvTermsPrivacy.setOnThrottleClickListener { openUrlInBrowser(TERMS_PRIVACY_URL) } } @@ -64,24 +65,24 @@ class TermsFragment : BaseFragment(R.layout.fragment_terms } private fun setUpCheckBoxListeners() { - binding.clTermsAll.setOnClickListener { + binding.clTermsAll.setOnThrottleClickListener { toggleTermsAll() setDescendantsState(binding.cbTermsAll.isChecked) updateNextButtonState() } // 약관 및 정책 - binding.cbTermsService.setOnClickListener { + binding.cbTermsService.setOnThrottleClickListener { updateTermsAllState() updateNextButtonState() } // 개인정보 처리 방침 - binding.cbTermsPrivacy.setOnClickListener { + binding.cbTermsPrivacy.setOnThrottleClickListener { updateTermsAllState() updateNextButtonState() } // 이벤트 - binding.cbTermsMarketing.setOnClickListener { + binding.cbTermsMarketing.setOnThrottleClickListener { updateTermsAllState() updateNextButtonState() } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt index f40ff1a9..791696ce 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/EducationStatusFragment.kt @@ -15,6 +15,7 @@ import com.lgtm.android.common_ui.R.dimen import com.lgtm.android.common_ui.R.drawable import com.lgtm.android.common_ui.R.style import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.domain.constants.EducationStatus @@ -64,7 +65,7 @@ class EducationStatusFragment : resources.getDimensionPixelSize(dimen.radio_button_margin_top) this.layoutParams = layoutParams - this.setOnClickListener { signUpViewModel.setEducationStatus(educationStatus.ordinal) } + this.setOnThrottleClickListener { signUpViewModel.setEducationStatus(educationStatus.ordinal) } } radioGroup.addView(radioButton) } @@ -81,7 +82,7 @@ class EducationStatusFragment : } private fun setupNextButtonListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { navigateToRealNameActivity() } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt index a71de179..df4511d3 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewee/RealNameFragment.kt @@ -11,6 +11,7 @@ import com.lgtm.android.auth.ui.SignInActivity import com.lgtm.android.auth.ui.signup.SignUpViewModel import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.util.NetworkState +import com.lgtm.android.common_ui.util.setOnThrottleClickListener class RealNameFragment : BaseFragment(R.layout.fragment_real_name) { @@ -46,7 +47,7 @@ class RealNameFragment : BaseFragment(R.layout.fragment } private fun setupCompleteButtonListener() { - binding.btnComplete.setOnClickListener { + binding.btnComplete.setOnThrottleClickListener { signUpViewModel.signUpJunior() } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt index c0b8443f..d0cd6e9d 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/BankAccountFragment.kt @@ -16,6 +16,7 @@ import com.lgtm.android.common_ui.adapter.BankSpinnerAdapter import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.constant.Bank import com.lgtm.android.common_ui.util.NetworkState +import com.lgtm.android.common_ui.util.setOnThrottleClickListener class BankAccountFragment : BaseFragment(R.layout.fragment_bank_account) { @@ -73,7 +74,7 @@ class BankAccountFragment : } private fun setupCompleteButtonListener() { - binding.btnComplete.setOnClickListener { + binding.btnComplete.setOnThrottleClickListener { signUpViewModel.signUpSenior() } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt index 045a91c2..9d559365 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CareerPeriodFragment.kt @@ -9,6 +9,7 @@ import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.FragmentCareerPeriodBinding import com.lgtm.android.auth.ui.signup.SignUpViewModel import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener class CareerPeriodFragment : @@ -39,7 +40,7 @@ class CareerPeriodFragment : private fun setupNextButtonListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { navigateToBankAccountFragment() } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt index e0d338d4..3fafb1ad 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/CompanyNameFragment.kt @@ -8,6 +8,7 @@ import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.FragmentCompanyNameBinding import com.lgtm.android.auth.ui.signup.SignUpViewModel import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener class CompanyNameFragment : BaseFragment(R.layout.fragment_company_name) { @@ -43,7 +44,7 @@ class CompanyNameFragment : private fun setupNextButtonListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { navigateToPositionFragment() } } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt index 3ccc71c3..3a73c113 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/reviewer/PositionFragment.kt @@ -8,6 +8,7 @@ import com.lgtm.android.auth.R import com.lgtm.android.auth.databinding.FragmentPositionBinding import com.lgtm.android.auth.ui.signup.SignUpViewModel import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener class PositionFragment : BaseFragment(R.layout.fragment_position) { @@ -43,7 +44,7 @@ class PositionFragment : private fun setupNextButtonListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { navigateToPositionFragment() } } diff --git a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionActivity.kt b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionActivity.kt index ecbc02e3..17bfb89f 100644 --- a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionActivity.kt +++ b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionActivity.kt @@ -5,6 +5,7 @@ import androidx.activity.OnBackPressedCallback import androidx.activity.viewModels import com.lgtm.android.common_ui.adapter.ViewPagerAdapter import com.lgtm.android.common_ui.base.BaseActivity +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.create_mission.databinding.ActivityCreateMissionBinding import dagger.hilt.android.AndroidEntryPoint @@ -58,7 +59,7 @@ class CreateMissionActivity : } private fun setOnBackButtonClickListener() { - binding.ivBack.setOnClickListener { + binding.ivBack.setOnThrottleClickListener { setPreviousPage() } } diff --git a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep1Fragment.kt b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep1Fragment.kt index 7e5f6564..e89b2c2b 100644 --- a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep1Fragment.kt +++ b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep1Fragment.kt @@ -4,6 +4,7 @@ import android.os.Bundle import android.view.View import androidx.fragment.app.activityViewModels import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.create_mission.databinding.FragmentCreateMissionStep1Binding import dagger.hilt.android.AndroidEntryPoint @@ -57,7 +58,7 @@ class CreateMissionStep1Fragment : } private fun setupNextButtonClickListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { closeKeyboard() (requireActivity() as? CreateMissionActivity)?.setNextPage() } diff --git a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep2Fragment.kt b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep2Fragment.kt index 400138f4..c75f5e6d 100644 --- a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep2Fragment.kt +++ b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep2Fragment.kt @@ -6,6 +6,7 @@ import androidx.fragment.app.activityViewModels import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.util.TechTagChipGroup import com.lgtm.android.common_ui.util.TechTagTheme +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.create_mission.databinding.FragmentCreateMissionStep2Binding import dagger.hilt.android.AndroidEntryPoint @@ -43,7 +44,7 @@ class CreateMissionStep2Fragment : private fun setupNextButtonClickListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { (requireActivity() as? CreateMissionActivity)?.setNextPage() } } diff --git a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep3Fragment.kt b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep3Fragment.kt index 8cf3fc7e..9336ffec 100644 --- a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep3Fragment.kt +++ b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep3Fragment.kt @@ -4,6 +4,7 @@ import android.os.Bundle import android.view.View import androidx.fragment.app.activityViewModels import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.create_mission.databinding.FragmentCreateMissionStep3Binding import dagger.hilt.android.AndroidEntryPoint @@ -51,7 +52,7 @@ class CreateMissionStep3Fragment : } private fun setupNextButtonClickListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { (requireActivity() as? CreateMissionActivity)?.setNextPage() } } diff --git a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep4Fragment.kt b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep4Fragment.kt index 984dad09..d26674c8 100644 --- a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep4Fragment.kt +++ b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep4Fragment.kt @@ -5,6 +5,7 @@ import android.view.View import androidx.core.widget.addTextChangedListener import androidx.fragment.app.activityViewModels import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.create_mission.databinding.FragmentCreateMissionStep4Binding import dagger.hilt.android.AndroidEntryPoint @@ -44,7 +45,7 @@ class CreateMissionStep4Fragment : private fun setupNextButtonClickListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { (requireActivity() as? CreateMissionActivity)?.setNextPage() } } diff --git a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep5Fragment.kt b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep5Fragment.kt index ec2373ac..4e7fa98d 100644 --- a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep5Fragment.kt +++ b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionStep5Fragment.kt @@ -8,6 +8,7 @@ import androidx.fragment.app.activityViewModels import com.lgtm.android.common_ui.R.style import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.util.NetworkState +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.create_mission.databinding.FragmentCreateMissionStep5Binding import com.lgtm.domain.util.dotStyleFormatter import dagger.hilt.android.AndroidEntryPoint @@ -32,7 +33,7 @@ class CreateMissionStep5Fragment : } private fun onEditTextClicked() { - binding.etRegistrationDueDate.setOnClickListener { + binding.etRegistrationDueDate.setOnThrottleClickListener { showDatePickerDialog() } } @@ -74,7 +75,7 @@ class CreateMissionStep5Fragment : private fun setupNextButtonClickListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { createMissionViewModel.createMission() } } diff --git a/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt b/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt index 2816e1bb..f0fe3b0f 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt @@ -7,6 +7,7 @@ import android.view.View import androidx.fragment.app.viewModels import com.lgtm.android.common_ui.adapter.SduiAdapter import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.main.R import com.lgtm.android.main.databinding.FragmentHomeBinding import com.lgtm.domain.constants.Role @@ -44,7 +45,7 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { } private fun setUpNotificationClickListener() { - binding.ivNotification.setOnClickListener { + binding.ivNotification.setOnThrottleClickListener { moveToNotificationCenter() } } @@ -70,14 +71,14 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { } private fun onClickNewMissionButton() { - binding.fabCreateMission.setOnClickListener { + binding.fabCreateMission.setOnThrottleClickListener { lgtmNavigator.navigateToCreateMission(requireContext()) } } private fun onClickServiceGuideButton(){ val role = homeViewModel.getUserRole() - binding.ivServiceGuide.setOnClickListener { + binding.ivServiceGuide.setOnThrottleClickListener { val url =when(role){ Role.REVIEWER -> "https://www.notion.so/team-hkcc/c1933575315e4b50aedbdd6b39069d3e?pvs=4" Role.REVIEWEE -> "https://www.notion.so/team-hkcc/5abf8b03763a4f0d90cb2d463f6d46b4?pvs=4" diff --git a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt index f50a7899..b1512509 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterActivity.kt @@ -5,6 +5,7 @@ import android.view.View import androidx.activity.viewModels import com.lgtm.android.common_ui.base.BaseActivity import com.lgtm.android.common_ui.util.ItemDecorationUtil +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.main.R import com.lgtm.android.main.databinding.ActivityNotificationCenterBinding import dagger.hilt.android.AndroidEntryPoint @@ -57,6 +58,6 @@ class NotificationCenterActivity : } private fun onClickBackButton() { - binding.ivBack.setOnClickListener { finish() } + binding.ivBack.setOnThrottleClickListener { finish() } } } \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt index 5c26ec5b..26c72ff2 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt @@ -12,6 +12,7 @@ import androidx.fragment.app.viewModels import com.lgtm.android.common_ui.R.string import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.ui.LgtmConfirmationDialog +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.main.R import com.lgtm.android.main.databinding.FragmentMyPageBinding import com.lgtm.domain.constants.Role @@ -52,21 +53,21 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ } private fun setOnProfileClickListener() { - binding.clProfileGlance.setOnClickListener { + binding.clProfileGlance.setOnThrottleClickListener { navigateToProfile() } } private fun setMyMissionOnClickListener() { - binding.btnMyMission.setOnClickListener { + binding.btnMyMission.setOnThrottleClickListener { // MVP 구현사항 아님 // 추후 업데이트 시 구현 } } private fun setNotificationSettingClickListener() { - binding.btnNotificationSetting.setOnClickListener { + binding.btnNotificationSetting.setOnThrottleClickListener { val intent = Intent().apply { action = "android.settings.APP_NOTIFICATION_SETTINGS" putExtra("android.provider.extra.APP_PACKAGE", requireContext().packageName) @@ -79,7 +80,7 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ private fun setNoticeOnClickListener() { // 공지사항 - binding.btnNotice.setOnClickListener { + binding.btnNotice.setOnThrottleClickListener { val url = "https://team-hkcc.notion.site/4823db3b781e40fdadd0cf61093c5158?v=3cee323345414e318192b89bfe7dd2d0&pvs=4" openUrlInBrowser(url) } @@ -87,7 +88,7 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ private fun setTermsAndPoliciesOnClickListener() { // 약관 및 정책 - binding.btnTermsAndPolicies.setOnClickListener { + binding.btnTermsAndPolicies.setOnThrottleClickListener { val url = "https://team-hkcc.notion.site/c4f56b4e6e1b46e89c494e5b3919ed8c?pvs=4" openUrlInBrowser(url) } @@ -96,7 +97,7 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ private fun serviceGuidelines() { // 서비스 이용 방법 val role = myPageViewModel.getUserRole() - binding.btnServiceGuidelines.setOnClickListener { + binding.btnServiceGuidelines.setOnThrottleClickListener { val url =when(role){ Role.REVIEWER -> "https://www.notion.so/team-hkcc/c1933575315e4b50aedbdd6b39069d3e?pvs=4" Role.REVIEWEE -> "https://www.notion.so/team-hkcc/5abf8b03763a4f0d90cb2d463f6d46b4?pvs=4" @@ -107,14 +108,14 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ private fun setPrivacyPolicy() { // 개인정보 처리방침 - binding.btnPrivacyPolicy.setOnClickListener { + binding.btnPrivacyPolicy.setOnThrottleClickListener { val url = "https://team-hkcc.notion.site/31a6b7a98d1f4d148bb05cc826d0c9aa?pvs=4" openUrlInBrowser(url) } } private fun setLogoutOnClickListener() { - binding.btnLogout.setOnClickListener { showLgtmDialog() } + binding.btnLogout.setOnThrottleClickListener { showLgtmDialog() } } private fun logout() { @@ -133,13 +134,13 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ private fun setCsCenterOnClickListener() { - binding.btnCustomerCenter.setOnClickListener { + binding.btnCustomerCenter.setOnThrottleClickListener { onPressCsCenter() } } private fun setVersionInfoOnClickListener() { - binding.btnVersionInfo.setOnClickListener { + binding.btnVersionInfo.setOnThrottleClickListener { val playStoreUrl = "https://play.google.com/store/apps/details?id=com.lgtm.android" openUrlInBrowser(playStoreUrl) } diff --git a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/dashboard/DashboardActivity.kt b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/dashboard/DashboardActivity.kt index ac0c818e..ea464edd 100644 --- a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/dashboard/DashboardActivity.kt +++ b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/dashboard/DashboardActivity.kt @@ -11,6 +11,7 @@ import com.google.android.flexbox.FlexboxLayoutManager import com.lgtm.android.common_ui.adapter.ParticipantAdapter import com.lgtm.android.common_ui.adapter.TechTagAdapter import com.lgtm.android.common_ui.base.BaseActivity +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.manage_mission.R import com.lgtm.android.manage_mission.databinding.ActivityDashboardBinding import com.lgtm.android.manage_mission.ping_pong_senior.OnBottomSheetDismiss @@ -87,7 +88,7 @@ class DashboardActivity : BaseActivity(R.layout.activi private fun setBackButtonClickListener() { - binding.ivBack.setOnClickListener { + binding.ivBack.setOnThrottleClickListener { finish() } } diff --git a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/AccountInfoFragment.kt b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/AccountInfoFragment.kt index bb898c64..828197d7 100644 --- a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/AccountInfoFragment.kt +++ b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/AccountInfoFragment.kt @@ -11,6 +11,7 @@ import android.widget.Toast import androidx.fragment.app.activityViewModels import com.lgtm.android.common_ui.R.string import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.manage_mission.R import com.lgtm.android.manage_mission.databinding.FragmentAccountInfoBinding @@ -33,7 +34,7 @@ class AccountInfoFragment : } private fun onClickAccountInfo() { - binding.clAccountInfo.setOnClickListener { + binding.clAccountInfo.setOnThrottleClickListener { try { val clipboard = requireActivity().getSystemService(CLIPBOARD_SERVICE) as ClipboardManager diff --git a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/PingPongJuniorActivity.kt b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/PingPongJuniorActivity.kt index b5ae7da6..94543d6e 100644 --- a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/PingPongJuniorActivity.kt +++ b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/PingPongJuniorActivity.kt @@ -14,6 +14,7 @@ import com.lgtm.android.common_ui.adapter.TechTagAdapter import com.lgtm.android.common_ui.base.BaseActivity import com.lgtm.android.common_ui.ui.LgtmConfirmationDialog import com.lgtm.android.common_ui.util.NetworkState +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.manage_mission.R import com.lgtm.android.manage_mission.databinding.ActivityPingPongJuniorBinding import com.lgtm.domain.constants.ProcessState @@ -75,7 +76,7 @@ class PingPongJuniorActivity : private fun setBackButtonClickListener() { - binding.ivBack.setOnClickListener { + binding.ivBack.setOnThrottleClickListener { finish() } } @@ -142,7 +143,7 @@ class PingPongJuniorActivity : } private fun setBottomButtonClickListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { when (pingPongJuniorViewModel.getMissionStatus()) { ProcessState.WAITING_FOR_PAYMENT -> showCheckDepositDialog() ProcessState.PAYMENT_CONFIRMATION -> {/* disable */ diff --git a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/SubmittedMissionFragment.kt b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/SubmittedMissionFragment.kt index 8119edb7..e31b43c0 100644 --- a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/SubmittedMissionFragment.kt +++ b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/SubmittedMissionFragment.kt @@ -7,6 +7,7 @@ import android.view.View import androidx.fragment.app.activityViewModels import com.lgtm.android.common_ui.R.string import com.lgtm.android.common_ui.base.BaseFragment +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.manage_mission.R import com.lgtm.android.manage_mission.databinding.FragmentSubmittedMissionBinding import com.lgtm.domain.constants.ProcessState @@ -44,7 +45,7 @@ class SubmittedMissionFragment : } private fun onClickSubmittedMission() { - binding.clSubmittedMission.setOnClickListener { + binding.clSubmittedMission.setOnThrottleClickListener { val url = pingPongJuniorViewModel.submittedPrUrl.value val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) startActivity(intent) diff --git a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_senior/PingPongSeniorFragment.kt b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_senior/PingPongSeniorFragment.kt index 39182d8b..d4c702b0 100644 --- a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_senior/PingPongSeniorFragment.kt +++ b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_senior/PingPongSeniorFragment.kt @@ -17,6 +17,7 @@ import com.lgtm.android.common_ui.R.string.deposit_confirm_completed import com.lgtm.android.common_ui.ui.LgtmConfirmationDialog import com.lgtm.android.common_ui.util.EventObserver import com.lgtm.android.common_ui.util.NetworkState +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.manage_mission.dashboard.DashboardViewModel import com.lgtm.android.manage_mission.databinding.FragmentPingPongSeniorBinding import com.lgtm.domain.constants.ProcessState @@ -68,7 +69,7 @@ class PingPongSeniorFragment( private fun onCloseClickListener() { - binding.ivClose.setOnClickListener { + binding.ivClose.setOnThrottleClickListener { dismiss() } } @@ -91,7 +92,7 @@ class PingPongSeniorFragment( } private fun setBottomButtonClickListener() { - binding.btnNext.setOnClickListener { + binding.btnNext.setOnThrottleClickListener { when (dashboardViewModel.getMissionStatus()) { ProcessState.WAITING_FOR_PAYMENT -> {/* disable */ } diff --git a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt index 34fc84df..a8efc012 100644 --- a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt +++ b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt @@ -19,6 +19,7 @@ import com.lgtm.android.common_ui.base.BaseActivity import com.lgtm.android.common_ui.ui.LgtmConfirmationDialog import com.lgtm.android.common_ui.util.NetworkState import com.lgtm.android.common_ui.util.getDrawableCompat +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.mission_detail.databinding.ActivityMissionDetailBinding import com.lgtm.domain.constants.MissionDetailStatus.JUNIOR_NOT_PARTICIPATE_MISSION_FINISH import com.lgtm.domain.constants.MissionDetailStatus.JUNIOR_NOT_PARTICIPATE_RECRUITING @@ -105,19 +106,19 @@ class MissionDetailActivity : } private fun setOnProfileClickListener() { - binding.clReviewerInfo.setOnClickListener { + binding.clReviewerInfo.setOnThrottleClickListener { navigateToProfile() } } private fun setBackButtonClickListener() { - binding.ivBack.setOnClickListener { + binding.ivBack.setOnThrottleClickListener { finish() } } private fun setShareButtonClickListener() { - binding.ivShare.setOnClickListener { + binding.ivShare.setOnThrottleClickListener { val message = missionDetailViewModel.getMissionInfoMessage() val intentShare = Intent(Intent.ACTION_SEND) intentShare.putExtra(Intent.EXTRA_TEXT, intent.getStringExtra(message)) @@ -127,7 +128,7 @@ class MissionDetailActivity : } private fun setMenuButtonClickListener() { - binding.ivMenu.setOnClickListener { + binding.ivMenu.setOnThrottleClickListener { showMenu(it) setDartMenuIcon() } @@ -220,8 +221,8 @@ class MissionDetailActivity : } private fun setOnMissionUrlClickListener() { - binding.clMissionUrl.setOnClickListener { - val url: String = missionDetailViewModel.getMissionUrl() ?: return@setOnClickListener + binding.clMissionUrl.setOnThrottleClickListener { + val url: String = missionDetailViewModel.getMissionUrl() ?: return@setOnThrottleClickListener val intent = Intent(Intent.ACTION_VIEW) intent.data = Uri.parse(url) startActivity(intent) @@ -230,9 +231,9 @@ class MissionDetailActivity : private fun setOnClickBottomButton() { - binding.btnMissionDetail.setOnClickListener { + binding.btnMissionDetail.setOnThrottleClickListener { val missionDetailStatus = - missionDetailViewModel.getMissionDetailStatus() ?: return@setOnClickListener + missionDetailViewModel.getMissionDetailStatus() ?: return@setOnThrottleClickListener when (missionDetailStatus) { JUNIOR_PARTICIPATE_RECRUITING -> navigateJuniorMyMission() JUNIOR_PARTICIPATE_MISSION_FINISH -> navigateJuniorMyMission() diff --git a/feature/profile/src/main/java/com/lgtm/android/profile/ProfileActivity.kt b/feature/profile/src/main/java/com/lgtm/android/profile/ProfileActivity.kt index 01b20158..2473c78b 100644 --- a/feature/profile/src/main/java/com/lgtm/android/profile/ProfileActivity.kt +++ b/feature/profile/src/main/java/com/lgtm/android/profile/ProfileActivity.kt @@ -15,6 +15,7 @@ import com.lgtm.android.common_ui.R.style import com.lgtm.android.common_ui.base.BaseActivity import com.lgtm.android.common_ui.util.ItemDecorationUtil import com.lgtm.android.common_ui.util.getDrawableCompat +import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.profile.adapter.ProfileAdapter import com.lgtm.android.profile.databinding.ActivityProfileBinding import dagger.hilt.android.AndroidEntryPoint @@ -87,20 +88,20 @@ class ProfileActivity : BaseActivity(R.layout.activity_p } private fun setBackButtonClickListener() { - binding.ivBack.setOnClickListener { + binding.ivBack.setOnThrottleClickListener { finish() } } private fun setShareButtonClickListener() { - binding.ivShare.setOnClickListener { + binding.ivShare.setOnThrottleClickListener { // 현재 visibility false // 추후 deeplink 적용 후 공유하기 기능 추가 } } private fun setMenuButtonClickListener() { - binding.ivMenu.setOnClickListener { + binding.ivMenu.setOnThrottleClickListener { showMenu(it) setDartMenuIcon() } From 520e234854015217eee32f6adfb2ebd33357e157 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 16:18:49 +0900 Subject: [PATCH 39/57] =?UTF-8?q?[FEAT]=20=EB=AF=B8=EC=85=98=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=8B=9C=20DueDate=20format=20.=20=EB=8C=80?= =?UTF-8?q?=EC=8B=A0=20-=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 --- .../com/lgtm/android/create_mission/CreateMissionViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionViewModel.kt b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionViewModel.kt index 5c3e4d34..2c76d255 100644 --- a/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionViewModel.kt +++ b/feature/create_mission/src/main/java/com/lgtm/android/create_mission/CreateMissionViewModel.kt @@ -209,7 +209,7 @@ class CreateMissionViewModel @Inject constructor( private fun createPostMissionRequestDTO(): PostMissionRequestDTO { val formattedDate = registrationDueDate.value?.format(isoStyleFormatter) - val tempDate = formattedDate?.substring(0, 10)?.replace("-", ".")// todo 서버 코드 바뀌면 수정 + val date = formattedDate?.substring(0, 10) return PostMissionRequestDTO( description = requireNotNull(description.value), maxPeopleNumber = requireNotNull(numOfRecruits.value), @@ -217,7 +217,7 @@ class CreateMissionViewModel @Inject constructor( notRecommendTo = notRecommendGroup.value, recommendTo = recommendGroup.value, price = requireNotNull(price.value), - registrationDueDate = requireNotNull(tempDate), + registrationDueDate = requireNotNull(date), tagList = requireNotNull(techTagList.value), title = requireNotNull(title.value) ) From 4e206f9618095f5917deb1930817e6a6b206e870 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 16:39:35 +0900 Subject: [PATCH 40/57] =?UTF-8?q?[UI]=20notification=20center=20gray3?= =?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 --- .../{oval_diameter_9_gray_2.xml => oval_diameter_9_gray_3.xml} | 2 +- feature/main/src/main/res/layout/item_notification_center.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename common-ui/src/main/res/drawable/{oval_diameter_9_gray_2.xml => oval_diameter_9_gray_3.xml} (84%) diff --git a/common-ui/src/main/res/drawable/oval_diameter_9_gray_2.xml b/common-ui/src/main/res/drawable/oval_diameter_9_gray_3.xml similarity index 84% rename from common-ui/src/main/res/drawable/oval_diameter_9_gray_2.xml rename to common-ui/src/main/res/drawable/oval_diameter_9_gray_3.xml index e932f697..46722af3 100644 --- a/common-ui/src/main/res/drawable/oval_diameter_9_gray_2.xml +++ b/common-ui/src/main/res/drawable/oval_diameter_9_gray_3.xml @@ -5,5 +5,5 @@ - + diff --git a/feature/main/src/main/res/layout/item_notification_center.xml b/feature/main/src/main/res/layout/item_notification_center.xml index e878c57c..8f712ffc 100644 --- a/feature/main/src/main/res/layout/item_notification_center.xml +++ b/feature/main/src/main/res/layout/item_notification_center.xml @@ -22,7 +22,7 @@ android:layout_height="9dp" android:layout_marginStart="24dp" android:layout_marginTop="30dp" - android:src="@{data.isRead ? @drawable/oval_diameter_9_gray_2 : @drawable/oval_diameter_9_green}" + android:src="@{data.isRead ? @drawable/oval_diameter_9_gray_3 : @drawable/oval_diameter_9_green}" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:src="@drawable/oval_diameter_9_green" /> From e6fe8c65952b71d22d324feb53875ae08445cdf2 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 17:27:15 +0900 Subject: [PATCH 41/57] =?UTF-8?q?[UI]=20=ED=91=B8=EC=8B=9C=EC=95=8C?= =?UTF-8?q?=EB=A6=BC=20=EC=88=98=EC=8B=A0=20=EC=8B=9C=20monochrome=20icon?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95=20(#168)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../android/LGTMFirebaseMessagingService.kt | 4 ++- .../res/drawable/ic_launch_monochrome.xml | 26 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 common-ui/src/main/res/drawable/ic_launch_monochrome.xml diff --git a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt index 041adf09..6b40b41f 100644 --- a/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt +++ b/app/src/main/java/com/lgtm/android/LGTMFirebaseMessagingService.kt @@ -9,6 +9,7 @@ import android.app.TaskStackBuilder import android.content.ContentValues.TAG import android.content.Context import android.content.Intent +import android.graphics.Color import android.util.Log import androidx.core.app.NotificationCompat import com.google.firebase.messaging.FirebaseMessaging @@ -92,7 +93,8 @@ class LGTMFirebaseMessagingService : FirebaseMessagingService(), LgtmMessagingSe ): NotificationCompat.Builder { return NotificationCompat.Builder(this, channelID) .setPriority(NotificationCompat.PRIORITY_HIGH) - .setSmallIcon(R.drawable.ic_launcher_foreground) + .setSmallIcon(R.drawable.ic_launch_monochrome) + .setColor(Color.argb(255, 86, 238, 155)) .setAutoCancel(true) .setContentTitle(title) .setStyle(NotificationCompat.BigTextStyle().bigText(message)) diff --git a/common-ui/src/main/res/drawable/ic_launch_monochrome.xml b/common-ui/src/main/res/drawable/ic_launch_monochrome.xml new file mode 100644 index 00000000..3f17f7e0 --- /dev/null +++ b/common-ui/src/main/res/drawable/ic_launch_monochrome.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + From 07c3326b4a2a71cbe8ec885b2dbf7f37cd74293a Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 21:33:39 +0900 Subject: [PATCH 42/57] =?UTF-8?q?[UI]=20=ED=91=B8=EC=8B=9C=EC=95=8C?= =?UTF-8?q?=EB=A6=BC=20icon=20green=20color=20=EC=A7=80=EC=A0=95=20(#168)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 4 +-- .../android/LGTMFirebaseMessagingService.kt | 6 ++--- .../src/main/res/drawable/ic_launch_mono.xml | 26 +++++++++++++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 common-ui/src/main/res/drawable/ic_launch_mono.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 59cc54c3..773cd401 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -37,8 +37,8 @@ + android:exported="false" + android:windowSoftInputMode="adjustPan" /> + + + + + + + + + + From 2f90f655d376ab37f1c79b719a72e61981e789b4 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 22:21:50 +0900 Subject: [PATCH 43/57] =?UTF-8?q?[FEAT]=20=EB=AF=B8=EC=85=98=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=EC=A1=B0=ED=9A=8C=20/=20=EB=AF=B8=EC=85=98=20URL?= =?UTF-8?q?=EC=9D=B4=20=EC=97=86=EB=8A=94=EA=B2=BD=EC=9A=B0=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20Disable=20(#170)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../drawable/rectangle_gray_2_radius_10.xml | 6 +++ common-ui/src/main/res/values/strings.xml | 1 + .../mission_detail/MissionDetailActivity.kt | 41 +++++++++++++++++-- .../res/layout/activity_mission_detail.xml | 6 +-- 4 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 common-ui/src/main/res/drawable/rectangle_gray_2_radius_10.xml diff --git a/common-ui/src/main/res/drawable/rectangle_gray_2_radius_10.xml b/common-ui/src/main/res/drawable/rectangle_gray_2_radius_10.xml new file mode 100644 index 00000000..69b7f06f --- /dev/null +++ b/common-ui/src/main/res/drawable/rectangle_gray_2_radius_10.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/common-ui/src/main/res/values/strings.xml b/common-ui/src/main/res/values/strings.xml index 710edeaf..ae4914b8 100644 --- a/common-ui/src/main/res/values/strings.xml +++ b/common-ui/src/main/res/values/strings.xml @@ -56,6 +56,7 @@ 참여 인원 신청 기한 새로운 미션 + 리뷰이가 제출한 URL로만 진행되는 미션입니다. diff --git a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt index a8efc012..7daa6536 100644 --- a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt +++ b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailActivity.kt @@ -8,11 +8,16 @@ import android.view.MenuItem import android.view.View import android.widget.Toast import androidx.activity.viewModels +import androidx.appcompat.content.res.AppCompatResources import androidx.appcompat.widget.PopupMenu import com.google.android.flexbox.FlexWrap import com.google.android.flexbox.FlexboxLayoutManager +import com.lgtm.android.common_ui.R.color +import com.lgtm.android.common_ui.R.drawable.rectangle_gray_2_radius_10 +import com.lgtm.android.common_ui.R.drawable.rectangle_green_radius_10 import com.lgtm.android.common_ui.R.id import com.lgtm.android.common_ui.R.string +import com.lgtm.android.common_ui.R.string.proceed_with_url_reviewee_submitted import com.lgtm.android.common_ui.R.style import com.lgtm.android.common_ui.adapter.TechTagAdapter import com.lgtm.android.common_ui.base.BaseActivity @@ -81,13 +86,15 @@ class MissionDetailActivity : private fun observeMissionDetailUiState() { missionDetailViewModel.missionDetailStatus.observe(this) { when (it) { - is NetworkState.Init -> { /* no-op */} + is NetworkState.Init -> { /* no-op */ } + is NetworkState.Success -> { val missionDetailUi = missionDetailViewModel.missionDetailUiState.value missionDetailViewModel.setRecommendToEmptyVisibility() missionDetailViewModel.setNotRecommendToEmptyVisibility() techTagAdapter.submitList(missionDetailUi?.techTagList) binding.profileGlance.data = requireNotNull(missionDetailUi?.memberProfile) + setGithubUrlUI(missionDetailUi?.missionRepositoryUrl) } is NetworkState.Failure -> { @@ -97,6 +104,31 @@ class MissionDetailActivity : } } + private fun setGithubUrlUI(url: String?) { + if (url.isNullOrEmpty()) + setUIForNoUrl() + else setUIForValidUrl(url) + } + + private fun setUIForNoUrl() { + val grayBackground = AppCompatResources.getDrawable(this, rectangle_gray_2_radius_10) + val grayTextColor = getColor(color.gray_4) + binding.clMissionUrl.background = grayBackground + binding.tvMissionUrl.setTextColor(grayTextColor) + binding.tvMissionUrl.text = getString(proceed_with_url_reviewee_submitted) + binding.clMissionUrl.isEnabled = false + binding.ivArrow.visibility = View.GONE + } + + private fun setUIForValidUrl(url: String) { + val greenBackground = AppCompatResources.getDrawable(this, rectangle_green_radius_10) + val grayTextColor = getColor(color.gray_1) + binding.clMissionUrl.background = greenBackground + binding.tvMissionUrl.text = url + binding.tvMissionUrl.setTextColor(grayTextColor) + } + + private fun setupViewModel() { binding.viewModel = missionDetailViewModel } @@ -203,7 +235,9 @@ class MissionDetailActivity : private fun observeDeleteMissionStatus() { missionDetailViewModel.deleteMissionState.observe(this) { when (it) { - is NetworkState.Init -> { /* no-op*/ } + is NetworkState.Init -> { /* no-op*/ + } + is NetworkState.Success -> { showMissionDeleteSuccessToast() finish() @@ -222,7 +256,8 @@ class MissionDetailActivity : private fun setOnMissionUrlClickListener() { binding.clMissionUrl.setOnThrottleClickListener { - val url: String = missionDetailViewModel.getMissionUrl() ?: return@setOnThrottleClickListener + val url: String = + missionDetailViewModel.getMissionUrl() ?: return@setOnThrottleClickListener val intent = Intent(Intent.ACTION_VIEW) intent.data = Uri.parse(url) startActivity(intent) diff --git a/feature/mission_detail/src/main/res/layout/activity_mission_detail.xml b/feature/mission_detail/src/main/res/layout/activity_mission_detail.xml index 41adbb8e..e1812b02 100644 --- a/feature/mission_detail/src/main/res/layout/activity_mission_detail.xml +++ b/feature/mission_detail/src/main/res/layout/activity_mission_detail.xml @@ -164,16 +164,16 @@ android:layout_marginBottom="17dp" android:ellipsize="end" android:maxLines="1" - android:text="@{viewModel.missionDetailUiState.missionRepositoryUrl}" android:textAppearance="@style/Body3M" - android:textColor="@color/gray_1" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tv_mission_url_title" - tools:text="https://github.com/hellokitty-coding-club/LGTM-Android/issues/103" /> + tools:text="https://github.com/hellokitty-coding-club/LGTM-Android/issues/103" + tools:textColor="@color/gray_1" /> Date: Tue, 7 Nov 2023 22:42:04 +0900 Subject: [PATCH 44/57] =?UTF-8?q?[FEAT]=20=EC=83=88=EB=A1=9C=EC=9A=B4=20?= =?UTF-8?q?=EC=95=8C=EB=A6=BC=20=EC=97=AC=EB=B6=80=20=ED=99=95=EC=9D=B8=20?= =?UTF-8?q?/=20=EC=84=9C=EB=B2=84=EC=97=B0=EB=8F=99=20(#172)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datasource/NotificationDatasource.kt | 5 +++++ .../data/model/response/HasNotificationDTO.kt | 5 +++++ .../repository/NotificationRepositoryImpl.kt | 9 +++++++++ .../data/service/NotificationService.kt | 4 ++++ .../repository/NotificationRepository.kt | 1 + .../lgtm/android/main/home/HomeViewModel.kt | 19 ++++++++++++++++++- 6 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 data/src/main/java/com/lgtm/android/data/model/response/HasNotificationDTO.kt diff --git a/data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt b/data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt index 54933b5a..4f109547 100644 --- a/data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt +++ b/data/src/main/java/com/lgtm/android/data/datasource/NotificationDatasource.kt @@ -1,6 +1,7 @@ package com.lgtm.android.data.datasource import com.lgtm.android.data.model.response.BaseDTO +import com.lgtm.android.data.model.response.HasNotificationDTO import com.lgtm.android.data.model.response.NotificationDTO import com.lgtm.android.data.service.NotificationService import javax.inject.Inject @@ -11,4 +12,8 @@ class NotificationDatasource @Inject constructor( suspend fun getNotificationList(): BaseDTO> { return checkResponse(notificationService.getNotificationList()) } + + suspend fun hasNewNotification(): BaseDTO { + return checkResponse(notificationService.hasNewNotification()) + } } \ No newline at end of file diff --git a/data/src/main/java/com/lgtm/android/data/model/response/HasNotificationDTO.kt b/data/src/main/java/com/lgtm/android/data/model/response/HasNotificationDTO.kt new file mode 100644 index 00000000..73ec6b75 --- /dev/null +++ b/data/src/main/java/com/lgtm/android/data/model/response/HasNotificationDTO.kt @@ -0,0 +1,5 @@ +package com.lgtm.android.data.model.response + +data class HasNotificationDTO( + val hasNewNotification: Boolean? +) \ No newline at end of file diff --git a/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt b/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt index d376f24d..56148372 100644 --- a/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt +++ b/data/src/main/java/com/lgtm/android/data/repository/NotificationRepositoryImpl.kt @@ -17,4 +17,13 @@ class NotificationRepositoryImpl @Inject constructor( Result.failure(e) } } + + override suspend fun hasNewNotification(): Result { + return try { + val response = notificationDatasource.hasNewNotification() + Result.success(response.data.hasNewNotification ?: false) + } catch (e: Exception) { + Result.failure(e) + } + } } \ No newline at end of file diff --git a/data/src/main/java/com/lgtm/android/data/service/NotificationService.kt b/data/src/main/java/com/lgtm/android/data/service/NotificationService.kt index 47fd3697..2d591928 100644 --- a/data/src/main/java/com/lgtm/android/data/service/NotificationService.kt +++ b/data/src/main/java/com/lgtm/android/data/service/NotificationService.kt @@ -1,6 +1,7 @@ package com.lgtm.android.data.service import com.lgtm.android.data.model.response.BaseDTO +import com.lgtm.android.data.model.response.HasNotificationDTO import com.lgtm.android.data.model.response.NotificationDTO import retrofit2.Response import retrofit2.http.GET @@ -9,4 +10,7 @@ interface NotificationService { @GET("v1/notification") suspend fun getNotificationList(): Response>> + + @GET("v1/notification/new") + suspend fun hasNewNotification(): Response> } \ No newline at end of file diff --git a/domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt b/domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt index 9cc3d52f..37c662ff 100644 --- a/domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt +++ b/domain/src/main/java/com/lgtm/domain/repository/NotificationRepository.kt @@ -4,4 +4,5 @@ import com.lgtm.domain.entity.response.NotificationVO interface NotificationRepository { suspend fun getNotificationList(): Result> + suspend fun hasNewNotification(): Result } \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt index dc3ddbaf..6a5005a0 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt @@ -11,6 +11,7 @@ import com.lgtm.domain.entity.response.SduiItemVO import com.lgtm.domain.logging.HomeScreenClickScheme import com.lgtm.domain.logging.HomeScreenExposureScheme import com.lgtm.domain.repository.AuthRepository +import com.lgtm.domain.repository.NotificationRepository import com.lgtm.domain.usecase.MissionUseCase import com.swm.logging.android.SWMLogging import com.swm.logging.android.logging_scheme.ClickScheme @@ -22,7 +23,8 @@ import javax.inject.Inject @HiltViewModel class HomeViewModel @Inject constructor( private val useCase: MissionUseCase, - authRepository: AuthRepository + private val notificationRepository: NotificationRepository, + authRepository: AuthRepository, ) : BaseViewModel() { private val role = authRepository.getMemberType() @@ -43,6 +45,21 @@ class HomeViewModel @Inject constructor( } + private val _hasNewNotification = MutableLiveData() + val hasNewNotification: LiveData = _hasNewNotification + + fun hasNewNotification() { + viewModelScope.launch(lgtmErrorHandler) { + notificationRepository.hasNewNotification() + .onSuccess { + _hasNewNotification.postValue(it) + }.onFailure { + Log.e(TAG, "hasNewNotification: ${it.message}") + } + } + } + + fun shotHomeExposureLogging() { val scheme = getHomeExposureLoggingScheme() SWMLogging.logEvent(scheme) From 00221fce4211cf13cb9159af10549126fef941f6 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Tue, 7 Nov 2023 22:42:11 +0900 Subject: [PATCH 45/57] =?UTF-8?q?[FEAT]=20=EC=83=88=EB=A1=9C=EC=9A=B4=20?= =?UTF-8?q?=EC=95=8C=EB=A6=BC=20=EC=97=AC=EB=B6=80=20=ED=99=95=EC=9D=B8=20?= =?UTF-8?q?/=20UI=20(#172)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lgtm/android/main/home/HomeFragment.kt | 22 ++++++++++++++++--- .../src/main/res/layout/fragment_home.xml | 12 ++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt b/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt index f0fe3b0f..3b01c909 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt @@ -29,17 +29,33 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { setUpNotificationClickListener() onClickNewMissionButton() onClickServiceGuideButton() + observeNewNotification() } override fun onResume() { super.onResume() getHomeInfo() + checkNewNotification() } private fun getHomeInfo() { homeViewModel.getHomeInfo() } + private fun checkNewNotification() { + homeViewModel.hasNewNotification() + } + + private fun observeNewNotification() { + homeViewModel.hasNewNotification.observe(viewLifecycleOwner) { + if (it == true) { + binding.ivNewNotification.visibility = View.VISIBLE + } else { + binding.ivNewNotification.visibility = View.GONE + } + } + } + private fun setupViewModel() { binding.viewModel = homeViewModel } @@ -59,7 +75,7 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { lgtmNavigator.navigateToMissionDetail(requireContext(), missionId) } - private fun moveToNotificationCenter(){ + private fun moveToNotificationCenter() { lgtmNavigator.navigateToNotificationCenter(requireContext()) } @@ -76,10 +92,10 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { } } - private fun onClickServiceGuideButton(){ + private fun onClickServiceGuideButton() { val role = homeViewModel.getUserRole() binding.ivServiceGuide.setOnThrottleClickListener { - val url =when(role){ + val url = when (role) { Role.REVIEWER -> "https://www.notion.so/team-hkcc/c1933575315e4b50aedbdd6b39069d3e?pvs=4" Role.REVIEWEE -> "https://www.notion.so/team-hkcc/5abf8b03763a4f0d90cb2d463f6d46b4?pvs=4" } diff --git a/feature/main/src/main/res/layout/fragment_home.xml b/feature/main/src/main/res/layout/fragment_home.xml index dba081cc..ce12a4b9 100644 --- a/feature/main/src/main/res/layout/fragment_home.xml +++ b/feature/main/src/main/res/layout/fragment_home.xml @@ -40,6 +40,18 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + Date: Wed, 8 Nov 2023 02:28:04 +0900 Subject: [PATCH 46/57] =?UTF-8?q?[FEAT]=20Swm-logging=20=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EB=B8=8C=EB=9F=AC=EB=A6=AC=20proguard=20=EC=A0=9C=EC=99=B8?= =?UTF-8?q?=ED=95=AD=EB=AA=A9=20=EC=B6=94=EA=B0=80=20(#156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/proguard-rules.pro | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index fdb33ee8..14cbfc31 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -23,6 +23,7 @@ -keep class * extends com.google.gson.TypeAdapter -keep class com.lgtm.android.data.** { *; } -keep class com.lgtm.domain.** { *; } +-keep class com.swm.logging.android.** { *; } -keep class * implements com.google.gson.TypeAdapterFactory -keep class * implements com.google.gson.JsonSerializer @@ -99,9 +100,9 @@ -keepclassmembers,allowshrinking,allowobfuscation interface * { @retrofit2.http.* ; } - -# Ignore annotation used for build tooling. --dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement +# +## Ignore annotation used for build tooling. +#-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement # Ignore JSR 305 annotations for embedding nullability information. -dontwarn javax.annotation.** From 0e488f66d98d8d87d9fbb6de68fc6c0c8dcc89be Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 8 Nov 2023 02:30:08 +0900 Subject: [PATCH 47/57] =?UTF-8?q?[FEAT]=20Logging=20Scheme=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20=EC=84=9C=EB=B2=84=ED=86=B5=EC=8B=A0=20?= =?UTF-8?q?Rx=20->=20Coroutine=20=EB=B3=80=EA=B2=BD=20(#156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lgtm/android/LGTMApplication.kt | 20 ++++---- .../lgtm/android/main/home/HomeViewModel.kt | 6 +-- swm-logging/build.gradle.kts | 2 + .../com/swm/logging/android/LoggingService.kt | 2 +- .../com/swm/logging/android/SWMLogging.kt | 47 ++++++++++--------- .../logging_scheme/SWMLoggingScheme.kt | 11 +++-- 6 files changed, 50 insertions(+), 38 deletions(-) diff --git a/app/src/main/java/com/lgtm/android/LGTMApplication.kt b/app/src/main/java/com/lgtm/android/LGTMApplication.kt index 7437fb14..67a1aa6e 100644 --- a/app/src/main/java/com/lgtm/android/LGTMApplication.kt +++ b/app/src/main/java/com/lgtm/android/LGTMApplication.kt @@ -4,6 +4,7 @@ import android.app.Application import com.lgtm.android.data.datasource.LgtmPreferenceDataSource import com.swm.logging.android.SWMLogging import dagger.hilt.android.HiltAndroidApp +import java.util.Locale import javax.inject.Inject @HiltAndroidApp @@ -17,18 +18,21 @@ class LGTMApplication : Application() { SWMLogging.init( appVersion = BuildConfig.VERSION_NAME, osNameAndVersion = "$ANDROID ${android.os.Build.VERSION.SDK_INT}", - baseUrl = if (BuildConfig.DEBUG) BuildConfig.LGTM_BASE_URL_DEBUG else BuildConfig.LGTM_BASE_URL_RELEASE, + deviceModel = android.os.Build.MODEL, + baseUrl = if (BuildConfig.IS_DEV) BuildConfig.LGTM_BASE_URL_DEBUG else BuildConfig.LGTM_BASE_URL_RELEASE, serverPath = "v1/log", - token = getAuthToken() + region = Locale.getDefault().toString(), + userID = getUserId() ) } - private fun getAuthToken(): String { - return lgtmPreferenceDataSource.getValue( - preferenceKey = LgtmPreferenceDataSource.Companion.PreferenceKey.ACCESS_TOKEN, - defaultValue = "", - isEncrypted = true - ) + private fun getUserId(): String { + return "123" // todo : get user id from preference +// lgtmPreferenceDataSource.getValue( +// preferenceKey = LgtmPreferenceDataSource.Companion.PreferenceKey.ACCESS_TOKEN, +// defaultValue = "", +// isEncrypted = true +// ) } companion object { diff --git a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt index 6a5005a0..0e07f7ec 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt @@ -75,14 +75,14 @@ class HomeViewModel @Inject constructor( private fun getHomeClickLoggingScheme(): ClickScheme { return HomeScreenClickScheme.Builder() .setAge("-1") - .setTitleName("HomeCard") + .setTitleName("homeMissionClick") .build() } private fun getHomeExposureLoggingScheme(): ExposureScheme { return HomeScreenExposureScheme.Builder() - .setAge("3") - .setTitleName("HomeCard") + .setTitleName("homeMissionClick") + .setAge("-1") .build() } } \ No newline at end of file diff --git a/swm-logging/build.gradle.kts b/swm-logging/build.gradle.kts index 62c40fec..50d08f35 100644 --- a/swm-logging/build.gradle.kts +++ b/swm-logging/build.gradle.kts @@ -22,4 +22,6 @@ dependencies { implementation("io.reactivex.rxjava3:rxandroid:3.0.0") implementation("io.reactivex.rxjava3:rxjava:3.0.6") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1") } diff --git a/swm-logging/src/main/java/com/swm/logging/android/LoggingService.kt b/swm-logging/src/main/java/com/swm/logging/android/LoggingService.kt index 088e3fd0..4acce6aa 100644 --- a/swm-logging/src/main/java/com/swm/logging/android/LoggingService.kt +++ b/swm-logging/src/main/java/com/swm/logging/android/LoggingService.kt @@ -9,7 +9,7 @@ import retrofit2.http.Path interface LoggingService { @POST("{loggingPath}") - fun postLogging( + suspend fun postLogging( @Path("loggingPath", encoded = true) loggingPath: String, @Body loggingScheme: SWMLoggingScheme ): Response diff --git a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt index cc7a575b..ec4286f1 100644 --- a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt +++ b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt @@ -3,11 +3,10 @@ package com.swm.logging.android import com.google.gson.GsonBuilder import com.swm.logging.android.logging_scheme.SWMLoggingScheme import io.reactivex.rxjava3.core.Observer -import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.disposables.Disposable -import io.reactivex.rxjava3.schedulers.Schedulers import io.reactivex.rxjava3.subjects.PublishSubject -import okhttp3.Interceptor +import kotlinx.coroutines.async +import kotlinx.coroutines.runBlocking import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import retrofit2.Response @@ -18,16 +17,16 @@ import java.util.concurrent.TimeUnit object SWMLogging { - - private const val AUTHORIZATION = "Authorization" - private lateinit var appVersion: String private lateinit var OSNameAndVersion: String + private lateinit var deviceModel: String private lateinit var baseUrl: String private lateinit var serverPath: String - private lateinit var accessToken: String + private lateinit var userID: String private lateinit var uuid: UUID + private lateinit var region: String private lateinit var loggingService: LoggingService + private val observable = PublishSubject.create() // 발행 private val observer = object : Observer { // 구독 override fun onSubscribe(d: Disposable) { @@ -36,7 +35,10 @@ object SWMLogging { override fun onNext(value: SWMLoggingScheme) { println("Rx: 아이템 받음: ${value.eventLogName}") - shotLogging(value) + runBlocking { + val result = async { shotLogging(value) } + println("Rx: 로깅 결과: ${result.await()}") + } } override fun onError(e: Throwable) { @@ -53,21 +55,11 @@ object SWMLogging { .connectTimeout(15, TimeUnit.SECONDS) .writeTimeout(20, TimeUnit.SECONDS) .readTimeout(15, TimeUnit.SECONDS) - .addInterceptor(interceptor) .addInterceptor(HttpLoggingInterceptor().apply { level = HttpLoggingInterceptor.Level.BODY }).build() } - private val interceptor: Interceptor = - Interceptor { chain -> - with(chain) { - proceed( - request().newBuilder().addHeader(AUTHORIZATION, accessToken).build() - ) - } - } - private val loggingRetrofit: Retrofit by lazy { Retrofit.Builder() .baseUrl(baseUrl) @@ -80,10 +72,9 @@ object SWMLogging { observable.onNext(swmLoggingScheme) } - private fun shotLogging(swmLoggingScheme: SWMLoggingScheme): Single> { + suspend fun shotLogging(swmLoggingScheme: SWMLoggingScheme): Response { checkInitialized() - return Single.fromCallable { loggingService.postLogging(serverPath, swmLoggingScheme) } - .subscribeOn(Schedulers.io()) + return loggingService.postLogging(serverPath, swmLoggingScheme) } private fun checkInitialized() { @@ -95,16 +86,20 @@ object SWMLogging { fun init( appVersion: String, osNameAndVersion: String, + deviceModel: String, baseUrl: String, serverPath: String, - token: String + region: String, + userID: String, ) { this.appVersion = appVersion this.OSNameAndVersion = osNameAndVersion + this.deviceModel = deviceModel this.baseUrl = baseUrl this.serverPath = serverPath - this.accessToken = token this.uuid = UUID.randomUUID() + this.userID = userID + this.region = region setLoggingService() observable.throttleFirst(500, TimeUnit.MILLISECONDS).subscribe(observer) } @@ -116,4 +111,10 @@ object SWMLogging { fun getOsNameAndVersion(): String { return OSNameAndVersion } + + fun getUUID(): UUID = uuid + fun getAppVersion(): String = appVersion + fun getUserID(): String = userID + fun getRegion(): String = region + fun getDeviceModel(): String = deviceModel } diff --git a/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt b/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt index 46838ed6..d0f71a34 100644 --- a/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt +++ b/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt @@ -5,14 +5,19 @@ import com.swm.logging.android.SWMLogging abstract class SWMLoggingScheme { open lateinit var eventLogName: String open lateinit var screenName: String - open var logVersion: Int = 0 + open lateinit var logVersion: String private val osVersionAndName: String = SWMLogging.getOsNameAndVersion() private var logData: MutableMap? = mutableMapOf() + private val sessionID = SWMLogging.getUUID() + private val userID = SWMLogging.getUserID() + private val deviceModel = SWMLogging.getDeviceModel() + private val appVersion = SWMLogging.getAppVersion() + private val region = SWMLogging.getRegion() fun setLoggingScheme( evenLogName: String, screenName: String, - logVersion: Int, - logData: MutableMap? + logVersion: String, + logData: MutableMap?, ) { this.eventLogName = evenLogName this.screenName = screenName From 3c119556bb55bec2f574a5b356763444097945cf Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 8 Nov 2023 02:59:36 +0900 Subject: [PATCH 48/57] [FEAT] HomeMissionClickLogging (#156) --- .../java/com/lgtm/android/di/NetworkModule.kt | 4 +- .../android/common_ui/adapter/SduiAdapter.kt | 3 +- .../viewholder/SduiItemViewHolder.kt | 6 +-- .../domain/logging/HomeMissionClickScheme.kt | 35 ++++++++++++++++ .../domain/logging/HomeScreenClickScheme.kt | 6 +-- .../logging/HomeScreenExposureScheme.kt | 41 ------------------- .../lgtm/android/main/home/HomeFragment.kt | 19 ++++++++- .../lgtm/android/main/home/HomeViewModel.kt | 29 ++----------- .../com/swm/logging/android/SWMLogging.kt | 2 +- .../logging_scheme/SWMLoggingScheme.kt | 6 +-- 10 files changed, 69 insertions(+), 82 deletions(-) create mode 100644 domain/src/main/java/com/lgtm/domain/logging/HomeMissionClickScheme.kt delete mode 100644 domain/src/main/java/com/lgtm/domain/logging/HomeScreenExposureScheme.kt diff --git a/app/src/main/java/com/lgtm/android/di/NetworkModule.kt b/app/src/main/java/com/lgtm/android/di/NetworkModule.kt index 932a4953..60637166 100644 --- a/app/src/main/java/com/lgtm/android/di/NetworkModule.kt +++ b/app/src/main/java/com/lgtm/android/di/NetworkModule.kt @@ -1,7 +1,7 @@ package com.lgtm.android.di import com.google.gson.GsonBuilder -import com.lgtm.android.BuildConfig.DEBUG +import com.lgtm.android.BuildConfig.IS_DEV import com.lgtm.android.BuildConfig.LGTM_BASE_URL_DEBUG import com.lgtm.android.BuildConfig.LGTM_BASE_URL_RELEASE import com.lgtm.android.data.datasource.LgtmPreferenceDataSource @@ -64,7 +64,7 @@ object NetworkModule { @Singleton fun providesLGTMRetrofit(okHttpClient: OkHttpClient): Retrofit = Retrofit.Builder() - .baseUrl(if (DEBUG) LGTM_BASE_URL_DEBUG else LGTM_BASE_URL_RELEASE) + .baseUrl(if (IS_DEV) LGTM_BASE_URL_DEBUG else LGTM_BASE_URL_RELEASE) .client(okHttpClient) .addConverterFactory( GsonConverterFactory.create( diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/adapter/SduiAdapter.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/adapter/SduiAdapter.kt index 4bfb3aef..08a78446 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/adapter/SduiAdapter.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/adapter/SduiAdapter.kt @@ -7,11 +7,12 @@ import com.lgtm.android.common_ui.viewholder.SduiBaseHolder import com.lgtm.android.common_ui.viewholder.SduiItemViewHolder import com.lgtm.android.common_ui.viewholder.getSduiViewHolder import com.lgtm.domain.entity.response.SduiItemVO +import com.lgtm.domain.server_drive_ui.SduiContent import com.lgtm.domain.server_drive_ui.SduiViewType class SduiAdapter( - private val onMissionClickListener: (Int) -> Unit + private val onMissionClickListener: (SduiContent) -> Unit ) : ListAdapter( ItemDiffCallback(onContentsTheSame = { old, new -> old == new }, onItemsTheSame = { old, new -> old.content == new.content }) diff --git a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SduiItemViewHolder.kt b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SduiItemViewHolder.kt index 28b9a057..d5106dfa 100644 --- a/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SduiItemViewHolder.kt +++ b/common-ui/src/main/java/com/lgtm/android/common_ui/viewholder/SduiItemViewHolder.kt @@ -10,11 +10,11 @@ class SduiItemViewHolder( private val binding: ItemSduiItemBinding ) : SduiBaseHolder(binding) { - private lateinit var navigateToMissionDetail : (Int) -> Unit + private lateinit var navigateToMissionDetail : (SduiContent) -> Unit override fun bind(theme: SduiTheme, viewContent: SduiContent) { binding.data = viewContent as SectionItemVO binding.theme = theme - binding.clMission.setOnThrottleClickListener { navigateToMissionDetail(viewContent.missionId) } + binding.clMission.setOnThrottleClickListener { navigateToMissionDetail(viewContent) } if (viewContent.isScraped != null) { binding.bookmarkButton.isBookmarked = viewContent.isScraped == true @@ -25,7 +25,7 @@ class SduiItemViewHolder( } } - fun setNavigateToMissionDetail(navigateToMissionDetail : (Int) -> Unit) { + fun setNavigateToMissionDetail(navigateToMissionDetail : (SduiContent) -> Unit) { this.navigateToMissionDetail = navigateToMissionDetail } } \ No newline at end of file diff --git a/domain/src/main/java/com/lgtm/domain/logging/HomeMissionClickScheme.kt b/domain/src/main/java/com/lgtm/domain/logging/HomeMissionClickScheme.kt new file mode 100644 index 00000000..665d8199 --- /dev/null +++ b/domain/src/main/java/com/lgtm/domain/logging/HomeMissionClickScheme.kt @@ -0,0 +1,35 @@ +package com.lgtm.domain.logging + +import com.lgtm.domain.server_drive_ui.SduiContent +import com.swm.logging.android.logging_scheme.SWMLoggingScheme + +class HomeMissionClickScheme( + sduiContent: SduiContent, +) : SWMLoggingScheme() { + + init { + setLoggingScheme( + logName = "homeMissionClick", + screenName = "HomeFragment", + logVersion = "1", + logData = mutableMapOf( + "sduiContent" to sduiContent + ) + ) + } + + class Builder { + private lateinit var sduiContent: SduiContent + + fun setMissionContent(sduiContent: SduiContent): Builder { + this.sduiContent = sduiContent + return this + } + + fun build(): HomeMissionClickScheme { + return HomeMissionClickScheme( + sduiContent + ) + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/lgtm/domain/logging/HomeScreenClickScheme.kt b/domain/src/main/java/com/lgtm/domain/logging/HomeScreenClickScheme.kt index 0ce30bd8..550d6593 100644 --- a/domain/src/main/java/com/lgtm/domain/logging/HomeScreenClickScheme.kt +++ b/domain/src/main/java/com/lgtm/domain/logging/HomeScreenClickScheme.kt @@ -9,9 +9,9 @@ class HomeScreenClickScheme( init { setLoggingScheme( - evenLogName = "notificationClick", - screenName = "home", - logVersion = 1, + logName = "notificationClick", + screenName = "HomeFragment", + logVersion = "1", logData = mutableMapOf( "titleName" to titleName, "age" to age diff --git a/domain/src/main/java/com/lgtm/domain/logging/HomeScreenExposureScheme.kt b/domain/src/main/java/com/lgtm/domain/logging/HomeScreenExposureScheme.kt deleted file mode 100644 index 55a03c14..00000000 --- a/domain/src/main/java/com/lgtm/domain/logging/HomeScreenExposureScheme.kt +++ /dev/null @@ -1,41 +0,0 @@ -package com.lgtm.domain.logging - -import com.swm.logging.android.logging_scheme.ExposureScheme - -class HomeScreenExposureScheme( - titleName: String, - age: String -) : ExposureScheme() { - - init { - setLoggingScheme( - evenLogName = "missionClick", - screenName = "home", - logVersion = 1, - logData = mutableMapOf( - "titleName" to titleName, - "age" to age - ) - ) - } - - class Builder { - private lateinit var titleName: String - private lateinit var age: String - fun setTitleName(titleName: String): Builder { - this.titleName = titleName - return this - } - - fun setAge(age: String): Builder { - this.age = age - return this - } - - fun build(): HomeScreenExposureScheme { - return HomeScreenExposureScheme( - titleName, age - ) - } - } -} \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt b/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt index 3b01c909..0250beba 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt @@ -11,6 +11,10 @@ import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.main.R import com.lgtm.android.main.databinding.FragmentHomeBinding import com.lgtm.domain.constants.Role +import com.lgtm.domain.logging.HomeMissionClickScheme +import com.lgtm.domain.server_drive_ui.SduiContent +import com.lgtm.domain.server_drive_ui.SectionItemVO +import com.swm.logging.android.logging_scheme.SWMLoggingScheme import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint @@ -67,10 +71,22 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { } private fun initAdapter() { - commonAdapter = SduiAdapter(::moveToMissionDetail) + commonAdapter = SduiAdapter(::onClickMissionItem) binding.rvSdui.adapter = commonAdapter } + private fun onClickMissionItem(sduiContent: SduiContent) { + val scheme = getHomeExposureLoggingScheme(sduiContent) + homeViewModel.shotHomeExposureLogging(scheme) + moveToMissionDetail((sduiContent as SectionItemVO).missionId) + } + + private fun getHomeExposureLoggingScheme(sduiContent: SduiContent): SWMLoggingScheme { + return HomeMissionClickScheme.Builder() + .setMissionContent(sduiContent) + .build() + } + private fun moveToMissionDetail(missionId: Int) { lgtmNavigator.navigateToMissionDetail(requireContext(), missionId) } @@ -82,7 +98,6 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { private fun submitDataWhenDataChanged() { homeViewModel.sduiList.observe(viewLifecycleOwner) { commonAdapter.submitList(it) - homeViewModel.shotHomeExposureLogging() } } diff --git a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt index 0e07f7ec..d099b0a1 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt @@ -8,14 +8,11 @@ import androidx.lifecycle.viewModelScope import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.domain.constants.Role import com.lgtm.domain.entity.response.SduiItemVO -import com.lgtm.domain.logging.HomeScreenClickScheme -import com.lgtm.domain.logging.HomeScreenExposureScheme import com.lgtm.domain.repository.AuthRepository import com.lgtm.domain.repository.NotificationRepository import com.lgtm.domain.usecase.MissionUseCase import com.swm.logging.android.SWMLogging -import com.swm.logging.android.logging_scheme.ClickScheme -import com.swm.logging.android.logging_scheme.ExposureScheme +import com.swm.logging.android.logging_scheme.SWMLoggingScheme import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import javax.inject.Inject @@ -59,30 +56,10 @@ class HomeViewModel @Inject constructor( } } - - fun shotHomeExposureLogging() { - val scheme = getHomeExposureLoggingScheme() - SWMLogging.logEvent(scheme) + fun shotHomeExposureLogging(swmLoggingScheme: SWMLoggingScheme) { + SWMLogging.logEvent(swmLoggingScheme) } fun getUserRole() = role - fun shotHomeNotificationClickLogging() { - val scheme = getHomeClickLoggingScheme() - SWMLogging.logEvent(scheme) - } - - private fun getHomeClickLoggingScheme(): ClickScheme { - return HomeScreenClickScheme.Builder() - .setAge("-1") - .setTitleName("homeMissionClick") - .build() - } - - private fun getHomeExposureLoggingScheme(): ExposureScheme { - return HomeScreenExposureScheme.Builder() - .setTitleName("homeMissionClick") - .setAge("-1") - .build() - } } \ No newline at end of file diff --git a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt index ec4286f1..4d9b6c73 100644 --- a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt +++ b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt @@ -34,7 +34,7 @@ object SWMLogging { } override fun onNext(value: SWMLoggingScheme) { - println("Rx: 아이템 받음: ${value.eventLogName}") + println("Rx: 아이템 받음: ${value.logName}") runBlocking { val result = async { shotLogging(value) } println("Rx: 로깅 결과: ${result.await()}") diff --git a/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt b/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt index d0f71a34..43bddd81 100644 --- a/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt +++ b/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt @@ -3,7 +3,7 @@ package com.swm.logging.android.logging_scheme import com.swm.logging.android.SWMLogging abstract class SWMLoggingScheme { - open lateinit var eventLogName: String + open lateinit var logName: String open lateinit var screenName: String open lateinit var logVersion: String private val osVersionAndName: String = SWMLogging.getOsNameAndVersion() @@ -14,12 +14,12 @@ abstract class SWMLoggingScheme { private val appVersion = SWMLogging.getAppVersion() private val region = SWMLogging.getRegion() fun setLoggingScheme( - evenLogName: String, + logName: String, screenName: String, logVersion: String, logData: MutableMap?, ) { - this.eventLogName = evenLogName + this.logName = logName this.screenName = screenName this.logVersion = logVersion this.logData = logData From 5ff91a8577269f6cd5f6436e705db8be9c706d29 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 8 Nov 2023 03:04:19 +0900 Subject: [PATCH 49/57] =?UTF-8?q?[FEAT]=20Home=20/=20SduiList=20=EC=9D=98?= =?UTF-8?q?=20SectionItemVO=EC=97=90=20'missionCategory'=ED=95=84=EB=93=9C?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20(#156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/lgtm/domain/server_drive_ui/SectionItemVO.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/domain/src/main/java/com/lgtm/domain/server_drive_ui/SectionItemVO.kt b/domain/src/main/java/com/lgtm/domain/server_drive_ui/SectionItemVO.kt index 7658535f..018e1d11 100644 --- a/domain/src/main/java/com/lgtm/domain/server_drive_ui/SectionItemVO.kt +++ b/domain/src/main/java/com/lgtm/domain/server_drive_ui/SectionItemVO.kt @@ -19,6 +19,7 @@ data class SectionItemVO( val currentPeopleNumber: Int? = null, val maxPeopleNumber: Int? = null, val scrapCount: Int? = null, + val missionCategory : String? = null, @SerializedName("scraped") val isScraped: Boolean? = null, override val viewType: ProfileViewType = SECTION_ITEM_VO From a418571db7cc7b02528ea55fd259d1addea069c0 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 8 Nov 2023 03:31:12 +0900 Subject: [PATCH 50/57] [FEAT] Home / FirstMissionClick Logging (#156) --- .../domain/logging/FirstMissionClickScheme.kt | 43 +++++++++++++++++++ .../domain/logging/HomeMissionClickScheme.kt | 2 +- .../domain/logging/HomeScreenClickScheme.kt | 41 ------------------ .../lgtm/android/main/home/HomeFragment.kt | 26 +++++++++-- .../lgtm/android/main/home/HomeViewModel.kt | 5 ++- .../com/swm/logging/android/SWMLogging.kt | 2 +- .../logging_scheme/SWMLoggingScheme.kt | 6 +-- 7 files changed, 75 insertions(+), 50 deletions(-) create mode 100644 domain/src/main/java/com/lgtm/domain/logging/FirstMissionClickScheme.kt delete mode 100644 domain/src/main/java/com/lgtm/domain/logging/HomeScreenClickScheme.kt diff --git a/domain/src/main/java/com/lgtm/domain/logging/FirstMissionClickScheme.kt b/domain/src/main/java/com/lgtm/domain/logging/FirstMissionClickScheme.kt new file mode 100644 index 00000000..97dc3639 --- /dev/null +++ b/domain/src/main/java/com/lgtm/domain/logging/FirstMissionClickScheme.kt @@ -0,0 +1,43 @@ +package com.lgtm.domain.logging + +import com.swm.logging.android.logging_scheme.ClickScheme + +class FirstMissionClickScheme( + missionId : Int, + spendingTime : Long +) : ClickScheme() { + + init { + setLoggingScheme( + eventLogName = "firstMissionClick", + screenName = "HomeFragment", + logVersion = "1", + logData = mutableMapOf( + "missionId" to missionId, + "spendingTime" to spendingTime + ) + ) + } + + class Builder { + private var missionId : Int = 0 + private var spendingTime : Long = 0 + + fun setMissionId(missionId : Int): Builder { + this.missionId = missionId + return this + } + + fun setSpendingTime(spendingTime : Long): Builder { + this.spendingTime = spendingTime + return this + } + + fun build(): FirstMissionClickScheme { + return FirstMissionClickScheme( + missionId, + spendingTime + ) + } + } +} \ No newline at end of file diff --git a/domain/src/main/java/com/lgtm/domain/logging/HomeMissionClickScheme.kt b/domain/src/main/java/com/lgtm/domain/logging/HomeMissionClickScheme.kt index 665d8199..dd346630 100644 --- a/domain/src/main/java/com/lgtm/domain/logging/HomeMissionClickScheme.kt +++ b/domain/src/main/java/com/lgtm/domain/logging/HomeMissionClickScheme.kt @@ -9,7 +9,7 @@ class HomeMissionClickScheme( init { setLoggingScheme( - logName = "homeMissionClick", + eventLogName = "homeMissionClick", screenName = "HomeFragment", logVersion = "1", logData = mutableMapOf( diff --git a/domain/src/main/java/com/lgtm/domain/logging/HomeScreenClickScheme.kt b/domain/src/main/java/com/lgtm/domain/logging/HomeScreenClickScheme.kt deleted file mode 100644 index 550d6593..00000000 --- a/domain/src/main/java/com/lgtm/domain/logging/HomeScreenClickScheme.kt +++ /dev/null @@ -1,41 +0,0 @@ -package com.lgtm.domain.logging - -import com.swm.logging.android.logging_scheme.ClickScheme - -class HomeScreenClickScheme( - titleName: String, - age: String -) : ClickScheme() { - - init { - setLoggingScheme( - logName = "notificationClick", - screenName = "HomeFragment", - logVersion = "1", - logData = mutableMapOf( - "titleName" to titleName, - "age" to age - ) - ) - } - - class Builder { - private lateinit var titleName: String - private lateinit var age: String - fun setTitleName(titleName: String): Builder { - this.titleName = titleName - return this - } - - fun setAge(age: String): Builder { - this.age = age - return this - } - - fun build(): HomeScreenClickScheme { - return HomeScreenClickScheme( - titleName, age - ) - } - } -} \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt b/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt index 0250beba..e36b6616 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/home/HomeFragment.kt @@ -11,16 +11,21 @@ import com.lgtm.android.common_ui.util.setOnThrottleClickListener import com.lgtm.android.main.R import com.lgtm.android.main.databinding.FragmentHomeBinding import com.lgtm.domain.constants.Role +import com.lgtm.domain.logging.FirstMissionClickScheme import com.lgtm.domain.logging.HomeMissionClickScheme import com.lgtm.domain.server_drive_ui.SduiContent import com.lgtm.domain.server_drive_ui.SectionItemVO import com.swm.logging.android.logging_scheme.SWMLoggingScheme import dagger.hilt.android.AndroidEntryPoint +import kotlin.properties.Delegates @AndroidEntryPoint class HomeFragment : BaseFragment(R.layout.fragment_home) { private val homeViewModel by viewModels() private lateinit var commonAdapter: SduiAdapter + private var isFirstMissionClick = false + private val entryTime = System.currentTimeMillis() + private var firstMissionClickTime by Delegates.notNull() override fun initializeViewModel() { viewModel = homeViewModel @@ -76,12 +81,27 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) { } private fun onClickMissionItem(sduiContent: SduiContent) { - val scheme = getHomeExposureLoggingScheme(sduiContent) - homeViewModel.shotHomeExposureLogging(scheme) + if (!isFirstMissionClick) logFirstMissionClick(sduiContent) + logMissionClick(sduiContent) moveToMissionDetail((sduiContent as SectionItemVO).missionId) } - private fun getHomeExposureLoggingScheme(sduiContent: SduiContent): SWMLoggingScheme { + private fun logFirstMissionClick(sduiContent: SduiContent) { + firstMissionClickTime = System.currentTimeMillis() + isFirstMissionClick = true + val firstMissionClickScheme = FirstMissionClickScheme.Builder() + .setMissionId((sduiContent as SectionItemVO).missionId) + .setSpendingTime(firstMissionClickTime - entryTime) + .build() + homeViewModel.shotFirstMissionClickLogging(firstMissionClickScheme) + } + + private fun logMissionClick(sduiContent: SduiContent) { + val scheme = getHomeMissionClickLoggingScheme(sduiContent) + homeViewModel.shotHomeMissionClickLogging(scheme) + } + + private fun getHomeMissionClickLoggingScheme(sduiContent: SduiContent): SWMLoggingScheme { return HomeMissionClickScheme.Builder() .setMissionContent(sduiContent) .build() diff --git a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt index d099b0a1..a3b5f076 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt @@ -56,10 +56,13 @@ class HomeViewModel @Inject constructor( } } - fun shotHomeExposureLogging(swmLoggingScheme: SWMLoggingScheme) { + fun shotHomeMissionClickLogging(swmLoggingScheme: SWMLoggingScheme) { SWMLogging.logEvent(swmLoggingScheme) } fun getUserRole() = role + fun shotFirstMissionClickLogging(swmLoggingScheme: SWMLoggingScheme) { + SWMLogging.logEvent(swmLoggingScheme) + } } \ No newline at end of file diff --git a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt index 4d9b6c73..ec4286f1 100644 --- a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt +++ b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt @@ -34,7 +34,7 @@ object SWMLogging { } override fun onNext(value: SWMLoggingScheme) { - println("Rx: 아이템 받음: ${value.logName}") + println("Rx: 아이템 받음: ${value.eventLogName}") runBlocking { val result = async { shotLogging(value) } println("Rx: 로깅 결과: ${result.await()}") diff --git a/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt b/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt index 43bddd81..6408a5f6 100644 --- a/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt +++ b/swm-logging/src/main/java/com/swm/logging/android/logging_scheme/SWMLoggingScheme.kt @@ -3,7 +3,7 @@ package com.swm.logging.android.logging_scheme import com.swm.logging.android.SWMLogging abstract class SWMLoggingScheme { - open lateinit var logName: String + open lateinit var eventLogName: String open lateinit var screenName: String open lateinit var logVersion: String private val osVersionAndName: String = SWMLogging.getOsNameAndVersion() @@ -14,12 +14,12 @@ abstract class SWMLoggingScheme { private val appVersion = SWMLogging.getAppVersion() private val region = SWMLogging.getRegion() fun setLoggingScheme( - logName: String, + eventLogName: String, screenName: String, logVersion: String, logData: MutableMap?, ) { - this.logName = logName + this.eventLogName = eventLogName this.screenName = screenName this.logVersion = logVersion this.logData = logData From 55b9baaf96fc1d10d340b5ce55e3de1cb87fe782 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 8 Nov 2023 04:16:11 +0900 Subject: [PATCH 51/57] =?UTF-8?q?[FEAT]=20Login=20/=20=EB=B9=8C=EB=93=9C?= =?UTF-8?q?=20=ED=99=98=EA=B2=BD=20=EB=B6=84=EB=A6=AC=20(#156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/auth/build.gradle.kts | 14 ++++++++++++++ .../android/auth/ui/github/GithubBottomSheet.kt | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/feature/auth/build.gradle.kts b/feature/auth/build.gradle.kts index 44b402c2..0231c67c 100644 --- a/feature/auth/build.gradle.kts +++ b/feature/auth/build.gradle.kts @@ -27,6 +27,20 @@ android { ) } + flavorDimensions += "version" + productFlavors { + create("prod") { + dimension = "version" + buildConfigField("boolean", "IS_PROD", "true") + buildConfigField("boolean", "IS_DEV", "false") + } + create("dev") { + dimension = "version" + buildConfigField("boolean", "IS_PROD", "false") + buildConfigField("boolean", "IS_DEV", "true") + } + } + buildFeatures { buildConfig = true } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt index bdef44d9..8c8c5b47 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/github/GithubBottomSheet.kt @@ -7,7 +7,7 @@ import android.util.Log import android.view.View import android.webkit.CookieManager import com.google.android.material.bottomsheet.BottomSheetDialog -import com.lgtm.android.auth.BuildConfig.DEBUG +import com.lgtm.android.auth.BuildConfig.IS_DEV import com.lgtm.android.auth.BuildConfig.LGTM_BASE_URL_DEBUG import com.lgtm.android.auth.BuildConfig.LGTM_BASE_URL_RELEASE import com.lgtm.android.auth.R @@ -57,6 +57,6 @@ class GithubBottomSheet constructor(private val loginSuccessListener: OnLoginSuc } private fun getGithubLoginUrl() = - (if (DEBUG) LGTM_BASE_URL_DEBUG else LGTM_BASE_URL_RELEASE) + "login/getGithubAuthUrl" + (if (IS_DEV) LGTM_BASE_URL_DEBUG else LGTM_BASE_URL_RELEASE) + "login/getGithubAuthUrl" } From 02d9a596e949dfde7e54cdf9a472140f3c8ac01f Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 8 Nov 2023 04:17:28 +0900 Subject: [PATCH 52/57] =?UTF-8?q?[FEAT]=20SwmLogging=20UserId=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20(#156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lgtm/android/LGTMApplication.kt | 11 ++------ .../datasource/LgtmPreferenceDataSource.kt | 3 ++ .../data/repository/AuthRepositoryImpl.kt | 28 +++++++++++++++++-- .../lgtm/domain/repository/AuthRepository.kt | 4 ++- .../android/auth/ui/signup/SignUpViewModel.kt | 4 +-- .../com/swm/logging/android/SWMLogging.kt | 5 ++++ 6 files changed, 41 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/lgtm/android/LGTMApplication.kt b/app/src/main/java/com/lgtm/android/LGTMApplication.kt index 67a1aa6e..45d192b0 100644 --- a/app/src/main/java/com/lgtm/android/LGTMApplication.kt +++ b/app/src/main/java/com/lgtm/android/LGTMApplication.kt @@ -1,7 +1,7 @@ package com.lgtm.android import android.app.Application -import com.lgtm.android.data.datasource.LgtmPreferenceDataSource +import com.lgtm.domain.repository.AuthRepository import com.swm.logging.android.SWMLogging import dagger.hilt.android.HiltAndroidApp import java.util.Locale @@ -11,7 +11,7 @@ import javax.inject.Inject class LGTMApplication : Application() { @Inject - lateinit var lgtmPreferenceDataSource: LgtmPreferenceDataSource + lateinit var authRepository: AuthRepository override fun onCreate() { super.onCreate() @@ -27,12 +27,7 @@ class LGTMApplication : Application() { } private fun getUserId(): String { - return "123" // todo : get user id from preference -// lgtmPreferenceDataSource.getValue( -// preferenceKey = LgtmPreferenceDataSource.Companion.PreferenceKey.ACCESS_TOKEN, -// defaultValue = "", -// isEncrypted = true -// ) + return authRepository.getMemberId().toString() } companion object { diff --git a/data/src/main/java/com/lgtm/android/data/datasource/LgtmPreferenceDataSource.kt b/data/src/main/java/com/lgtm/android/data/datasource/LgtmPreferenceDataSource.kt index 2c32ccf2..068289ef 100644 --- a/data/src/main/java/com/lgtm/android/data/datasource/LgtmPreferenceDataSource.kt +++ b/data/src/main/java/com/lgtm/android/data/datasource/LgtmPreferenceDataSource.kt @@ -18,6 +18,7 @@ class LgtmPreferenceDataSource @Inject constructor( return when (defaultValue) { is String -> preference.getString(key, defaultValue) as T is Boolean -> preference.getBoolean(key, defaultValue) as T + is Int -> preference.getInt(key, defaultValue) as T else -> throw IllegalArgumentException("Add data type on ${this.javaClass.simpleName}") } } @@ -33,6 +34,7 @@ class LgtmPreferenceDataSource @Inject constructor( when (value) { is String -> preference.edit(byAsync) { putString(key, value) } is Boolean -> preference.edit(byAsync) { putBoolean(key, value) } + is Int -> preference.edit(byAsync) { putInt(key, value) } else -> throw IllegalArgumentException("Add data type on ${this.javaClass.simpleName}") } } @@ -51,6 +53,7 @@ class LgtmPreferenceDataSource @Inject constructor( companion object { enum class PreferenceKey { MEMBER_TYPE, + MEMBER_ID, UNKNOWN_MEMBER_TYPE, ACCESS_TOKEN, REFRESH_TOKEN; diff --git a/data/src/main/java/com/lgtm/android/data/repository/AuthRepositoryImpl.kt b/data/src/main/java/com/lgtm/android/data/repository/AuthRepositoryImpl.kt index eab1cc30..a1bc33ac 100644 --- a/data/src/main/java/com/lgtm/android/data/repository/AuthRepositoryImpl.kt +++ b/data/src/main/java/com/lgtm/android/data/repository/AuthRepositoryImpl.kt @@ -12,24 +12,29 @@ import com.lgtm.domain.entity.response.MemberDataDTO import com.lgtm.domain.entity.response.SignUpResponseVO import com.lgtm.domain.firebase.LgtmMessagingService import com.lgtm.domain.repository.AuthRepository +import com.swm.logging.android.SWMLogging import javax.inject.Inject class AuthRepositoryImpl @Inject constructor( private val lgtmPreferenceDataSource: LgtmPreferenceDataSource, private val authDataSource: AuthDataSource, - private val lgtmFirebaseMessagingService: LgtmMessagingService + private val lgtmFirebaseMessagingService: LgtmMessagingService, ) : AuthRepository { override fun saveUserData(memberData: MemberDataDTO) { saveAccessToken(requireNotNull(memberData.accessToken)) saveRefreshToken(requireNotNull(memberData.refreshToken)) saveMemberType(requireNotNull(memberData.memberType)) + saveMemberId(requireNotNull(memberData.memberId)) + SWMLogging.setUserId(memberData.memberId.toString()) } - override fun saveUserData(signUpResponseVO: SignUpResponseVO, memberType: String?) { + override fun saveUserData(signUpResponseVO: SignUpResponseVO) { saveAccessToken(requireNotNull(signUpResponseVO.accessToken)) saveRefreshToken(requireNotNull(signUpResponseVO.refreshToken)) - saveMemberType(requireNotNull(memberType)) // todo 추후에 SignUpResponseVO에 memberType이 추가되면 변경 + saveMemberType(requireNotNull(signUpResponseVO.memberType)) + saveMemberId(requireNotNull(signUpResponseVO.memberId)) + SWMLogging.setUserId(signUpResponseVO.memberId.toString()) } override fun clearUserData() { @@ -68,6 +73,23 @@ class AuthRepositoryImpl @Inject constructor( ) } + override fun saveMemberId(memberId: Int) { + lgtmPreferenceDataSource.setValue( + preferenceKey = PreferenceKey.MEMBER_ID, + value = memberId, + isEncrypted = true, + byAsync = false + ) + } + + override fun getMemberId(): Int { + return lgtmPreferenceDataSource.getValue( + preferenceKey = PreferenceKey.MEMBER_ID, + defaultValue = -1, + isEncrypted = true + ) + } + override fun getMemberType(): Role { val role = lgtmPreferenceDataSource.getValue( preferenceKey = PreferenceKey.MEMBER_TYPE, diff --git a/domain/src/main/java/com/lgtm/domain/repository/AuthRepository.kt b/domain/src/main/java/com/lgtm/domain/repository/AuthRepository.kt index 9b167dbc..6a6a2261 100644 --- a/domain/src/main/java/com/lgtm/domain/repository/AuthRepository.kt +++ b/domain/src/main/java/com/lgtm/domain/repository/AuthRepository.kt @@ -8,12 +8,14 @@ import com.lgtm.domain.entity.response.SignUpResponseVO interface AuthRepository { fun saveUserData(memberData: MemberDataDTO) - fun saveUserData(signUpResponseVO: SignUpResponseVO, memberType: String?) + fun saveUserData(signUpResponseVO: SignUpResponseVO) fun clearUserData() fun saveAccessToken(accessToken: String) fun saveRefreshToken(refreshToken: String) fun saveMemberType(memberType: String) + fun saveMemberId(memberId: Int) + fun getMemberId(): Int? fun getMemberType(): Role fun isAutoLoginAvailable(): Boolean suspend fun signUpJunior(signUpJuniorVO: SignUpJuniorRequestVO): Result diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt index ab7c4552..49583fa6 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt @@ -386,7 +386,7 @@ class SignUpViewModel @Inject constructor( _signUpState.value = NetworkState.Failure(e.message) return@launch }.onSuccess { - authRepository.saveUserData(it, it.memberType) + authRepository.saveUserData(it) _signUpState.value = NetworkState.Success(it) }.onFailure { val errorMessage = if (it is LgtmResponseException) it.message else "로그인 실패" @@ -404,7 +404,7 @@ class SignUpViewModel @Inject constructor( _signUpState.value = NetworkState.Failure(e.message) return@launch }.onSuccess { - authRepository.saveUserData(it, it.memberType) + authRepository.saveUserData(it) _signUpState.value = NetworkState.Success(it) }.onFailure { val errorMessage = if (it is LgtmResponseException) it.message else "로그인 실패" diff --git a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt index ec4286f1..5d7a202a 100644 --- a/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt +++ b/swm-logging/src/main/java/com/swm/logging/android/SWMLogging.kt @@ -115,6 +115,11 @@ object SWMLogging { fun getUUID(): UUID = uuid fun getAppVersion(): String = appVersion fun getUserID(): String = userID + + /** 앱 실행시에는 로그아웃 상태였지만, 도중 로그아웃을 하는 유저에 한해 사용됨 */ + fun setUserId(userID: String) { + this.userID = userID + } fun getRegion(): String = region fun getDeviceModel(): String = deviceModel } From af94db5f81424d94c72da462c54608011aa76bf8 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 8 Nov 2023 05:20:54 +0900 Subject: [PATCH 53/57] =?UTF-8?q?[FEAT]=20Crashlytics=20Sdk=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20(#175)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 1 + common-ui/build.gradle.kts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index c138ae0c..f6e1d7af 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,6 +15,7 @@ plugins { alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.dagger.hilt) apply false alias(libs.plugins.kotlin.jvm) apply false + alias(libs.plugins.google.services) apply false alias(libs.plugins.crashlytics) apply false alias(libs.plugins.sonarqube) apply false } diff --git a/common-ui/build.gradle.kts b/common-ui/build.gradle.kts index 004c8388..703eabe9 100644 --- a/common-ui/build.gradle.kts +++ b/common-ui/build.gradle.kts @@ -14,6 +14,8 @@ dependencies { api(project(":domain")) api(libs.flexbox) api(libs.glide) + api(platform(libs.firebase)) + api(libs.bundles.firebase) implementation(libs.bundles.androidx.ui.foundation) implementation(libs.constraintlayout) From fab8222d4ca2061333dc0e1a30dc0265f6b03844 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 8 Nov 2023 05:21:28 +0900 Subject: [PATCH 54/57] =?UTF-8?q?[FEAT]=20Crashlytics=20recordException=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20(#175)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/lgtm/android/auth/ui/SignInViewModel.kt | 3 +++ .../com/lgtm/android/auth/ui/signup/SignUpViewModel.kt | 8 ++++++++ .../com/lgtm/android/auth/ui/splash/SplashViewModel.kt | 3 +++ .../main/java/com/lgtm/android/main/home/HomeViewModel.kt | 4 ++++ .../main/notification/NotificationCenterViewModel.kt | 3 +++ .../java/com/lgtm/android/main/setting/MyPageViewModel.kt | 3 +++ .../manage_mission/dashboard/DashboardViewModel.kt | 6 ++++++ .../ping_pong_junior/AccountInfoFragment.kt | 3 +++ .../ping_pong_junior/PingPongJuniorViewModel.kt | 6 ++++++ .../lgtm/android/mission_detail/MissionDetailViewModel.kt | 5 +++++ .../java/com/lgtm/android/profile/ProfileViewModel.kt | 3 +++ 11 files changed, 47 insertions(+) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt index 6e272689..e9574a39 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/SignInViewModel.kt @@ -5,6 +5,8 @@ import android.util.Log import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope +import com.google.firebase.crashlytics.ktx.crashlytics +import com.google.firebase.ktx.Firebase import com.google.gson.Gson import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.android.common_ui.util.NetworkState @@ -77,6 +79,7 @@ class SignInViewModel @Inject constructor( .onSuccess { _patchDeviceTokenState.value = NetworkState.Success(it) }.onFailure { + Firebase.crashlytics.recordException(it) val errorMessage = if (it is LgtmResponseException) it.message else "푸시 알림 설정 실패" _patchDeviceTokenState.value = NetworkState.Failure(errorMessage) diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt index 49583fa6..ae3ad35e 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/signup/SignUpViewModel.kt @@ -3,6 +3,8 @@ package com.lgtm.android.auth.ui.signup import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope +import com.google.firebase.crashlytics.ktx.crashlytics +import com.google.firebase.ktx.Firebase import com.google.gson.Gson import com.lgtm.android.auth.exception.SignUpFailedException import com.lgtm.android.common_ui.base.BaseViewModel @@ -346,6 +348,7 @@ class SignUpViewModel @Inject constructor( isAgreeWithEventInfo = isAgreeWithEventInfo.value ?: false, ) } catch (e: IllegalArgumentException) { + Firebase.crashlytics.recordException(e) throw SignUpFailedException("입력되지 않은 항목이 있습니다") } } @@ -369,6 +372,7 @@ class SignUpViewModel @Inject constructor( accountHolderName = requireNotNull(accountHolder.value).trim(), ) } catch (e: IllegalArgumentException) { + Firebase.crashlytics.recordException(e) throw SignUpFailedException("입력되지 않은 항목이 있습니다") } } @@ -383,12 +387,14 @@ class SignUpViewModel @Inject constructor( val signUpJuniorRequestVO = createSignUpJuniorRequestVO() authRepository.signUpJunior(signUpJuniorRequestVO) } catch (e: SignUpFailedException) { + Firebase.crashlytics.recordException(e) _signUpState.value = NetworkState.Failure(e.message) return@launch }.onSuccess { authRepository.saveUserData(it) _signUpState.value = NetworkState.Success(it) }.onFailure { + Firebase.crashlytics.recordException(it) val errorMessage = if (it is LgtmResponseException) it.message else "로그인 실패" _signUpState.value = NetworkState.Failure(errorMessage) } @@ -401,12 +407,14 @@ class SignUpViewModel @Inject constructor( val signUpSeniorRequestVO = createSignUpSeniorRequestVO() authRepository.signUpSenior(signUpSeniorRequestVO) } catch (e: SignUpFailedException) { + Firebase.crashlytics.recordException(e) _signUpState.value = NetworkState.Failure(e.message) return@launch }.onSuccess { authRepository.saveUserData(it) _signUpState.value = NetworkState.Success(it) }.onFailure { + Firebase.crashlytics.recordException(it) val errorMessage = if (it is LgtmResponseException) it.message else "로그인 실패" _signUpState.value = NetworkState.Failure(errorMessage) } diff --git a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt index 4a64b2a0..e2869268 100644 --- a/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt +++ b/feature/auth/src/main/java/com/lgtm/android/auth/ui/splash/SplashViewModel.kt @@ -5,6 +5,8 @@ import android.util.Log import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope +import com.google.firebase.crashlytics.ktx.crashlytics +import com.google.firebase.ktx.Firebase import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.domain.repository.AuthRepository import com.lgtm.domain.repository.IntroRepository @@ -30,6 +32,7 @@ class SplashViewModel @Inject constructor( _minVersion.value = it.minVersion _latestVersion.value = it.latestVersion }.onFailure { + Firebase.crashlytics.recordException(it) Log.d(TAG, "getAppVersionInfo: $it") } } diff --git a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt index a3b5f076..ff15775f 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/home/HomeViewModel.kt @@ -5,6 +5,8 @@ import android.util.Log import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope +import com.google.firebase.crashlytics.ktx.crashlytics +import com.google.firebase.ktx.Firebase import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.domain.constants.Role import com.lgtm.domain.entity.response.SduiItemVO @@ -36,6 +38,7 @@ class HomeViewModel @Inject constructor( .onSuccess { _sduiList.postValue(it.contents) }.onFailure { + Firebase.crashlytics.recordException(it) Log.e(TAG, "getHomeInfo: ${it.message}") } } @@ -51,6 +54,7 @@ class HomeViewModel @Inject constructor( .onSuccess { _hasNewNotification.postValue(it) }.onFailure { + Firebase.crashlytics.recordException(it) Log.e(TAG, "hasNewNotification: ${it.message}") } } diff --git a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt index 64ae6c15..6b46445d 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/notification/NotificationCenterViewModel.kt @@ -5,6 +5,8 @@ import android.util.Log import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope +import com.google.firebase.crashlytics.ktx.crashlytics +import com.google.firebase.ktx.Firebase import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.domain.entity.response.NotificationVO import com.lgtm.domain.repository.NotificationRepository @@ -25,6 +27,7 @@ class NotificationCenterViewModel @Inject constructor( .onSuccess { _notificationList.postValue(it) }.onFailure { + Firebase.crashlytics.recordException(it) Log.e(TAG, "getNotificationList: $it") } } diff --git a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageViewModel.kt b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageViewModel.kt index a39263ca..d3f23e69 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageViewModel.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageViewModel.kt @@ -4,6 +4,8 @@ import android.content.ContentValues.TAG import android.util.Log import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope +import com.google.firebase.crashlytics.ktx.crashlytics +import com.google.firebase.ktx.Firebase import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.android.common_ui.model.ProfileGlanceUI import com.lgtm.android.common_ui.model.mapper.toUiModel @@ -32,6 +34,7 @@ class MyPageViewModel @Inject constructor( .onSuccess { _profileInfo.postValue(it.toUiModel(requireNotNull(it.memberType))) }.onFailure { + Firebase.crashlytics.recordException(it) Log.e(TAG, "getProfileInfo: $it") } } diff --git a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/dashboard/DashboardViewModel.kt b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/dashboard/DashboardViewModel.kt index 49e6f016..bf296edf 100644 --- a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/dashboard/DashboardViewModel.kt +++ b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/dashboard/DashboardViewModel.kt @@ -5,6 +5,8 @@ import android.util.Log import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope +import com.google.firebase.crashlytics.ktx.crashlytics +import com.google.firebase.ktx.Firebase import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.android.common_ui.model.DashboardUI import com.lgtm.android.common_ui.model.MissionProcessInfoUI @@ -34,6 +36,7 @@ class DashboardViewModel @Inject constructor( _dashboardInfo.postValue(it.toUiModel()) Log.d(TAG, "fetchMissionInfo: $it") }.onFailure { + Firebase.crashlytics.recordException(it) Log.e(TAG, "fetchMissionInfo: $it") } } @@ -57,6 +60,7 @@ class DashboardViewModel @Inject constructor( _pingPongSeniorState.postValue(NetworkState.Success(it)) Log.d(TAG, "fetchPingPongSeniorVO: $it") }.onFailure { + Firebase.crashlytics.recordException(it) Log.e(TAG, "fetchPingPongSeniorVO: $it") } } @@ -83,6 +87,7 @@ class DashboardViewModel @Inject constructor( _confirmDepositStatus.postValue(Event(NetworkState.Success(""))) Log.d(TAG, "confirmDepositCompleted: $it") }.onFailure { + Firebase.crashlytics.recordException(it) _confirmDepositStatus.postValue(Event(NetworkState.Failure(it.message))) Log.e(TAG, "confirmDepositCompleted: $it") } @@ -104,6 +109,7 @@ class DashboardViewModel @Inject constructor( _codeReviewCompletedStatus.postValue(Event(NetworkState.Success(""))) Log.d(TAG, "codeReviewCompleted: $it") }.onFailure { + Firebase.crashlytics.recordException(it) _codeReviewCompletedStatus.postValue(Event(NetworkState.Failure(it.message))) Log.e(TAG, "codeReviewCompleted: $it") } diff --git a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/AccountInfoFragment.kt b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/AccountInfoFragment.kt index 828197d7..3ef8c717 100644 --- a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/AccountInfoFragment.kt +++ b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/AccountInfoFragment.kt @@ -9,6 +9,8 @@ import android.util.Log import android.view.View import android.widget.Toast import androidx.fragment.app.activityViewModels +import com.google.firebase.crashlytics.ktx.crashlytics +import com.google.firebase.ktx.Firebase import com.lgtm.android.common_ui.R.string import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.util.setOnThrottleClickListener @@ -43,6 +45,7 @@ class AccountInfoFragment : Toast.makeText(requireContext(), getString(string.copied), Toast.LENGTH_SHORT) .show() } catch (e: Exception) { + Firebase.crashlytics.recordException(e) Log.e(TAG, "onClickAccountInfo: 계좌정보 클립보드 복사 실패") } } diff --git a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/PingPongJuniorViewModel.kt b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/PingPongJuniorViewModel.kt index 75960213..d73a2b64 100644 --- a/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/PingPongJuniorViewModel.kt +++ b/feature/manage_mission/src/main/java/com/lgtm/android/manage_mission/ping_pong_junior/PingPongJuniorViewModel.kt @@ -5,6 +5,8 @@ import android.util.Log import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope +import com.google.firebase.crashlytics.ktx.crashlytics +import com.google.firebase.ktx.Firebase import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.android.common_ui.constant.InfoType import com.lgtm.android.common_ui.model.EditTextData @@ -44,6 +46,7 @@ class PingPongJuniorViewModel @Inject constructor( getOgImageIfNeeded() Log.d(TAG, "fetchJuniorMissionStatus: $it") }.onFailure { + Firebase.crashlytics.recordException(it) _fetchMissionStatusState.postValue(NetworkState.Failure(it.message)) Log.e(TAG, "fetchJuniorMissionStatus: $it") } @@ -71,6 +74,7 @@ class PingPongJuniorViewModel @Inject constructor( _ogImageUrl.value = it Log.d(TAG, "getOgImage: $it") }.onFailure { + Firebase.crashlytics.recordException(it) Log.e(TAG, "getOgImage: $it") } } @@ -110,6 +114,7 @@ class PingPongJuniorViewModel @Inject constructor( _moveToNextProcessState.postValue(NetworkState.Success(it)) Log.d(TAG, "confirmJuniorPayment: $it") }.onFailure { + Firebase.crashlytics.recordException(it) _moveToNextProcessState.postValue(NetworkState.Failure(it.message)) Log.e(TAG, "confirmJuniorPayment: $it") } @@ -163,6 +168,7 @@ class PingPongJuniorViewModel @Inject constructor( .onSuccess { _moveToNextProcessState.postValue(NetworkState.Success(it)) }.onFailure { + Firebase.crashlytics.recordException(it) _moveToNextProcessState.postValue(NetworkState.Failure(it.message)) Log.e(TAG, "requestCodeReview: $it") } diff --git a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailViewModel.kt b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailViewModel.kt index 9043d95b..fa3a8efb 100644 --- a/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailViewModel.kt +++ b/feature/mission_detail/src/main/java/com/lgtm/android/mission_detail/MissionDetailViewModel.kt @@ -5,6 +5,8 @@ import android.util.Log import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope +import com.google.firebase.crashlytics.ktx.crashlytics +import com.google.firebase.ktx.Firebase import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.android.common_ui.model.MissionDetailUI import com.lgtm.android.common_ui.model.mapper.toUiModel @@ -84,6 +86,7 @@ class MissionDetailViewModel @Inject constructor( _missionDetailUiState.postValue(it.toUiModel()) _missionDetailStatus.postValue(NetworkState.Success(true)) }.onFailure { + Firebase.crashlytics.recordException(it) _missionDetailStatus.postValue(NetworkState.Failure(it.message)) Log.e(TAG, "getMissionDetail: $it") } @@ -97,6 +100,7 @@ class MissionDetailViewModel @Inject constructor( .onSuccess { _participateMissionUiState.postValue(NetworkState.Success(it)) }.onFailure { + Firebase.crashlytics.recordException(it) _participateMissionUiState.postValue(NetworkState.Failure(it.message)) } } @@ -110,6 +114,7 @@ class MissionDetailViewModel @Inject constructor( .onSuccess { _deleteMissionState.postValue(NetworkState.Success(it)) }.onFailure { + Firebase.crashlytics.recordException(it) _deleteMissionState.postValue(NetworkState.Failure(it.message)) } } diff --git a/feature/profile/src/main/java/com/lgtm/android/profile/ProfileViewModel.kt b/feature/profile/src/main/java/com/lgtm/android/profile/ProfileViewModel.kt index cfd9973f..c19c9ab8 100644 --- a/feature/profile/src/main/java/com/lgtm/android/profile/ProfileViewModel.kt +++ b/feature/profile/src/main/java/com/lgtm/android/profile/ProfileViewModel.kt @@ -5,6 +5,8 @@ import android.util.Log import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope +import com.google.firebase.crashlytics.ktx.crashlytics +import com.google.firebase.ktx.Firebase import com.lgtm.android.common_ui.base.BaseViewModel import com.lgtm.domain.profile.Profile import com.lgtm.domain.profile.profileViewType.ProfileGlance @@ -46,6 +48,7 @@ class ProfileViewModel @Inject constructor( _isMyProfile.postValue((it[0] as ProfileImage).isMyProfile) Log.d(TAG, "fetchProfileInfo: $it") }.onFailure { + Firebase.crashlytics.recordException(it) Log.e(TAG, "fetchProfileInfo: $it") } } From 75c519096ae40d26ab9ec4e612bed15356a52505 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 8 Nov 2023 05:44:18 +0900 Subject: [PATCH 55/57] [DOCS] Update README.md --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c97accfa..045de3ba 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ # 미션 기반 코드리뷰 매칭 플랫폼, LGTM -**'LGTM'은 SW 마에스트로 14기 프로젝트입니다.** +## 📌 Introduction -해당 `LGTM-Android` Repository는 **[@kxxhyorim](https://github.com/KxxHyoRim)** 1인 개발로 이루어지고 있습니다. (팀 구성 = 백엔드 2명, 안드로이드 1명) +- [**LGTM이 궁금하시다면 Google Play로!**](https://play.google.com/store/apps/details?id=com.lgtm.android) -![image](https://github.com/hellokitty-coding-club/LGTM-Android/assets/59546818/4cff9177-ac15-4ddf-9a74-3a0654c8a502) +- 본 서비스는 SW마에스트로 14기 프로젝트입니다:) + + +| | | | +| -- | -- | -- | +|![image](https://github.com/hellokitty-coding-club/LGTM-Android/assets/59546818/b1110a0c-35fc-4896-9d73-b2a3a197e205)| ![image](https://github.com/hellokitty-coding-club/LGTM-Android/assets/59546818/7baf51cc-8666-42e6-94b0-1952bfc02d98) | ![image](https://github.com/hellokitty-coding-club/LGTM-Android/assets/59546818/7d26d84b-3aef-4187-bc79-d7505a9b866e) | From d534e437fd7090afadb4e8434328fe80084a3565 Mon Sep 17 00:00:00 2001 From: kxxhyorim Date: Wed, 8 Nov 2023 06:23:43 +0900 Subject: [PATCH 56/57] =?UTF-8?q?[FEAT]=20=EB=B2=84=EC=A0=84=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=84=B8=ED=8C=85=20(#177)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common-ui/src/main/res/values/strings.xml | 5 +++- feature/main/build.gradle.kts | 7 +++++ .../android/main/setting/MyPageFragment.kt | 30 +++++++++++++++++-- .../src/main/res/layout/fragment_my_page.xml | 4 +-- 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/common-ui/src/main/res/values/strings.xml b/common-ui/src/main/res/values/strings.xml index ae4914b8..fe7986e1 100644 --- a/common-ui/src/main/res/values/strings.xml +++ b/common-ui/src/main/res/values/strings.xml @@ -119,7 +119,7 @@ 내 활동 서비스 정보 hkcc.swm.official@gmail.com - 현재 버전 1.0.0 + 현재 버전 최신 버전 설정 소속 @@ -187,5 +187,8 @@ 알림 아직 알림이 없습니다. 미션을 시작해 보세요! + 미확인 + 업데이트 + 최신 버전 \ No newline at end of file diff --git a/feature/main/build.gradle.kts b/feature/main/build.gradle.kts index 36a1348a..7563ff89 100644 --- a/feature/main/build.gradle.kts +++ b/feature/main/build.gradle.kts @@ -12,6 +12,12 @@ android { buildFeatures { buildConfig = true } + + defaultConfig { + buildConfigField( + "String", "versionName", "\"${libs.versions.appVersion.get()}\"" + ) + } } dependencies { @@ -27,5 +33,6 @@ dependencies { implementation(libs.constraintlayout) implementation(libs.hilt) implementation(libs.bundles.navigation) + implementation(libs.inappupdate) kapt(libs.hilt.kapt) } \ No newline at end of file diff --git a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt index 26c72ff2..20e96908 100644 --- a/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt +++ b/feature/main/src/main/java/com/lgtm/android/main/setting/MyPageFragment.kt @@ -9,10 +9,15 @@ import android.os.Bundle import android.view.View import android.widget.Toast import androidx.fragment.app.viewModels +import com.google.android.play.core.appupdate.AppUpdateManagerFactory +import com.google.android.play.core.install.model.UpdateAvailability import com.lgtm.android.common_ui.R.string +import com.lgtm.android.common_ui.R.string.latest_version +import com.lgtm.android.common_ui.R.string.update import com.lgtm.android.common_ui.base.BaseFragment import com.lgtm.android.common_ui.ui.LgtmConfirmationDialog import com.lgtm.android.common_ui.util.setOnThrottleClickListener +import com.lgtm.android.main.BuildConfig import com.lgtm.android.main.R import com.lgtm.android.main.databinding.FragmentMyPageBinding import com.lgtm.domain.constants.Role @@ -39,6 +44,7 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ setVersionInfoOnClickListener() fetchProfileData() setOnProfileClickListener() + setVersionInfo() } override fun onResume() { @@ -81,7 +87,8 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ private fun setNoticeOnClickListener() { // 공지사항 binding.btnNotice.setOnThrottleClickListener { - val url = "https://team-hkcc.notion.site/4823db3b781e40fdadd0cf61093c5158?v=3cee323345414e318192b89bfe7dd2d0&pvs=4" + val url = + "https://team-hkcc.notion.site/4823db3b781e40fdadd0cf61093c5158?v=3cee323345414e318192b89bfe7dd2d0&pvs=4" openUrlInBrowser(url) } } @@ -98,7 +105,7 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ // 서비스 이용 방법 val role = myPageViewModel.getUserRole() binding.btnServiceGuidelines.setOnThrottleClickListener { - val url =when(role){ + val url = when (role) { Role.REVIEWER -> "https://www.notion.so/team-hkcc/c1933575315e4b50aedbdd6b39069d3e?pvs=4" Role.REVIEWEE -> "https://www.notion.so/team-hkcc/5abf8b03763a4f0d90cb2d463f6d46b4?pvs=4" } @@ -179,4 +186,23 @@ class MyPageFragment : BaseFragment(R.layout.fragment_my_ lgtmNavigator.navigateToProfile(requireContext()) } + private fun setVersionInfo() { + val currentVersion = getString(string.current_version) + " " + BuildConfig.versionName + binding.tvCurrentVersion.text = currentVersion + setVersionStatus() + } + + private fun setVersionStatus() { + val appUpdateManager = AppUpdateManagerFactory.create(requireContext()) + val appUpdateInfoTask = appUpdateManager.appUpdateInfo + appUpdateInfoTask.addOnSuccessListener { appUpdateInfo -> + if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE) { + binding.tvVersionInfo.text = getString(update) + } else { + binding.tvVersionInfo.text = getString(latest_version) + } + }.addOnFailureListener { _ -> + binding.tvVersionInfo.text = getString(string.unchecked) + } + } } \ No newline at end of file diff --git a/feature/main/src/main/res/layout/fragment_my_page.xml b/feature/main/src/main/res/layout/fragment_my_page.xml index f1cee9a3..099bb604 100644 --- a/feature/main/src/main/res/layout/fragment_my_page.xml +++ b/feature/main/src/main/res/layout/fragment_my_page.xml @@ -389,24 +389,22 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - Date: Wed, 8 Nov 2023 06:25:11 +0900 Subject: [PATCH 57/57] [FEAT] update version v1.0.0 -> v1.1.0 (#178) --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1c63ef89..57dce658 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,8 +3,8 @@ compileSdk = "33" minSdk = "26" targetSdk = "33" -appVersion = "1.0.0" -versionCode = "100" +appVersion = "1.1.0" +versionCode = "110" # Kotlin and Serialization kotlin = "1.7.20"