Skip to content

Commit

Permalink
[fix] #211 보스톡 탈퇴 회원 중앙정렬 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
a1rhun committed Nov 5, 2024
1 parent 080e331 commit fded4ff
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class LoginActivity: BindingActivity<ActivityLoginBinding>(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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -310,9 +311,14 @@ class BossTalkBodyActivity : BindingActivity<ActivityBosstalkBodyBinding>(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")

Expand All @@ -332,6 +338,7 @@ class BossTalkBodyActivity : BindingActivity<ActivityBosstalkBodyBinding>(R.layo
userLevel.visibility = View.VISIBLE
profileLevel.visibility = View.VISIBLE


body.memberInfo.toMemberDto().profileImg?.let {
binding.profileImage.loadProfileImgFromUrlCoil(it)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class NotificationFragment: BindingFragment<FragmentNotificationBinding>(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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/layout/activity_teachertalk_body.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

<TextView
Expand Down

0 comments on commit fded4ff

Please sign in to comment.