Skip to content

Commit

Permalink
๐Ÿž QA ๋ฐ˜์˜ | ๊ฒ€์ƒ‰์–ด ์œ ์ง€, ๋ทฐ ๊ฒน์น˜๋Š” ๋ฌธ์ œ ์ˆ˜์ •, ์˜ค๋ฅ˜ ์‹ ๊ณ  SoftKeyboard hide ๊ธฐ๋Šฅ ์ถ”๊ฐ€ (#38)
Browse files Browse the repository at this point in the history
* ๐Ÿซก ๋ทฐ ๊ฒน์น˜๋Š” ๋ฌธ์ œ ์ˆ˜์ • & ๊ฒ€์ƒ‰์–ด Clear ์ œ๊ฑฐ

* ๐Ÿซก ์˜ค๋ฅ˜ ์‹ ๊ณ  | Hide SoftKeyboard ๊ธฐ๋Šฅ ์ถ”๊ฐ€
  • Loading branch information
moondev03 authored Sep 25, 2024
1 parent ba89e67 commit b4ae534
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,14 @@ class CommonNoticeFragment(
binding.spinnerCampus.visibility = View.GONE
binding.groupNoticeSearchView.visibility = View.GONE
binding.btnBack.visibility = View.GONE
binding.etSearch.text.clear()
}
is UiState.Success -> {
commonNoticeAdapter.submitList(state.data)
binding.groupNoticeSearchView.visibility = View.VISIBLE
binding.tvEmptyView.visibility = View.GONE
binding.btnBack.visibility = View.VISIBLE
binding.llNoticePage.visibility = View.GONE
binding.tvSearchNoticeResult.text = "'${binding.etSearch.text}'์ด(๊ฐ€) ํฌํ•จ๋œ ๊ณต์ง€์‚ฌํ•ญ (${state.data.size}๊ฐœ)"
binding.etSearch.text.clear()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package com.neverland.thinkerbell.view.setting

import android.graphics.drawable.ColorDrawable
import android.text.Editable
import android.text.InputType
import android.text.TextWatcher
import android.view.View
import android.view.inputmethod.EditorInfo
import androidx.core.content.ContextCompat
import androidx.fragment.app.viewModels
import com.neverland.thinkerbell.R
Expand All @@ -23,18 +25,20 @@ class ErrorReportFragment : BaseFragment<FragmentErrorReportBinding>() {
hideBottomNavigation()
setStatusBarColor(R.color.primary1, true)
}
binding.etReport.setRawInputType(InputType.TYPE_CLASS_TEXT)
}

override fun setObserver() {
super.setObserver()

viewModel.uiState.observe(viewLifecycleOwner){
when(it){
viewModel.uiState.observe(viewLifecycleOwner) {
when (it) {
is UiState.Loading -> {}
is UiState.Empty -> {}
is UiState.Error -> {
showToast(it.exception.message ?: "Unknown error")
}

is UiState.Success -> {
showToast(it.data)
requireActivity().supportFragmentManager.popBackStack()
Expand All @@ -46,8 +50,22 @@ class ErrorReportFragment : BaseFragment<FragmentErrorReportBinding>() {
override fun initListener() {
super.initListener()

binding.root.setOnClickListener {
hideKeyboard()
binding.etReport.clearFocus()
}
binding.btnBack.setOnClickListener { requireActivity().supportFragmentManager.popBackStack() }

binding.etReport.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_DONE) {
hideKeyboard()
binding.etReport.clearFocus()
true
} else {
false
}
}

binding.etReport.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
Expand All @@ -56,14 +74,32 @@ class ErrorReportFragment : BaseFragment<FragmentErrorReportBinding>() {
if (len >= 10) {
binding.tvReportComment.visibility = View.GONE

binding.btnSendReport.setTextColor(ContextCompat.getColor(requireContext(), R.color.primary2))
binding.btnSendReport.background = ContextCompat.getDrawable(requireContext(), R.drawable.shape_keyword_add_button_bg)
binding.btnSendReport.setTextColor(
ContextCompat.getColor(
requireContext(),
R.color.primary2
)
)
binding.btnSendReport.background = ContextCompat.getDrawable(
requireContext(),
R.drawable.shape_keyword_add_button_bg
)
binding.btnSendReport.isClickable = true
} else {
binding.tvReportComment.visibility = View.VISIBLE

binding.btnSendReport.setTextColor(ContextCompat.getColor(requireContext(), R.color.red_gray_100))
binding.btnSendReport.background = ColorDrawable(ContextCompat.getColor(requireContext(), R.color.red_gray_300))
binding.btnSendReport.setTextColor(
ContextCompat.getColor(
requireContext(),
R.color.red_gray_100
)
)
binding.btnSendReport.background = ColorDrawable(
ContextCompat.getColor(
requireContext(),
R.color.red_gray_300
)
)
binding.btnSendReport.isClickable = false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@
app:layout_constraintTop_toBottomOf="@id/tv_subtitle_report"
android:layout_marginTop="12dp"

android:imeOptions="actionDone"
android:inputType="textMultiLine"
android:maxLength="200"

android:padding="12dp"
android:gravity="top|start"
style="@style/Paragraph_Medium"
android:textColor="@color/primary3"
android:hint="์–ด๋–ค ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‚˜์š”?"
android:textColorHint="@color/red_gray_400"
android:inputType="textMultiLine"
android:maxLength="300"

android:background="@drawable/shape_error_report_bg"/>

Expand Down

0 comments on commit b4ae534

Please sign in to comment.