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

[feat] 신규 단체 개설하기 뷰 구현 #199

Merged
merged 46 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a993e6d
[add] #178 아이콘 및 에셋 추가
Doreminwoo Feb 10, 2024
351cbef
[add] 178 신규 단체 개설 파일 생성
Doreminwoo Feb 15, 2024
414853c
[add] #178 그래픽 에셋 추가
Doreminwoo Feb 17, 2024
234ca5f
[mod] #178 Custom View 수정
Doreminwoo Feb 17, 2024
eccbf48
[feat] #178 activity_new_group View 구현
Doreminwoo Feb 17, 2024
356b126
[del] #178 파일 이름 변경으로 인한 삭제
Doreminwoo Feb 17, 2024
e11d66b
[feat] #178 fragment_new_group_input View 구현
Doreminwoo Feb 17, 2024
278e44d
[add] #178 string 리소스 추가
Doreminwoo Feb 17, 2024
d259ef7
[mod] #178 editText CustomView 수정
Doreminwoo Feb 17, 2024
461b4f9
[feat] #178 activity_new_group_info View 구현
Doreminwoo Feb 18, 2024
ac7e697
[add] #178 new group info - String 리소스 추가
Doreminwoo Feb 18, 2024
d7c9856
[feat] #178 fragment_new_group_keyword View 구현
Doreminwoo Feb 18, 2024
f494d67
[add] #178 String, theme 리소스 추가
Doreminwoo Feb 18, 2024
8b48fa2
[feat] #178 fragemnt_new_group_create View 구현
Doreminwoo Feb 18, 2024
0c2590a
[add] #178 String 리소스 추가
Doreminwoo Feb 18, 2024
b997abd
[feat] #178 activity_new_group_announcement VIew 구현
Doreminwoo Feb 18, 2024
73890ba
[add] #178 String 리소스 추가
Doreminwoo Feb 18, 2024
4b82e40
[mod] #178 디자인 재반영
Doreminwoo Feb 19, 2024
f21c7b5
[mod] #178 중복확인 버튼 수정
Doreminwoo Feb 20, 2024
137049c
[feat] #178 화면 전환 기능 구현
Doreminwoo Feb 21, 2024
a2e0409
[mod] #178 icon/btn visibility 적용
Doreminwoo Feb 21, 2024
cdb2000
[feat] #178 activity_new_group_share View 구현
Doreminwoo Feb 21, 2024
43875fc
[add] #178 new group share string 리소스 추가
Doreminwoo Feb 21, 2024
0e151f0
[feat] #178 Chip 동적 생성
Doreminwoo Feb 23, 2024
b04de99
[feat] #178 화면전환에 의한 스택관리
Doreminwoo Feb 23, 2024
40fcd85
Merge branch 'develop' into feat-new-group-view
Doreminwoo Feb 23, 2024
d5f8267
[del] #178 사용하지 않는 String 리소스
Doreminwoo Feb 23, 2024
8667c7a
[feat] #178 CustomEditText focusable 속성 추가
Doreminwoo Feb 23, 2024
9139db1
[chore] #178 카멜케이스로 변경
Doreminwoo Feb 23, 2024
29301a1
[chore] #178 git conflict 수정
Doreminwoo Feb 23, 2024
1b11ca6
[chore] #178 conflict 재해결
Doreminwoo Feb 23, 2024
70344e1
[del] #178 기존에 있던 파일 재사용
Doreminwoo Feb 25, 2024
d3e6815
[add] #178 visibility enum class 파일 생성 및 selector 네이밍 변경
Doreminwoo Feb 25, 2024
a0e6741
[chore] #178 코드리뷰 반영
Doreminwoo Feb 25, 2024
4459c5b
[feat] #178 화면전환 애니메이션
Doreminwoo Feb 25, 2024
9c9d846
Merge branch 'develop' into feat-new-group-view
Doreminwoo Feb 25, 2024
ac41292
[chore] #178 ktlint 적용
Doreminwoo Feb 25, 2024
e017d95
[chore] #178 코드리뷰 반영
Doreminwoo Feb 25, 2024
56b02b5
[chore] #178 코드리뷰 반영
Doreminwoo Feb 26, 2024
36a948a
[chore] #178 newgroup 패키지 상세 분리
Doreminwoo Feb 27, 2024
d1c144e
[chore] #178 코드리뷰 반영
Doreminwoo Feb 27, 2024
ba7b829
[chore] #178 VisibilityType 삭제 및 초기상태로 변경
Doreminwoo Feb 27, 2024
ba06955
Merge branch 'develop' into feat-new-group-view
Doreminwoo Feb 27, 2024
c335d47
[chore] #178 Tag 스타일 재사용
Doreminwoo Feb 28, 2024
99b0d07
Merge branch 'develop' into feat-new-group-view
Doreminwoo Mar 1, 2024
6a8116b
[chore] #178 ktlint 적용
Doreminwoo Mar 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
20 changes: 20 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".presentation.ui.newgroup.NewGroupActivity"
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".presentation.ui.newgroup.NewGroupInfoActivity"
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".presentation.ui.newgroup.NewGroupAnnouncementActivity"
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".presentation.ui.newgroup.NewGroupShareActivity"
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

