From fded4fff5d039268eade3d424f577d4e4aee3173 Mon Sep 17 00:00:00 2001 From: a1rhun <83606547+a1rhun@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:54:47 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20#211=20=EB=B3=B4=EC=8A=A4=ED=86=A1=20?= =?UTF-8?q?=ED=83=88=ED=87=B4=20=ED=9A=8C=EC=9B=90=20=EC=A4=91=EC=95=99?= =?UTF-8?q?=EC=A0=95=EB=A0=AC=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ui/auth/login/LoginActivity.kt | 2 +- .../boss_talk/body/BossTalkBodyActivity.kt | 13 ++++++++++--- .../body/adapter/rvAdapterCommentBoss.kt | 15 +++++++++++++++ .../body/adapter/rvAdapterRecommentBoss.kt | 15 +++++++++++++++ .../notification_setting/NotificationFragment.kt | 5 +++++ .../NotificationSettingViewModel.kt | 9 +++++++++ .../main/res/layout/activity_teachertalk_body.xml | 6 ++++-- 7 files changed, 59 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/company/teacherforboss/presentation/ui/auth/login/LoginActivity.kt b/app/src/main/java/com/company/teacherforboss/presentation/ui/auth/login/LoginActivity.kt index ebccb318..183628f4 100644 --- a/app/src/main/java/com/company/teacherforboss/presentation/ui/auth/login/LoginActivity.kt +++ b/app/src/main/java/com/company/teacherforboss/presentation/ui/auth/login/LoginActivity.kt @@ -89,7 +89,7 @@ class LoginActivity: BindingActivity(R.layout.activity_log //기본 로그인 val token=loginViewModel.getAcessToken() - if (!token.isNullOrBlank() && localDataSource.getUserInfo(USER_ROLE) != TEACHER_RV) { gotoMainActivity() } + //if (!token.isNullOrBlank() && localDataSource.getUserInfo(USER_ROLE) != TEACHER_RV) { gotoMainActivity() } // 소셜 로그인 lifecycleScope.launch { diff --git a/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/BossTalkBodyActivity.kt b/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/BossTalkBodyActivity.kt index 131ff883..c9b009c9 100644 --- a/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/BossTalkBodyActivity.kt +++ b/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/BossTalkBodyActivity.kt @@ -11,6 +11,7 @@ import android.view.View import android.view.inputmethod.InputMethodManager import androidx.activity.OnBackPressedCallback import androidx.activity.viewModels +import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat import androidx.lifecycle.Observer import androidx.lifecycle.lifecycleScope @@ -310,9 +311,14 @@ class BossTalkBodyActivity : BindingActivity(R.layo if (body.memberInfo.toMemberDto().memberId == 0L) { userNickname.text = getString(R.string.nickname_none) - userLevel.visibility = View.INVISIBLE - profileLevel.visibility = View.INVISIBLE - date.visibility= View.INVISIBLE + userLevel.visibility = View.GONE + profileLevel.visibility = View.GONE + date.visibility= View.GONE + + val params = userNickname.layoutParams as ConstraintLayout.LayoutParams + params.topToTop = profileImage.id + params.bottomToBottom = profileImage.id + userNickname.layoutParams = params profileImage.load(rvAdapterCommentBoss.IMG_BASE_URL + "profile_cat_owner.png") @@ -332,6 +338,7 @@ class BossTalkBodyActivity : BindingActivity(R.layo userLevel.visibility = View.VISIBLE profileLevel.visibility = View.VISIBLE + body.memberInfo.toMemberDto().profileImg?.let { binding.profileImage.loadProfileImgFromUrlCoil(it) } diff --git a/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/adapter/rvAdapterCommentBoss.kt b/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/adapter/rvAdapterCommentBoss.kt index 4b94d9a4..696b1d44 100644 --- a/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/adapter/rvAdapterCommentBoss.kt +++ b/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/adapter/rvAdapterCommentBoss.kt @@ -10,6 +10,7 @@ import android.view.LayoutInflater import android.view.MotionEvent import android.view.View import android.view.ViewGroup +import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat import androidx.fragment.app.FragmentActivity import androidx.lifecycle.LifecycleOwner @@ -72,8 +73,22 @@ class rvAdapterCommentBoss( if(member?.memberId == 0L) { binding.userName.text = context.getString(R.string.nickname_none) + binding.userLevel.visibility = View.GONE + binding.profileLevel.visibility = View.GONE + + val params = binding.userName.layoutParams as ConstraintLayout.LayoutParams + params.topToTop = binding.userImage.id + params.bottomToBottom = binding.userImage.id + binding.userName.layoutParams = params } else { + binding.userLevel.visibility = View.VISIBLE + binding.profileLevel.visibility = View.VISIBLE + + val params = binding.userName.layoutParams as ConstraintLayout.LayoutParams + params.topToTop = binding.userImage.id + params.bottomToBottom = ConstraintLayout.LayoutParams.UNSET + binding.userName.layoutParams = params if (member?.role == TEACHER) binding.userName.text = context.getString(R.string.boss_talk_nickname_teacher, member.name) else if (member?.role == BOSS) diff --git a/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/adapter/rvAdapterRecommentBoss.kt b/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/adapter/rvAdapterRecommentBoss.kt index 5c141fb6..4e72509d 100644 --- a/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/adapter/rvAdapterRecommentBoss.kt +++ b/app/src/main/java/com/company/teacherforboss/presentation/ui/community/boss_talk/body/adapter/rvAdapterRecommentBoss.kt @@ -8,6 +8,7 @@ import android.view.LayoutInflater import android.view.MotionEvent import android.view.View import android.view.ViewGroup +import androidx.constraintlayout.widget.ConstraintLayout import androidx.fragment.app.FragmentActivity import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.Observer @@ -65,8 +66,22 @@ class rvAdapterRecommentBoss( profileLevel.visibility = View.GONE createdAt.visibility = View.GONE + val params = binding.userName.layoutParams as ConstraintLayout.LayoutParams + params.topToTop = binding.userImage.id + params.bottomToBottom = binding.userImage.id + binding.userName.layoutParams = params + userImage.load(rvAdapterCommentBoss.IMG_BASE_URL + "profile_cat_owner.png") } else { + + binding.userLevel.visibility = View.VISIBLE + binding.profileLevel.visibility = View.VISIBLE + + val params = binding.userName.layoutParams as ConstraintLayout.LayoutParams + params.topToTop = binding.userImage.id + params.bottomToBottom = ConstraintLayout.LayoutParams.UNSET + binding.userName.layoutParams = params + member?.profileImg?.let { if (it.isNotEmpty()) { binding.userImage.loadProfileImgFromUrlCoil(it) } diff --git a/app/src/main/java/com/company/teacherforboss/presentation/ui/mypage/notification_setting/NotificationFragment.kt b/app/src/main/java/com/company/teacherforboss/presentation/ui/mypage/notification_setting/NotificationFragment.kt index 49faff17..892a43e0 100644 --- a/app/src/main/java/com/company/teacherforboss/presentation/ui/mypage/notification_setting/NotificationFragment.kt +++ b/app/src/main/java/com/company/teacherforboss/presentation/ui/mypage/notification_setting/NotificationFragment.kt @@ -24,6 +24,11 @@ class NotificationFragment: BindingFragment(R.layou private val viewModel: NotificationSettingViewModel by viewModels() var isListenerEnabled: Boolean = false + override fun onDestroyView() { + super.onDestroyView() + viewModel.clearData() + } + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) diff --git a/app/src/main/java/com/company/teacherforboss/presentation/ui/mypage/notification_setting/NotificationSettingViewModel.kt b/app/src/main/java/com/company/teacherforboss/presentation/ui/mypage/notification_setting/NotificationSettingViewModel.kt index 7caa1dbf..abf6100d 100644 --- a/app/src/main/java/com/company/teacherforboss/presentation/ui/mypage/notification_setting/NotificationSettingViewModel.kt +++ b/app/src/main/java/com/company/teacherforboss/presentation/ui/mypage/notification_setting/NotificationSettingViewModel.kt @@ -67,6 +67,15 @@ class NotificationSettingViewModel @Inject constructor( } + fun clearData() { + _getNotificationSettingState.value = UiState.Empty + _postNotificationSettingState.value = UiState.Empty + _serviceNotification.value = false + _marketingNotificationPush.value = false + _marketingNotificationEmail.value = false + _marketingNotificationSMS.value = false + } + fun setServiceNotification(value: Boolean) { _serviceNotification.value = value } diff --git a/app/src/main/res/layout/activity_teachertalk_body.xml b/app/src/main/res/layout/activity_teachertalk_body.xml index af5ea7ad..55f6cfc3 100644 --- a/app/src/main/res/layout/activity_teachertalk_body.xml +++ b/app/src/main/res/layout/activity_teachertalk_body.xml @@ -101,10 +101,12 @@ android:layout_height="wrap_content" android:text="" android:textColor="@color/Gray700" + android:gravity="center_vertical" android:textSize="14dp" - app:layout_constraintTop_toBottomOf="@id/body_title" + android:layout_marginBottom="2dp" + app:layout_constraintTop_toTopOf="@id/profile_image" + app:layout_constraintBottom_toBottomOf="@id/profile_image" app:layout_constraintStart_toEndOf="@id/profile_image" - android:layout_marginTop="12dp" android:layout_marginStart="4dp"/>