Skip to content

Commit

Permalink
[Design/#35] custom appbar 클릭 리스너 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
ss99x2002 committed Jul 10, 2023
1 parent f420447 commit 51f2398
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
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
Expand Up @@ -9,9 +9,10 @@ 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)
binding.clickListener=this
setBlurText(true)
with(binding) {
btnAnswer.setOnClickListener {
Expand All @@ -20,6 +21,12 @@ class QuestionAnswerActivity :
}
}

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
2 changes: 1 addition & 1 deletion app/src/main/res/layout/qna_appbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
android:background="@color/umbba_white">

<ImageView
android:id="@+id/iv_back"
android:id="@+id/iv_qna_back"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
Expand Down

0 comments on commit 51f2398

Please sign in to comment.