myGroup 아래로 내려주시면 감사하겠습니당 이거 아래 순서대로 정렬하는 중이라서요 ㅋㅋ
스크린샷 2024-02-24 오후 4 32 41

<activity
android:name=".presentation.ui.main.MainActivity"
android:exported="false"
Expand Down
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

Choose a reason for hiding this comment

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

이쪽 개최 프로세스처럼 패키지 정리해주면 지현 언니가 더 좋아할듯용?ㅎ

image

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

Choose a reason for hiding this comment

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
package org.sopt.pingle.presentation.ui.newgroup

import android.content.Intent
import android.os.Bundle
import androidx.activity.viewModels
import androidx.fragment.app.Fragment
import androidx.viewpager2.widget.ViewPager2
import dagger.hilt.android.AndroidEntryPoint
import org.sopt.pingle.R
import org.sopt.pingle.databinding.ActivityNewGroupBinding
import org.sopt.pingle.util.base.BindingActivity

@AndroidEntryPoint
class NewGroupActivity : BindingActivity<ActivityNewGroupBinding>(R.layout.activity_new_group) {
private val viewModel: NewGroupViewModel by viewModels()
private lateinit var fragmentList: ArrayList<Fragment>

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

initLayout()
addListeners()
}

private fun initLayout() {
setPlanFragmentStateAdapter()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

한 함수만 실행 시켜 줄 거면 initLayout 없이 그냥 setPlanFragmentStateAdapter를 onCreate 에서 사용하는 게 좋아 보입니다.


private fun addListeners() {
binding.btnNewGroupNext.setOnClickListener {
when (binding.vpNewGroup.currentItem) {
fragmentList.size - SUB_LIST_SIZE -> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

마지막 페이지일 때 넘어가게 하는걸 생각한 거 같은데 네이밍이 SUB_LIST_SIZE인 이유가 있을까영 ?!?! 한 번에 이해하기 좀 더 어려운 거 같아서여

// TODO 서버통신
navigateToNewGroupAnnouncement()
}

else -> {
binding.vpNewGroup.currentItem++
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
fragmentList.size - SUB_LIST_SIZE -> {
// TODO 서버통신
navigateToNewGroupAnnouncement()
}
else -> {
binding.vpNewGroup.currentItem++
}
fragmentList.size - SUB_LIST_SIZE -> navigateToNewGroupAnnouncement()
else -> binding.vpNewGroup.currentItem++

}
}

binding.includeNewGroupTopbar.ivAllTopbarArrowWithTitleArrowLeft.setOnClickListener {
navigateToPreviousPage()
}

binding.includeNewGroupTopbar.ivAllTopbarArrowWithTitleInfo.setOnClickListener {
navigateToNewGroupInfo()
}
}

private fun setPlanFragmentStateAdapter() {
fragmentList = ArrayList()
fragmentList.apply {
add(NewGroupInputFragment())
add(NewGroupKeywordFragment())
add(NewGroupCreateFragment())
}

val adapter = NewGroupFragmentStateAdapter(fragmentList, this)
with(binding.vpNewGroup) {
this.adapter = adapter
isUserInputEnabled = false

registerOnPageChangeCallback(object :
ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
super.onPageSelected(position)
viewModel.setCurrentPage(position)
}
})
}
}

private fun navigateToNewGroupInfo() {
Intent(this, NewGroupInfoActivity::class.java).apply {
putExtra("ActivityName", "NewGroupActivity")
startActivity(this)
}
}

private fun navigateToNewGroupAnnouncement() {
Intent(this, NewGroupAnnouncementActivity::class.java).apply {
startActivity(this)
}
}

