-
Notifications
You must be signed in to change notification settings - Fork 2
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
Changes from 31 commits
a993e6d
351cbef
414853c
234ca5f
eccbf48
356b126
e11d66b
278e44d
d259ef7
461b4f9
ac7e697
d7c9856
f494d67
8b48fa2
0c2590a
b997abd
73890ba
4b82e40
f21c7b5
137049c
a2e0409
cdb2000
43875fc
0e151f0
b04de99
40fcd85
d5f8267
8667c7a
9139db1
29301a1
1b11ca6
70344e1
d3e6815
a0e6741
4459c5b
9c9d846
ac41292
e017d95
56b02b5
36a948a
d1c144e
ba7b829
ba06955
c335d47
99b0d07
6a8116b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 단체 정보 확인 페이지에서 버튼 텍스트 바뀌는 로직 빠져있는 것 같습니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 하지은 이제 나를 너무 잘 안다 무섭다 무서워 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() | ||||||||||||||||||||||
} | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 -> { | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 마지막 페이지일 때 넘어가게 하는걸 생각한 거 같은데 네이밍이 SUB_LIST_SIZE인 이유가 있을까영 ?!?! 한 번에 이해하기 좀 더 어려운 거 같아서여 |
||||||||||||||||||||||
// TODO 서버통신 | ||||||||||||||||||||||
navigateToNewGroupAnnouncement() | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
else -> { | ||||||||||||||||||||||
binding.vpNewGroup.currentItem++ | ||||||||||||||||||||||
} | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
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() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기서 뒤로가기 하면 새로운 그룹 추가 페이지로 가기로 정해졌나욤? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 기획측에 물어보긴했는데 '신규 개설 단체의 홈화면' 으로 이동하는게 맞다고 하시는데 홈화면이 어느 화면을 지칭하는지 확실하지않아서 재확인중입니다! |
||
finish() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. navigateHome에 finish가 있는ㄴ데 또 추가해야 하나용?? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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] | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, "대학교")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기두 다 상수화할 수 있지 않을까용?! There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 칩 spacing 처리 해주셨나요? 안 보여서 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. chip간의 간격은 xml 에서 |
||
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) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
---|---|---|
|
@@ -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) { | ||
|
@@ -25,7 +25,9 @@ class OnBoardingActivity : | |
} | ||
|
||
binding.includeOnboardingGroupNew.root.setOnClickListener { | ||
startActivity(navigateToWebView(NEW_GROUP_LINK)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 하단 NEW_GROUP_LINK도 지워주세요 |
||
Intent(this, NewGroupActivity::class.java).apply { | ||
startActivity(this) | ||
} | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
myGroup 아래로 내려주시면 감사하겠습니당 이거 아래 순서대로 정렬하는 중이라서요 ㅋㅋ