Skip to content

Commit

Permalink
[Design/#35] 모든 화면 appbar 뒤로가기 리스너 등록
Browse files Browse the repository at this point in the history
  • Loading branch information
ss99x2002 committed Jul 10, 2023
1 parent 5bb8d82 commit c7bc900
Show file tree
Hide file tree
Showing 22 changed files with 123 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>(R.layout.fragment_home
setClickEvent()
}

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

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,20 @@
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,24 @@
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
Expand Up @@ -13,9 +13,8 @@ class AnswerActivity: BindingActivity<ActivityAnswerBinding>(R.layout.activity_a
}
override fun onClick(view: View?) {
when(view?.id){
R.id.iv_qna_back->TODO("진짜 뒤로갈거냐는 Dialog 띄우기 ")
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,24 +10,29 @@ import com.sopt.umbba_android.util.binding.BindingActivity


class QuestionAnswerActivity :
BindingActivity<ActivityQuestionAnswerBinding>(R.layout.activity_question_answer),View.OnClickListener {
BindingActivity<ActivityQuestionAnswerBinding>(R.layout.activity_question_answer),
View.OnClickListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding.clickListener=this
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))
}
}
}

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

private fun setBlurText(isBlur: Boolean) {
with(binding) {
tvAnswerOther.setLayerType(View.LAYER_TYPE_SOFTWARE, null).apply {
Expand Down
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>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/shape_switch_thumb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
</item>
<item>
<shape android:shape="oval">
<solid android:color="@color/umbba_white" />
<size
android:width="35dp"
android:height="35dp" />
<solid android:color="@color/umbba_white" />
</shape>
</item>
</layer-list>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_answer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginVertical="16dp"
app:boxStrokeWidth="0dp"
android:background="@color/white"
app:hintAnimationEnabled="false"
app:hintEnabled="false"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/layout/activity_input_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<variable
name="titleText"
type="String" />

<variable
name="clickListener"
type="android.view.View.OnClickListener" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
Expand All @@ -21,7 +25,8 @@
layout="@layout/basic_appbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:clickListener="@{clickListener}"/>

<androidx.core.widget.NestedScrollView
android:id="@+id/sv_introduce_user"
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/layout/activity_invite_code.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
<layout xmlns:app="http://schemas.android.com/apk/res-auto">

<data>
<variable
name="clickListener"
type="android.view.View.OnClickListener" />

<variable
name="titleText"
type="String" />

</data>

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
Expand All @@ -19,7 +23,8 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:titleText="@{`초대코드 입력`}" />
app:titleText="@{`초대코드 입력`}"
app:clickListener="@{clickListener}"/>

<TextView
android:id="@+id/tv_title"
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/res/layout/activity_notify_time.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<variable
name="titleText"
type="String" />
<variable
name="clickListener"
type="android.view.View.OnClickListener" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
Expand All @@ -15,7 +18,8 @@

<include
android:id="@+id/layout_appbar"
layout="@layout/basic_appbar" />
layout="@layout/basic_appbar"
app:clickListener="@{clickListener}"/>

<TextView
android:id="@+id/tv_timemachine_description"
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/layout/activity_quest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<variable
name="titleText"
type="String" />

<variable
name="clickListener"
type="android.view.View.OnClickListener" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
Expand All @@ -16,7 +20,8 @@

<include
android:id="@+id/layout_appbar"
layout="@layout/basic_appbar" />
layout="@layout/basic_appbar"
app:clickListener="@{clickListener}"/>

<TextView
android:id="@+id/tv_title"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/activity_question_answer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
android:layout_marginHorizontal="24dp"
android:layout_marginBottom="24dp"
android:background="@drawable/sel_btn_answer"
android:enabled="false"
android:stateListAnimator="@null"
android:text="@string/btn_question_answer"
android:textColor="@color/sel_btn_pri500_text"
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/layout/activity_select_family.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<variable
name="titleText"
type="String" />

<variable
name="clickListener"
type="android.view.View.OnClickListener" />

</data>

<androidx.constraintlayout.widget.ConstraintLayout
Expand All @@ -19,6 +24,7 @@
<include
android:id="@+id/layout_appbar"
layout="@layout/basic_appbar"
app:clickListener="@{clickListener}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand Down
Loading

0 comments on commit c7bc900

Please sign in to comment.