Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] 3차 스프린트 QA 수정사항 반영 #245

Merged
merged 27 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
eae8e5d
[chore] #243 랭킹 아이템 숫자 크기 12Bold -> 16Bold
jihyunniiii Mar 10, 2024
a38eca9
[chore] #243 랭킹 데이터 텍소노미 스크롤 시작 시점으로 변경
jihyunniiii Mar 10, 2024
1ed2ef1
[chore] #243 PingleSearch -> EditText가 비었을 시 검색 버튼 비활성화
jihyunniiii Mar 10, 2024
f35c0b3
[chore] #243 지도/리스트 뷰 -> 검색창에서 뒤로가기 클릭 시 검색 취소 + 검색페이지로 이동
jihyunniiii Mar 10, 2024
a9446a1
[fix] #244 나의 단체 뷰 : 단체 변경시 모달에서 단체명 13자 이상일 시에 12자까지만 노출시키고 ‘…’처리
HAJIEUN02 Mar 10, 2024
c4dbae0
[chore] #244 나의 단체 뷰 : const val -> private const val로 수정
HAJIEUN02 Mar 10, 2024
78640d9
[fix] #244 온보딩 추가설명 뷰 : 0개 단체 가입된 사용자 앱 재실행 시 온보딩 추가설명 뷰 입장 방식 선택 뷰가 …
HAJIEUN02 Mar 10, 2024
4ba3b9c
[chore] #243 ktlintFormat
jihyunniiii Mar 10, 2024
e9fdc83
Merge branch 'develop' into fix-3rd-sprint-qa-jihyun
jihyunniiii Mar 11, 2024
2aebbd7
[chore] #243 makeEllipsisGroupName when 문으로 수정
jihyunniiii Mar 11, 2024
0f0c84e
[chore] #243 PingleLocalDataSource에 sharedPreference 추가
jihyunniiii Mar 11, 2024
1775e47
[chore] #243 단체 변경 후 홈 화면 진입 시 검색 결과가 유지되어 있는 문제 해결 (OnSharedPreferen…
jihyunniiii Mar 11, 2024
0b48ceb
[chore] #243 검색 + 지도 뷰에서 칩 필터링을 진행하는 경우 검색 결과가 없어도 지도뷰 유지
jihyunniiii Mar 11, 2024
011a9b6
[feat] #243 홈 뷰 핑글 정보 조회를 위한 정보를 하나로 관리하기 위한 모델 생성
jihyunniiii Mar 11, 2024
54f60c0
[feat] #243 홈 뷰 핑글 정보 조회를 위한 정보 (카테고리, 검색어, HomeViewType, Order) 하나의 …
jihyunniiii Mar 11, 2024
041e09a
[chore] #243 ktlintFormat
jihyunniiii Mar 11, 2024
ca2b255
Merge remote-tracking branch 'origin/fix-3rd-sprint-qa-jihyun' into f…
HAJIEUN02 Mar 12, 2024
5dbf5e8
Merge branch 'develop' into fix-3rd-sprint-qa-jihyun
HAJIEUN02 Mar 12, 2024
8c87a8a
Merge branch 'develop' into fix-3rd-sprint-qa-jihyun
jihyunniiii Mar 12, 2024
6471797
[chore] #243 로그아웃/탈퇴 후 이동 화면 수정 (Onboarding)
jihyunniiii Mar 12, 2024
4e27cbf
[chore] #243 Log 삭제
jihyunniiii Mar 12, 2024
1d28f7b
[chore] #243 오타 수정
jihyunniiii Mar 12, 2024
22a28bc
[chore] #243 로그아웃/탈퇴 후 이동 액티비티 수정 (auth)
jihyunniiii Mar 12, 2024
751d77f
[chore] #243 ktlintFormat
jihyunniiii Mar 12, 2024
2cf81e5
Merge remote-tracking branch 'origin/fix-3rd-sprint-qa-jihyun' into f…
HAJIEUN02 Mar 12, 2024
b95ce26
[fix] #243 로그아웃/탈퇴 후 온보딩, 최초 접속 시 온보딩 뒤로가기 버튼 로직 분리
HAJIEUN02 Mar 12, 2024
993395f
[chore] #243 ktlintFormat
HAJIEUN02 Mar 12, 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 @@ -19,23 +19,28 @@ import org.sopt.pingle.databinding.FragmentHomeBinding
import org.sopt.pingle.presentation.model.SearchModel
import org.sopt.pingle.presentation.type.CategoryType
import org.sopt.pingle.presentation.type.HomeViewType
import org.sopt.pingle.presentation.type.SnackbarType
import org.sopt.pingle.presentation.ui.main.home.mainlist.MainListFragment
import org.sopt.pingle.presentation.ui.main.home.map.MapFragment
import org.sopt.pingle.presentation.ui.search.SearchActivity
import org.sopt.pingle.presentation.ui.search.SearchActivity.Companion.SEARCH_WORD
import org.sopt.pingle.util.AmplitudeUtils
import org.sopt.pingle.util.activity.FINISH_INTERVAL_TIME
import org.sopt.pingle.util.activity.INIT_BACK_PRESSED_TIME
import org.sopt.pingle.util.base.BindingFragment
import org.sopt.pingle.util.component.PingleChip
import org.sopt.pingle.util.component.PingleSnackbar
import org.sopt.pingle.util.fragment.stringOf
import org.sopt.pingle.util.view.PingleFragmentStateAdapter
import org.sopt.pingle.util.view.UiState

