Skip to content

Commit

Permalink
[FEAT/#66] mypage부분 setOnSingleClickListner로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
seongh06 committed Sep 24, 2024
1 parent 605ffb7 commit 8dc4ec6
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import android.view.ViewGroup
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController
import com.bumptech.glide.Glide
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import umc.everyones.lck.R
Expand All @@ -20,6 +19,7 @@ import umc.everyones.lck.presentation.base.BaseFragment
import umc.everyones.lck.presentation.login.SignupViewModel
import umc.everyones.lck.util.TeamData
import umc.everyones.lck.util.TeamData.teamLogos
import umc.everyones.lck.util.extension.setOnSingleClickListener

@AndroidEntryPoint
class MyPageFragment : BaseFragment<FragmentMypageMainBinding>(R.layout.fragment_mypage_main) {
Expand Down Expand Up @@ -47,30 +47,30 @@ class MyPageFragment : BaseFragment<FragmentMypageMainBinding>(R.layout.fragment

override fun initView() {

binding.ivMypageMainBack.setOnClickListener {
binding.ivMypageMainBack.setOnSingleClickListener {
val intent = Intent(requireContext(), MainActivity::class.java)
startActivity(intent)
navigator.navigateUp()
}

binding.tvMypageMainMyprofileText.setOnClickListener {
binding.tvMypageMainMyprofileText.setOnSingleClickListener {
navigator.navigate(R.id.action_myPageFragment_to_myPageProfileFragment)
}

binding.tvMypageMainMyteamText.setOnClickListener {
binding.tvMypageMainMyteamText.setOnSingleClickListener {
navigator.navigate(R.id.action_myPageFragment_to_myPageMyteamFragment)
}

binding.tvMypageMainCommunityText.setOnClickListener {
binding.tvMypageMainCommunityText.setOnSingleClickListener {
navigator.navigate(R.id.action_myPageFragment_to_myPageCommunityFragment)
}

binding.tvMypageMainViewingPartyText.setOnClickListener {
binding.tvMypageMainViewingPartyText.setOnSingleClickListener {
navigator.navigate(R.id.action_myPageFragment_to_myPageViewingPartyFragment)
}

binding.tvMypageMainOss.setOnClickListener {
startActivity(Intent(requireContext(), OssLicensesMenuActivity::class.java))
startActivity(Intent(requireContext(), MainActivity::class.java))
}

viewModel.inquiryProfile()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import umc.everyones.lck.databinding.FragmentMypageMyteamBinding
import umc.everyones.lck.presentation.base.BaseFragment
import umc.everyones.lck.util.TeamData
import umc.everyones.lck.util.TeamData.mypageMyteam
import umc.everyones.lck.util.extension.setOnSingleClickListener

@AndroidEntryPoint
class MyPageMyteamFragment : BaseFragment<FragmentMypageMyteamBinding>(R.layout.fragment_mypage_myteam) {
Expand Down Expand Up @@ -59,7 +60,7 @@ class MyPageMyteamFragment : BaseFragment<FragmentMypageMyteamBinding>(R.layout.
}
}

binding.tvMypageMyteamTopbarEdit.setOnClickListener {
binding.tvMypageMyteamTopbarEdit.setOnSingleClickListener {
// 선택된 팀이 없을 경우 기본 팀 ID(1)로 설정
val teamIdToUpdate = selectedTeamId ?: 1

Expand Down Expand Up @@ -103,11 +104,11 @@ class MyPageMyteamFragment : BaseFragment<FragmentMypageMyteamBinding>(R.layout.
binding.layoutMypageMyteamList.visibility = View.GONE
binding.btnMypageMyteamArrow.setImageResource(R.drawable.ic_arrow_down)

binding.btnMypageMyteamArrow.setOnClickListener {
binding.btnMypageMyteamArrow.setOnSingleClickListener {
toggleScrollView()
}

binding.ivMypageMyteamBack.setOnClickListener {
binding.ivMypageMyteamBack.setOnSingleClickListener {
findNavController().navigateUp()
}
}
Expand All @@ -118,7 +119,7 @@ class MyPageMyteamFragment : BaseFragment<FragmentMypageMyteamBinding>(R.layout.
val imageView = binding.root.findViewById<ImageView>(imageViewId)

if (imageView != null) { // null 체크
imageView.setOnClickListener {
imageView.setOnSingleClickListener {
// 선택한 팀 ID가 이미 선택된 ID와 같으면 기본 팀 ID로 설정
selectedTeamId = if (selectedTeamId == teamId) {
1 // 기본 팀 ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import umc.everyones.lck.presentation.base.BaseFragment
import umc.everyones.lck.presentation.home.HomeFragment
import umc.everyones.lck.presentation.login.LoginActivity
import umc.everyones.lck.presentation.login.SignupViewModel
import umc.everyones.lck.util.extension.setOnSingleClickListener

@AndroidEntryPoint
class MyPageProfileEditFragment : BaseFragment<FragmentMypageProfileEditBinding>(R.layout.fragment_mypage_profile_edit){
Expand Down Expand Up @@ -74,18 +75,18 @@ class MyPageProfileEditFragment : BaseFragment<FragmentMypageProfileEditBinding>
}

// 뒤로가기 버튼 클릭 시 이동
binding.ivMypageProfileEditBack.setOnClickListener {
binding.ivMypageProfileEditBack.setOnSingleClickListener {
findNavController().navigateUp()
}

// 기본 이미지 사용 클릭 시
binding.tvMypageProfileEditBasic.setOnClickListener {
binding.tvMypageProfileEditBasic.setOnSingleClickListener {
binding.ivMypageProfileEditProfile.setImageResource(R.drawable.img_signup_profile)
myPageViewModel.setProfileImageUri(Uri.parse("android.resource://${requireContext().packageName}/${R.drawable.img_signup_profile}")) // 기본 이미지 URI 설정
}

// 갤러리에서 이미지 선택 클릭 시
binding.ivMypageProfileEditProfile.setOnClickListener {
binding.ivMypageProfileEditProfile.setOnSingleClickListener {
openGallery() // 갤러리 열기
}

Expand Down Expand Up @@ -116,7 +117,7 @@ class MyPageProfileEditFragment : BaseFragment<FragmentMypageProfileEditBinding>
}
}

binding.tvMypageProfileEditTopbarEdit.setOnClickListener {
binding.tvMypageProfileEditTopbarEdit.setOnSingleClickListener {
val nicknameInput = binding.etMypageProfileEditNicknameName.text.toString().trim()

// 현재 프로필 이미지 URI 가져오기
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import umc.everyones.lck.databinding.FragmentMypageProfileBinding
import umc.everyones.lck.presentation.base.BaseFragment
import umc.everyones.lck.presentation.login.LoginActivity
import umc.everyones.lck.util.TeamData
import umc.everyones.lck.util.extension.setOnSingleClickListener

@AndroidEntryPoint
class MyPageProfileFragment : BaseFragment<FragmentMypageProfileBinding>(R.layout.fragment_mypage_profile) {
Expand Down Expand Up @@ -43,18 +44,18 @@ class MyPageProfileFragment : BaseFragment<FragmentMypageProfileBinding>(R.layou

override fun initView() {

binding.tvMypageProfileEditText.setOnClickListener {
binding.tvMypageProfileEditText.setOnSingleClickListener {
navigator.navigate(R.id.action_myPageProfileFragment_to_myPageProfileEditFragment)
}

binding.tvMypageProfileWithdrawText.setOnClickListener {
binding.tvMypageProfileWithdrawText.setOnSingleClickListener {
navigator.navigate(R.id.action_myPageProfileFragment_to_myPageProfileWithdrawFragment)
}

binding.tvMypageProfileLogoutText.setOnClickListener {
binding.tvMypageProfileLogoutText.setOnSingleClickListener {
showProfileDialog()
}
binding.ivMypageProfileBack.setOnClickListener {
binding.ivMypageProfileBack.setOnSingleClickListener {
navigator.navigateUp()
}
}
Expand Down Expand Up @@ -103,12 +104,12 @@ class MyPageProfileFragment : BaseFragment<FragmentMypageProfileBinding>(R.layou
dialog.window?.attributes = layoutParams

// Cancel button
dialogBinding.btnCancel.setOnClickListener {
dialogBinding.btnCancel.setOnSingleClickListener {
dialog.dismiss()
}

// Logout button
dialogBinding.btnConfirm.setOnClickListener {
dialogBinding.btnConfirm.setOnSingleClickListener {
dialog.dismiss()
myPageViewModel.logout()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import umc.everyones.lck.R
import umc.everyones.lck.databinding.FragmentMypageProfileWithdrawBinding
import umc.everyones.lck.presentation.base.BaseFragment
import umc.everyones.lck.presentation.login.LoginActivity
import umc.everyones.lck.util.extension.setOnSingleClickListener
import umc.everyones.lck.util.extension.showCustomSnackBar

@AndroidEntryPoint
Expand Down Expand Up @@ -47,11 +48,11 @@ class MyPageProfileWithdrawFragment : BaseFragment<FragmentMypageProfileWithdraw
binding.tvMypageProfileWithdrawText1.text = text

// 뒤로가기 버튼 클릭 시 이동
binding.ivMypageProfileWithdrawBack.setOnClickListener {
binding.ivMypageProfileWithdrawBack.setOnSingleClickListener {
findNavController().navigateUp()
}

binding.tvMypageProfileWithdraw.setOnClickListener {
binding.tvMypageProfileWithdraw.setOnSingleClickListener {
myPageViewModel.withdraw()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import dagger.hilt.android.AndroidEntryPoint
import umc.everyones.lck.R
import umc.everyones.lck.databinding.FragmentMypageCommunityBinding
import umc.everyones.lck.presentation.base.BaseFragment
import umc.everyones.lck.util.extension.setOnSingleClickListener

@AndroidEntryPoint
class MyPageCommunityFragment : BaseFragment<FragmentMypageCommunityBinding>(R.layout.fragment_mypage_community) {
Expand All @@ -16,7 +17,7 @@ class MyPageCommunityFragment : BaseFragment<FragmentMypageCommunityBinding>(R.l

override fun initView() {
// 뒤로가기 버튼 클릭 리스너 설정
binding.ivMypageCommunityBack.setOnClickListener {
binding.ivMypageCommunityBack.setOnSingleClickListener {
findNavController().navigateUp()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.google.android.material.tabs.TabLayoutMediator
import umc.everyones.lck.R
import umc.everyones.lck.databinding.FragmentMypageViewingPartyBinding
import umc.everyones.lck.presentation.base.BaseFragment
import umc.everyones.lck.util.extension.setOnSingleClickListener

class MyPageViewingPartyFragment : BaseFragment<FragmentMypageViewingPartyBinding>(R.layout.fragment_mypage_viewing_party) {

Expand All @@ -15,7 +16,7 @@ class MyPageViewingPartyFragment : BaseFragment<FragmentMypageViewingPartyBindin
setupViewPager()
setupTabLayout()

binding.ivMypageViewingPartyBack.setOnClickListener {
binding.ivMypageViewingPartyBack.setOnSingleClickListener {
findNavController().navigateUp()
}
}
Expand Down

0 comments on commit 8dc4ec6

Please sign in to comment.