Skip to content

Commit

Permalink
Merge pull request #38 from Team-Umbba/feat/#35
Browse files Browse the repository at this point in the history
[Feat/#35] 화면 전환 로직붙이기
  • Loading branch information
ss99x2002 authored Jul 10, 2023
2 parents 1d91ba0 + eb511ac commit d7cdb1a
Show file tree
Hide file tree
Showing 36 changed files with 313 additions and 80 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.sopt.umbba_android.presentation

import android.content.Context
import android.os.Bundle
import android.util.AttributeSet
import android.view.View
import android.view.View.OnClickListener
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.BasicAppbarBinding
import com.sopt.umbba_android.util.binding.BindingFragment

class BasicAppbarFragment : BindingFragment<BasicAppbarBinding>(R.layout.basic_appbar) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
package com.sopt.umbba_android.presentation.home

import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import coil.load
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.FragmentHomeBinding
import com.sopt.umbba_android.presentation.qna.QuestionAnswerActivity
import com.sopt.umbba_android.util.binding.BindingFragment

class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setBackground()
setClickEvent()
}

private fun setBackground(){
with(binding){
private fun setClickEvent() {
with(binding) {
btnAnswer.setOnClickListener {
startActivity(Intent(requireActivity(), QuestionAnswerActivity::class.java))
}
}
}

private fun setBackground() {
with(binding) {
ivBackground.load("https://i.ibb.co/sRV9Vr4/iv-maru.jpg")
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
package com.sopt.umbba_android.presentation.invite

import android.os.Bundle
import android.view.View
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivityInviteCodeBinding
import com.sopt.umbba_android.util.binding.BindingActivity

class InviteCodeActivity :
BindingActivity<ActivityInviteCodeBinding>(R.layout.activity_invite_code) {
BindingActivity<ActivityInviteCodeBinding>(R.layout.activity_invite_code),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.clickListener = this
}

override fun onClick(view: View?) {
when (view?.id) {
R.id.iv_basic_back -> finish()
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
package com.sopt.umbba_android.presentation.onboarding

import android.os.Bundle
import android.view.View
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivityInputInfoBinding
import com.sopt.umbba_android.util.binding.BindingActivity

class InputInfoActivity : BindingActivity<ActivityInputInfoBinding>(R.layout.activity_input_info) {
class InputInfoActivity : BindingActivity<ActivityInputInfoBinding>(R.layout.activity_input_info),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.clickListener = this
}

override fun onClick(view: View?) {
when (view?.id) {
R.id.iv_basic_back -> finish()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,26 @@ package com.sopt.umbba_android.presentation.onboarding

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivityNotifyTimeBinding
import com.sopt.umbba_android.util.binding.BindingActivity

class NotifyTimeActivity : BindingActivity<ActivityNotifyTimeBinding>(R.layout.activity_notify_time) {
class NotifyTimeActivity :
BindingActivity<ActivityNotifyTimeBinding>(R.layout.activity_notify_time),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.clickListener = this
setClickButton()
}

override fun onClick(view: View?) {
when (view?.id) {
R.id.iv_basic_back -> finish()
}
}

private fun setClickButton() {
with(binding) {
btnGoPast.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
package com.sopt.umbba_android.presentation.onboarding

import android.os.Bundle
import android.view.View
import com.sopt.umbba_android.R
import androidx.fragment.app.Fragment
import com.sopt.umbba_android.databinding.ActivityQuestBinding
import com.sopt.umbba_android.util.binding.BindingActivity

class QuestActivity : BindingActivity<ActivityQuestBinding>(R.layout.activity_quest) {
class QuestActivity : BindingActivity<ActivityQuestBinding>(R.layout.activity_quest),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
changeFragment(QuestSubFragment())
}

override fun onClick(view: View?) {
when (view?.id) {
R.id.iv_basic_back -> finish()
}
}

private fun changeFragment(fragment: Fragment) {
supportFragmentManager.beginTransaction()
.add(R.id.fragment_question, fragment)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
package com.sopt.umbba_android.presentation.onboarding

import android.os.Bundle
import android.view.View
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivitySelectFamilyBinding
import com.sopt.umbba_android.util.binding.BindingActivity

class SelectFamilyActivity : BindingActivity<ActivitySelectFamilyBinding>(R.layout.activity_select_family) {
class SelectFamilyActivity :
BindingActivity<ActivitySelectFamilyBinding>(R.layout.activity_select_family),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.clickListener = this
}

override fun onClick(view: View?) {
when (view?.id) {
R.id.iv_basic_back -> finish()
}
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
package com.sopt.umbba_android.presentation.onboarding

import android.os.Bundle
import android.view.View
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivitySetTimeBinding
import com.sopt.umbba_android.util.binding.BindingActivity
import com.sopt.umbba_android.util.setTimeInterval

class SetTimeActivity : BindingActivity<ActivitySetTimeBinding>(R.layout.activity_set_time) {
class SetTimeActivity : BindingActivity<ActivitySetTimeBinding>(R.layout.activity_set_time),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

binding.clickListener = this
customTimePickerInterval()
setDefaultTime()
}

override fun onClick(view: View?) {
when (view?.id) {
R.id.iv_basic_back -> finish()
}
}

private fun customTimePickerInterval() {
binding.tpTime.setTimeInterval(30)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
package com.sopt.umbba_android.presentation.qna

import android.os.Bundle
import android.view.View
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivityAnswerBinding
import com.sopt.umbba_android.util.binding.BindingActivity

class AnswerActivity: BindingActivity<ActivityAnswerBinding>(R.layout.activity_answer) {
class AnswerActivity : BindingActivity<ActivityAnswerBinding>(R.layout.activity_answer),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.clickListener = this
}

override fun onClick(view: View?) {
when (view?.id) {
R.id.iv_qna_back -> TODO("진짜 뒤로갈거냐는 Dialog 띄우기 ")
R.id.iv_check -> TODO("답변 이거 맞냐고 확인하는 Dialog 띄우기")
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sopt.umbba_android.presentation.qna

import android.content.Intent
import android.graphics.BlurMaskFilter
import android.os.Bundle
import android.view.View
Expand All @@ -9,13 +10,25 @@ import com.sopt.umbba_android.util.binding.BindingActivity


class QuestionAnswerActivity :
BindingActivity<ActivityQuestionAnswerBinding>(R.layout.activity_question_answer) {
BindingActivity<ActivityQuestionAnswerBinding>(R.layout.activity_question_answer),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setBlurText(true)
binding.clickListener = this
setBlurText(false)
setClickEvent()
}

override fun onClick(view: View?) {
when (view?.id) {
R.id.iv_qna_back -> finish()
}
}

private fun setClickEvent() {
with(binding) {
btnAnswer.setOnClickListener {
setBlurText(false) // 임시 블러 테스트
startActivity(Intent(this@QuestionAnswerActivity, AnswerActivity::class.java))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
package com.sopt.umbba_android.presentation.setting

import android.os.Bundle
import android.view.View
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivityDeleteAccountBinding
import com.sopt.umbba_android.util.binding.BindingActivity

class DeleteAccountActivity : BindingActivity<ActivityDeleteAccountBinding>(R.layout.activity_delete_account){
class DeleteAccountActivity :
BindingActivity<ActivityDeleteAccountBinding>(R.layout.activity_delete_account),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.clickListener = this
}

override fun onClick(view: View?) {
when (view?.id) {
R.id.iv_basic_back -> {
finish()
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
package com.sopt.umbba_android.presentation.setting

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.ActivityManageAccountBinding
import com.sopt.umbba_android.util.binding.BindingActivity

class ManageAccountActivity: BindingActivity<ActivityManageAccountBinding>(R.layout.activity_manage_account) {
class ManageAccountActivity :
BindingActivity<ActivityManageAccountBinding>(R.layout.activity_manage_account),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.clickListener = this
setClickEvent()
}

override fun onClick(view: View?) {
when (view?.id) {
R.id.iv_basic_back -> finish()
}
}

private fun setClickEvent() {
with(binding) {
clLogout.setOnClickListener {
TODO("서버 로그아웃 API 연결")
}
clDeleteAccount.setOnClickListener {
startActivity(Intent(this@ManageAccountActivity, DeleteAccountActivity::class.java))
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
package com.sopt.umbba_android.presentation.setting

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.sopt.umbba_android.R
import com.sopt.umbba_android.databinding.FragmentSettingBinding
import com.sopt.umbba_android.util.binding.BindingFragment

class SettingFragment:BindingFragment<FragmentSettingBinding>(R.layout.fragment_setting) {
class SettingFragment : BindingFragment<FragmentSettingBinding>(R.layout.fragment_setting) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setClickEvent()
}

private fun setClickEvent() {
with(binding) {
clManageAccount.setOnClickListener {
startActivity(Intent(requireActivity(), ManageAccountActivity::class.java))
}
clAboutUmbba.setOnClickListener {
TODO("엄빠소개 노션으로 이동하도록 만들기. Uri 연결하기")
}
clTos.setOnClickListener {
TODO("이용약관 노션으로 이동하도록 만들기. Uri 연결하기")
}
clNotice.setOnClickListener {
TODO("개인정보처리방침 노션으로 이동하도록 만들기. Uri 연결하기")
}
}
}

}
4 changes: 2 additions & 2 deletions app/src/main/res/color/sel_btn_pri500_text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/umbba_white" android:state_enabled="false" />
<item android:color="@color/primary_500" android:state_enabled="true"/>
<item android:color="@color/umbba_white" android:state_enabled="true" />
<item android:color="@color/primary_500" android:state_enabled="false"/>
</selector>
4 changes: 2 additions & 2 deletions app/src/main/res/drawable/sel_btn_answer.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_gradient_btn_r50_rect" android:state_enabled="false" />
<item android:drawable="@drawable/shape_pri500_btn_stroke_r50_rect" android:state_enabled="true" />
<item android:drawable="@drawable/shape_gradient_btn_r50_rect" android:state_enabled="true" />
<item android:drawable="@drawable/shape_pri500_btn_stroke_r50_rect" android:state_enabled="false" />
</selector>
Loading

0 comments on commit d7cdb1a

Please sign in to comment.