Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6221b2f
[delete] 서비스 버전 표시로만 변경 #30
tristanjung1006 Jul 28, 2024
5fa92db
[delete] 서비스 버전 페이지 삭제 #30
tristanjung1006 Jul 28, 2024
6c105e6
[chore] 마이페이지 이전버튼 삭제 #30
tristanjung1006 Jul 28, 2024
125430c
[chore] 달력 친구 기록 레이아웃 변경 #30
tristanjung1006 Jul 28, 2024
3fce018
[design] 바텀시트 일기카드 0개일 경우 UI 추가 #30
tristanjung1006 Jul 28, 2024
c1e23a2
[design] 리사이클러뷰 가로 공백 추가 #30
tristanjung1006 Jul 28, 2024
6c327f5
[chore] 홈화면 날짜 감정불안 배경색 변경 #30
tristanjung1006 Jul 28, 2024
dec4b49
[chore] 로그인 화면 로고 위치 변경 #30
tristanjung1006 Jul 28, 2024
a6cc353
[chore] 회원가입 동의 화면 체크박스 크기 변경 #30
tristanjung1006 Jul 28, 2024
464b478
[chore] 회원가입 닉네임 입력 UI 변경 #30
tristanjung1006 Jul 28, 2024
1776a7f
[design] 투명색 추가 #30
tristanjung1006 Jul 30, 2024
313885e
[design] 알림 삭제 버튼 추가 #30
tristanjung1006 Jul 30, 2024
a6d9309
[design] 삭제 레이아웃 추가 #30
tristanjung1006 Jul 30, 2024
a71a183
[chore] 어댑터에 삭제 기능 추가 #30
tristanjung1006 Jul 30, 2024
7656b32
[chore] 스와이프 로직 변경 #30
tristanjung1006 Jul 30, 2024
a079eeb
[chore] 스와이프 로직 추가 #30
tristanjung1006 Jul 30, 2024
1def410
[chore] 어댑터 불필요한 연결 제거 #30
tristanjung1006 Jul 30, 2024
1801b42
[design] 다이얼로그 배경 투명색으로 정의 #30
tristanjung1006 Jul 30, 2024
0625d40
[design] 마이페이지 프로필 수정 네비게이션 #30
tristanjung1006 Jul 30, 2024
ffd08da
[feature] 동적으로 생성하는 다이얼로그 레이아웃 #30
tristanjung1006 Jul 30, 2024
0c77d6f
[design] 다이얼로그 투명 테마 #30
tristanjung1006 Jul 30, 2024
7f29341
[feature] 다이얼로그 viewmodel에서 동적으로 생성 #30
tristanjung1006 Jul 30, 2024
02c8afd
[design] 회원탈퇴, 로그아웃 버튼 음영 제거 #30
tristanjung1006 Jul 30, 2024
7c4a7a7
[feature] 회원가입 viewmodel 재활용으로 마이페이지 닉네임 수정화면 구성 #30
tristanjung1006 Jul 30, 2024
b2e2cac
[feature] 기록 닉네임 글자수 제한 #30
tristanjung1006 Jul 30, 2024
dbbc795
[design] 기록 탭 전체 스크롤, 제한선, 폰트 조정 #30
tristanjung1006 Jul 30, 2024
4c6a1bf
[design] 감정우표 선택 화면 폰트 조정 #30
tristanjung1006 Jul 30, 2024
065583f
[chore] 감정우표 결과 화면 시간 축소 #30
tristanjung1006 Jul 30, 2024
e8a3108
[chore] 마이페이지 프로필 기본으로 고정 #30
tristanjung1006 Jul 30, 2024
6df3e10
[chore] 알림메시지 크기 조정 #30
tristanjung1006 Jul 30, 2024
8a6c36d
[design] 친구수락 버튼 음영 제거 #30
tristanjung1006 Jul 30, 2024
219d714
[design] 캘린더 요일, 날짜 아이템 UI #14
tristanjung1006 Jul 31, 2024
e047f8e
[feature] 캘린더 실시간 날짜 생성 로직 #14
tristanjung1006 Jul 31, 2024
67a7cfe
[design] 캘린더 RecyclerView 2개로 구성 #14
tristanjung1006 Jul 31, 2024
02bad2b
[design] 캘린더 탭 구성 #14
tristanjung1006 Jul 31, 2024
91e3320
[feature] 캘린더 요일 어댑터 #14
tristanjung1006 Jul 31, 2024
112e461
[feature] 캘린더 Viewager2로 구성 #14
tristanjung1006 Jul 31, 2024
86eca0a
[feature] 캘린더 RecyclerView로 구성 #14
tristanjung1006 Jul 31, 2024
6e9a838
[feature] 캘린더 로직 #14
tristanjung1006 Jul 31, 2024
bf1986c
[delete] 캘린더 화면 탭 레이아웃으로 전환 #14
tristanjung1006 Jul 31, 2024
422c0df
[feature] 캘린더 화면 탭 레이아웃 설정 #14
tristanjung1006 Jul 31, 2024
4fc523f
[design] 본인, 친구 캘린더 날짜 아이템 분리 #14
tristanjung1006 Aug 1, 2024
480f957
[setting] 기록 기능 프래그먼트 이름 변경 #14
tristanjung1006 Aug 1, 2024
a20ea67
[feature] 친구 기록 날짜별 친구 감정우표 개수 및 종류 표시 #14
tristanjung1006 Aug 1, 2024
d20a51c
[feature] 나, 친구 기록 어댑터 분리 #14
tristanjung1006 Aug 1, 2024
294298e
[setting] 바텀네비게이션 재정의 #14
tristanjung1006 Aug 1, 2024
f24f8f5
[design] 캘린더 배경 변경 #14
tristanjung1006 Aug 1, 2024
54de445
[chore] 날짜별 친구기록 없을 경우 공백처리 #14
tristanjung1006 Aug 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ data class CalendarItem(
val emotion: Int,
val nickname: String
)