@AndroidEntryPoint
class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home) {
private val homeViewModel: HomeViewModel by activityViewModels()
private var backPressedTime = INIT_BACK_PRESSED_TIME
private lateinit var fragmentList: ArrayList<Fragment>
private lateinit var fragmentStateAdapter: PingleFragmentStateAdapter
private lateinit var resultLauncher: ActivityResultLauncher<Intent>
private lateinit var stopSearchCallback: OnBackPressedCallback

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Expand All @@ -45,11 +50,12 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home
collectData()
setFragmentStateAdapter()
setResultLauncher()
setStopSearchCallback()
}

override fun onResume() {
super.onResume()

setOnBackPressedCallback()
initChip()
}

Expand All @@ -74,8 +80,6 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home
navigateToSearch()
}
}

initChip()
}

private fun addListeners() {
Expand Down Expand Up @@ -151,7 +155,6 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home
if (isSearching) View.VISIBLE else View.INVISIBLE
tvHomeGroup.visibility = if (isSearching) View.INVISIBLE else View.VISIBLE
ivHomeSearch.visibility = if (isSearching) View.INVISIBLE else View.VISIBLE
if (isSearching) setStopSearchCallback() else stopSearchCallback.remove()
}
}
}.launchIn(viewLifecycleOwner.lifecycleScope)
Expand Down Expand Up @@ -197,18 +200,29 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home
}
}