private fun navigateToPreviousPage() {
when (binding.vpNewGroup.currentItem) {
FIRST_PAGE -> finish()
else -> binding.vpNewGroup.currentItem--
}
}

companion object {
const val FIRST_PAGE = 0
const val SUB_LIST_SIZE = 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package org.sopt.pingle.presentation.ui.newgroup

import android.content.Intent
import android.os.Bundle
import androidx.activity.OnBackPressedCallback
import dagger.hilt.android.AndroidEntryPoint
import org.sopt.pingle.R
import org.sopt.pingle.databinding.ActivityNewGroupAnnouncementBinding
import org.sopt.pingle.presentation.ui.main.MainActivity
import org.sopt.pingle.util.base.BindingActivity

@AndroidEntryPoint
class NewGroupAnnouncementActivity :
BindingActivity<ActivityNewGroupAnnouncementBinding>(R.layout.activity_new_group_announcement) {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

addListeners()
}

private fun addListeners() {
onBackPressedCallBack()
binding.btnNewGroupAnnouncementInvitation.setOnClickListener {
navigateToNewGroupShare()
}
binding.tvNewGroupAnnouncementHome.setOnClickListener {
navigateToHome()
}
}

private fun navigateToNewGroupShare() {
Intent(this, NewGroupShareActivity::class.java).apply {
startActivity(this)
}
}

private fun navigateToHome() {
Intent(this, MainActivity::class.java).apply {
startActivity(this)
finish()
}
}

private fun navigateToNewGroup() {
Intent(this, NewGroupActivity::class.java).apply {
startActivity(this)
}
}

private fun onBackPressedCallBack() {
onBackPressedDispatcher.addCallback(
this,
object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
navigateToNewGroup()
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
Member Author

Choose a reason for hiding this comment

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

기획측에 물어보긴했는데 '신규 개설 단체의 홈화면' 으로 이동하는게 맞다고 하시는데 홈화면이 어느 화면을 지칭하는지 확실하지않아서 재확인중입니다!

finish()
Copy link
Collaborator

Choose a reason for hiding this comment

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

navigateHome에 finish가 있는ㄴ데 또 추가해야 하나용??

Copy link
Member Author

Choose a reason for hiding this comment

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

오옹 그러네요!?

}
}
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.sopt.pingle.presentation.ui.newgroup

import android.os.Bundle
import android.view.View
import dagger.hilt.android.AndroidEntryPoint
import org.sopt.pingle.R
import org.sopt.pingle.databinding.FragmentNewGroupCreateBinding
import org.sopt.pingle.util.base.BindingFragment

@AndroidEntryPoint
class NewGroupCreateFragment :
BindingFragment<FragmentNewGroupCreateBinding>(R.layout.fragment_new_group_create) {

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.sopt.pingle.presentation.ui.newgroup

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

class NewGroupFragmentStateAdapter(
private val fragmentList: ArrayList<Fragment>,
fragmentActivity: FragmentActivity
) : FragmentStateAdapter(fragmentActivity) {
override fun getItemCount(): Int = fragmentList.size

override fun createFragment(position: Int): Fragment {
return fragmentList[position]
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

이거 제가 확장함수로 빼뒀어요 새로 만들지 말고 그거 사용해 주세요.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package org.sopt.pingle.presentation.ui.newgroup

import android.content.Intent
import android.os.Bundle
import dagger.hilt.android.AndroidEntryPoint
import org.sopt.pingle.R
import org.sopt.pingle.databinding.ActivityNewGroupInfoBinding
import org.sopt.pingle.util.base.BindingActivity

@AndroidEntryPoint
class NewGroupInfoActivity :
BindingActivity<ActivityNewGroupInfoBinding>(R.layout.activity_new_group_info) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

addListeners()
}

private fun addListeners() {
binding.ivNewGroupInfoX.setOnClickListener {
when (intent.getStringExtra("ActivityName")) {
"NewGroupActivity" -> navigateToNewGroup()

// TODO 기존단체입장하기에서 넘어오는 경우에 대한 분기처리

else -> finish()
}
}
}

private fun navigateToNewGroup() {
Intent(this, NewGroupActivity::class.java).apply {
startActivity(this)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.sopt.pingle.presentation.ui.newgroup

import android.os.Bundle
import android.view.View
import dagger.hilt.android.AndroidEntryPoint
import org.sopt.pingle.R
import org.sopt.pingle.databinding.FragmentNewGroupInputBinding
import org.sopt.pingle.util.base.BindingFragment

@AndroidEntryPoint
class NewGroupInputFragment :
BindingFragment<FragmentNewGroupInputBinding>(R.layout.fragment_new_group_input) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.sopt.pingle.presentation.ui.newgroup

import android.os.Bundle
import android.view.View
import com.google.android.material.chip.Chip
import dagger.hilt.android.AndroidEntryPoint
import org.sopt.pingle.R
import org.sopt.pingle.databinding.FragmentNewGroupKeywordBinding
import org.sopt.pingle.util.base.BindingFragment

@AndroidEntryPoint
class NewGroupKeywordFragment :
BindingFragment<FragmentNewGroupKeywordBinding>(R.layout.fragment_new_group_keyword) {
private val itemList =
listOf(Item(1, "연합동아리"), Item(2, "교내동아리"), Item(3, "학생회"), Item(4, "대학교"))
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

Choose a reason for hiding this comment

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

이거 나중에 서버통신으로 불러올 거라 ㄱㅊ을 듯요 !!


override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

initLayout()
}

private fun initLayout() {
setChipKeyword()
}

private fun setChipKeyword() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

칩 spacing 처리 해주셨나요? 안 보여서

Copy link
Member Author

Choose a reason for hiding this comment

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

chip간의 간격은 xml 에서 chipSpacingHorizontal 속성으로 처리했습니다!

binding.cgNewGroupKeyword.removeAllViews()

for (item in itemList) {
val chip =
layoutInflater.inflate(R.layout.view_new_group_chip_keyword, null, false) as Chip
chip.text = item.name
chip.setOnCheckedChangeListener { _, isChecked ->
when (isChecked) {
true -> chip.setTextAppearance(R.style.TextAppearance_Pingle_Sub_Semi_16)
false -> chip.setTextAppearance(R.style.TextAppearance_Pingle_Body_Med_16)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

초기에 textAppearance 가 먹히지 않아서 처음에 칩 선택할 때 크기가 바뀌는 것 같아요 view_new_group_chip_keyword 여기에 있는 칩에 초기 textAppearance 값 추가해 주세요

}
binding.cgNewGroupKeyword.addView(chip)
}
}

// TODO Api연결시 response로 변경 예정
data class Item(val id: Int, val name: String)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.sopt.pingle.presentation.ui.newgroup

import android.os.Bundle
import dagger.hilt.android.AndroidEntryPoint
import org.sopt.pingle.R
import org.sopt.pingle.databinding.ActivityNewGroupShareBinding
import org.sopt.pingle.util.base.BindingActivity

@AndroidEntryPoint
class NewGroupShareActivity :
BindingActivity<ActivityNewGroupShareBinding>(R.layout.activity_new_group_share) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

addListeners()
}

private fun addListeners() {
binding.includeNewGroupShareTopbar.ivAllTopbarArrowWithTitleArrowLeft.setOnClickListener {
finish()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.sopt.pingle.presentation.ui.newgroup

import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import org.sopt.pingle.presentation.ui.plan.PlanViewModel

@HiltViewModel
class NewGroupViewModel @Inject constructor() : ViewModel() {
private val _currentPage = MutableStateFlow(PlanViewModel.FIRST_PAGE_POSITION)
val currentPage get() = _currentPage.asStateFlow()

fun setCurrentPage(position: Int) {
_currentPage.value = position
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import android.os.Bundle
import org.sopt.pingle.R
import org.sopt.pingle.databinding.ActivityOnBoardingBinding
import org.sopt.pingle.presentation.ui.joingroup.JoinGroupSearchActivity
import org.sopt.pingle.presentation.ui.newgroup.NewGroupActivity
import org.sopt.pingle.util.activity.setDoubleBackPressToExit
import org.sopt.pingle.util.base.BindingActivity
import org.sopt.pingle.util.context.navigateToWebView

class OnBoardingActivity :
BindingActivity<ActivityOnBoardingBinding>(R.layout.activity_on_boarding) {
Expand All @@ -25,7 +25,9 @@ class OnBoardingActivity :
}

binding.includeOnboardingGroupNew.root.setOnClickListener {
startActivity(navigateToWebView(NEW_GROUP_LINK))
Copy link
Collaborator

Choose a reason for hiding this comment

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

하단 NEW_GROUP_LINK도 지워주세요

Intent(this, NewGroupActivity::class.java).apply {
startActivity(this)
}
}
}

Expand Down
Loading
Loading