data class DateWithItems(
val date: String,
val items: List<CalendarItem>
)
8 changes: 8 additions & 0 deletions app/src/main/java/com/toyou/toyouandroid/model/FriendDate.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.toyou.toyouandroid.model

import java.util.Date

data class FriendDate(
val date: Date,
val people: String
)
8 changes: 8 additions & 0 deletions app/src/main/java/com/toyou/toyouandroid/model/MyDate.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.toyou.toyouandroid.model

import java.util.Date

data class MyDate(
val date: Date,
val imageResId: Int?
)
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class MainActivity : AppCompatActivity() {
navController.navigate(R.id.navigation_social)
true
}
R.id.navigation_calendar -> {
navController.navigate(R.id.navigation_calendar)
R.id.navigation_record -> {
navController.navigate(R.id.navigation_record)
true
}
R.id.navigation_mypage -> {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class HomeOptionFragment : Fragment() {
homeViewModel.updateHomeEmotion(
R.drawable.home_emotion_anxiety,
getString(R.string.home_emotion_anxiety_title),
R.color.g01,
R.color.g02,
R.drawable.background_green)

homeViewModel.updateMypageEmotion(R.drawable.home_stamp_option_anxiety)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class HomeResultFragment : Fragment() {
binding.homeResultTv.text = text

ObjectAnimator.ofFloat(binding.homeResultTv, "alpha", 0f, 1f).apply {
duration = 3000
duration = 2000
interpolator = DecelerateInterpolator()
start()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.toyou.toyouandroid.presentation.fragment.mypage

import android.app.Dialog
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.Window
import androidx.databinding.DataBindingUtil
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.activityViewModels
import com.toyou.toyouandroid.R
import com.toyou.toyouandroid.databinding.DialogMypageBinding

class MypageDialog : DialogFragment() {

private val viewModel: MypageDialogViewModel by activityViewModels()

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
val binding: DialogMypageBinding = DataBindingUtil.inflate(
inflater, R.layout.dialog_mypage, container, false
)
binding.lifecycleOwner = this
binding.viewModel = viewModel
return binding.root
}

override fun onResume() {
super.onResume()
dialog?.window?.setLayout(
convertDpToPx(280),
convertDpToPx(120)
)
}

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return Dialog(requireContext(), R.style.MypageDialog).apply {
requestWindowFeature(Window.FEATURE_NO_TITLE)
window?.setBackgroundDrawableResource(android.R.color.transparent)
}
}

private fun convertDpToPx(dp: Int): Int {
return (dp * resources.displayMetrics.density).toInt()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.toyou.toyouandroid.presentation.fragment.mypage

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

class MypageDialogViewModel : ViewModel() {
private val _title = MutableLiveData<String>()
val title: LiveData<String> get() = _title

private val _subTitle = MutableLiveData<String?>()
val subTitle: LiveData<String?> get() = _subTitle

private val _leftButtonText = MutableLiveData<String>()
val leftButtonText: LiveData<String> get() = _leftButtonText

private val _rightButtonText = MutableLiveData<String>()
val rightButtonText: LiveData<String> get() = _rightButtonText

private val _leftButtonTextColor = MutableLiveData<Int>()
val leftButtonTextColor: LiveData<Int> get() = _leftButtonTextColor

private val _rightButtonTextColor = MutableLiveData<Int>()
val rightButtonTextColor: LiveData<Int> get() = _rightButtonTextColor

private val _leftButtonClickAction = MutableLiveData<() -> Unit>()
private val _rightButtonClickAction = MutableLiveData<() -> Unit>()

fun setDialogData(
title: String,
subTitle: String?,
leftButtonText: String,
rightButtonText: String,
leftButtonTextColor: Int,
rightButtonTextColor: Int,
leftButtonClickAction: () -> Unit,
rightButtonClickAction: () -> Unit
) {
_title.value = title
_subTitle.value = subTitle
_leftButtonText.value = leftButtonText
_rightButtonText.value = rightButtonText
_leftButtonTextColor.value = leftButtonTextColor
_rightButtonTextColor.value = rightButtonTextColor
_leftButtonClickAction.value = leftButtonClickAction
_rightButtonClickAction.value = rightButtonClickAction
}

fun onLeftButtonClick() {
_leftButtonClickAction.value?.invoke()
}

fun onRightButtonClick() {
_rightButtonClickAction.value?.invoke()
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.toyou.toyouandroid.presentation.fragment.mypage

import android.content.ContentValues.TAG
import android.graphics.Color
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
Expand Down Expand Up @@ -28,7 +29,9 @@ class MypageFragment : Fragment() {
private val nicknameViewModel: SignupNicknameViewModel by activityViewModels()
private val homeViewModel: HomeViewModel by activityViewModels()
private val viewModel: MypageViewModel by viewModels()
private val mypageDialogViewModel: MypageDialogViewModel by activityViewModels()
private lateinit var viewModelManager: ViewModelManager
private var mypageDialog: MypageDialog? = null

override fun onCreateView(
inflater: LayoutInflater,
Expand All @@ -37,6 +40,7 @@ class MypageFragment : Fragment() {
): View {

_binding = FragmentMypageBinding.inflate(inflater, container, false)

binding.viewModel = viewModel
binding.lifecycleOwner = this

Expand Down Expand Up @@ -68,41 +72,66 @@ class MypageFragment : Fragment() {
navController.navigate(R.id.action_navigation_mypage_to_terms_of_use_fragment)
}

binding.mypageVersion.setOnClickListener {
navController.navigate(R.id.action_navigation_mypage_to_version_fragment)
}

binding.mypageLogoutBtn.setOnClickListener {
UserApiClient.instance.logout { error ->
if (error != null) {
Timber.tag(TAG).e(error, "로그아웃 실패. SDK에서 토큰 삭제됨")
}
else {
Timber.tag(TAG).i("로그아웃 성공. SDK에서 토큰 삭제됨")
}
}
viewModelManager.resetAllViewModels()
// resetApp()
navController.navigate(R.id.action_navigation_mypage_to_login_fragment)
// ViewModel에서 닉네임을 가져와서 TextView에 설정
nicknameViewModel.nickname.observe(viewLifecycleOwner) { nickname ->
binding.profileNickname.text = nickname
}

binding.mypageSignoutBtn.setOnClickListener {
activity?.finishAffinity()
mypageDialogViewModel.setDialogData(
title = "정말 탈퇴하시겠어요?",
subTitle = "탈퇴 시, 모든 정보가 사라집니다",
leftButtonText = "탈퇴하기",
rightButtonText = "취소",
leftButtonTextColor = Color.RED,
rightButtonTextColor = R.color.black,
leftButtonClickAction = { handleSignout() },
rightButtonClickAction = { dismissDialog() }
)
mypageDialog = MypageDialog()
mypageDialog?.show(parentFragmentManager, "CustomDialog")
}

// ViewModel에서 닉네임을 가져와서 TextView에 설정
nicknameViewModel.nickname.observe(viewLifecycleOwner) { nickname ->
binding.profileNickname.text = nickname
binding.mypageLogoutBtn.setOnClickListener {
mypageDialogViewModel.setDialogData(
title = "정말 로그아웃하시겠어요?",
subTitle = "",
leftButtonText = "취소",
rightButtonText = "로그아웃",
leftButtonTextColor = R.color.black,
rightButtonTextColor = Color.RED,
leftButtonClickAction = { dismissDialog() },
rightButtonClickAction = { handleLogout() }
)
mypageDialog = MypageDialog()
mypageDialog?.show(parentFragmentManager, "CustomDialog")
}
}

homeViewModel.mypageEmotionStamp.observe(viewLifecycleOwner) { emotion ->
binding.mypageEmotionStamp.setImageResource(emotion)
private fun handleSignout() {
Timber.tag("handleSignout").d("handleSignout")
activity?.finishAffinity()
}

private fun handleLogout() {
Timber.tag("handleLogout").d("handleWithdraw")

UserApiClient.instance.logout { error ->
if (error != null) {
Timber.tag(TAG).e(error, "로그아웃 실패. SDK에서 토큰 삭제됨")
}
else {
Timber.tag(TAG).i("로그아웃 성공. SDK에서 토큰 삭제됨")
}
}
viewModelManager.resetAllViewModels()
navController.navigate(R.id.action_navigation_mypage_to_login_fragment)
mypageDialog?.dismiss()
}

private fun resetApp() {
val navGraph = navController.navInflater.inflate(R.navigation.nav_graph)
navController.graph = navGraph
private fun dismissDialog() {
Timber.tag("dismissDialog").d("dismissDialog")
mypageDialog?.dismiss()
}

override fun onDestroyView() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
package com.toyou.toyouandroid.presentation.fragment.mypage

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

class MypageViewModel : ViewModel() {

private val _text = MutableLiveData<String>().apply {
value = "This is mypage Fragment"
}
val text: LiveData<String> = _text
}
Loading