private fun setStopSearchCallback() {
stopSearchCallback =
object : OnBackPressedCallback(!homeViewModel.searchWord.value.isNullOrEmpty()) {
private fun setOnBackPressedCallback() {
requireActivity().onBackPressedDispatcher.addCallback(
this.viewLifecycleOwner,
object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
homeViewModel.clearSearchWord()
navigateToSearch()
if (homeViewModel.searchWord.value.isNullOrEmpty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분 진짜 확장함수 쓰기 은근 어렵지 않나여?,, ㅜ.ㅜ 확장함수 그거 하나로 다 해결하고 싶은데 도저히 어떻게 해야할지 머르겠네요.. 온보딩 추가설명 뷰에서도 결국엔 실패했는데

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아니 그니까용,,, 뒤로가기 버튼 관리 쉽지 않타,,, 이거 이번 스프린트 끝나고 어떻게 하면 잘 관리할 수 있을지 고민해 봐야겠서염 ㅠ

if (System.currentTimeMillis() - backPressedTime <= FINISH_INTERVAL_TIME) {
requireActivity().finish()
} else {
backPressedTime = System.currentTimeMillis()
PingleSnackbar.makeSnackbar(
view = requireView(),
message = stringOf(R.string.all_on_back_pressed_snackbar),
bottomMarin = org.sopt.pingle.util.activity.SNACKBAR_BOTTOM_MARGIN,
snackbarType = SnackbarType.GUIDE
)
}
} else {
homeViewModel.clearSearchWord()
navigateToSearch()
}
}
}

requireActivity().onBackPressedDispatcher.addCallback(
viewLifecycleOwner,
stopSearchCallback
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RankingFragment : BindingFragment<FragmentRankingBinding>(R.layout.fragmen
addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
super.onScrollStateChanged(recyclerView, newState)
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
if (newState == RecyclerView.SCROLL_STATE_DRAGGING) {
AmplitudeUtils.trackEvent(SCROLL_RANKING)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ class MyGroupActivity : BindingActivity<ActivityMyGroupBinding>(R.layout.activit
private fun showChangeGroupModal(clickedEntity: MyGroupEntity) {
AmplitudeUtils.trackEvent(CLICK_OTHERGROUP)
binding.layoutMyGroupSelectedMenu.visibility = View.INVISIBLE

MyGroupModalDialogFragment(
title = getString(
R.string.my_group_modal_move_question,
clickedEntity.name
makeEllipsisGroupName(clickedEntity.name)
),
buttonText = stringOf(R.string.my_group_modal_change),
textButtonText = stringOf(R.string.my_group_modal_back),
Expand Down Expand Up @@ -142,15 +143,27 @@ class MyGroupActivity : BindingActivity<ActivityMyGroupBinding>(R.layout.activit
}
}

private fun makeEllipsisGroupName(groupName: String): String {
return if (groupName.length > GROUP_NAME_MAX_LENGTH) {
"${groupName.substring(SUBSTRING_START_INDEX, SUBSTRING_END_INDEX) + ELLIPSIS}"
} else {
groupName
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 {} 없이 한줄로 깔끔하게 고고!?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DoReMinWoo 제가 커밋한 부분이네욥 ㅋ.ㅋ 지현언니가 수정해준대요...

}

companion object {
private const val CHANGE_MODAL = "ChangeGroupModal"
private const val SNACKBAR_BOTTOM_MARGIN = 57

const val CLICK_INVITECODE = "click_invitecode"
const val CLICK_INVITECODE_COPY = "click_invitecode_copy"
const val CLICK_INVITECODE_SHARE = "click_invitecode_share"
const val CLICK_OTHERGROUP = "click_othergroup"
const val CLICK_OTHERGROUP_CHANGE = "click_othergroup_change"
const val CLICK_NEWGROUP = "click_newgroup"
private const val SUBSTRING_START_INDEX = 0
private const val SUBSTRING_END_INDEX = 12
private const val GROUP_NAME_MAX_LENGTH = 13
private const val ELLIPSIS = "..."

private const val CLICK_INVITECODE = "click_invitecode"
private const val CLICK_INVITECODE_COPY = "click_invitecode_copy"
private const val CLICK_INVITECODE_SHARE = "click_invitecode_share"
private const val CLICK_OTHERGROUP = "click_othergroup"
private const val CLICK_OTHERGROUP_CHANGE = "click_othergroup_change"
private const val CLICK_NEWGROUP = "click_newgroup"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class PingleSearch @JvmOverloads constructor(
if (text.isNullOrEmpty()) View.GONE else View.VISIBLE
}

etSearchPingleEditText.setOnEditorActionListener { textView, _, _ ->
textView.text.isEmpty()
}

ivSearchPingleClear.setOnClickListener {
_binding.etSearchPingleEditText.text.clear()
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/dialog_my_group_modal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_end="@dimen/dialog_all_modal_horizontal_margin" />
app:layout_constraintGuide_end="@dimen/dialog_my_group_modal_horizontal_margin" />

<TextView
android:id="@+id/tv_my_group_modal_title"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/item_ranking.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:layout_marginTop="16dp"
android:gravity="center"
android:minWidth="22dp"
android:textAppearance="@style/TextAppearance.Pingle.Cap.Bold.12"
android:textAppearance="@style/TextAppearance.Pingle.Sub.Bold.16"
android:textColor="@color/white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<dimen name="dialog_horizontal_margin">24dp</dimen>
<dimen name="dialog_all_modal_horizontal_margin">34dp</dimen>
<dimen name="dialog_map_modal_horizontal_margin">24dp</dimen>
<dimen name="dialog_my_group_modal_horizontal_margin">34dp</dimen>
<dimen name="dialog_my_group_modal_horizontal_margin">26dp</dimen>

<!-- card -->
<dimen name="card_horizontal_margin">24dp</dimen>
Expand Down
Loading