Skip to content

Commit

Permalink
[MOD/#46] 텍스트 추출 버튼 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
b1urrrr committed Jan 13, 2023
1 parent 2727851 commit 4df4e9e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ import android.os.Bundle
import android.view.View
import androidx.fragment.app.viewModels
import com.keyneez.presentation.ocr.OcrActivity
import com.keyneez.presentation.ocr.dialog.OcrResultViewModel.Companion.CHECK_FAIL_CODE
import com.keyneez.presentation.ocr.guide.OcrGuideActivity
import com.keyneez.util.UiState
import com.keyneez.util.binding.BindingBottomSheetDialog
import com.keyneez.util.extension.hideKeyboard
import com.keyneez.util.extension.setOnSingleClickListener
import com.keyneez.util.extension.showSnackbar
import com.keyneez.util.extension.showToast
import com.lab.keyneez.R
import com.lab.keyneez.databinding.BotSheetOcrResultBinding
import dagger.hilt.android.AndroidEntryPoint
import timber.log.Timber

@AndroidEntryPoint
class OcrResultFragment :
Expand Down Expand Up @@ -65,10 +68,17 @@ class OcrResultFragment :
}
requireActivity().finish()
}
is UiState.Failure -> requireContext().showSnackbar(
binding.root,
getString(R.string.msg_error)
)
is UiState.Failure -> {
when (it.code) {
CHECK_FAIL_CODE -> {
requireContext().showToast(getString(R.string.ocr_result_check_fail_msg))
}
else -> requireContext().showSnackbar(
binding.root,
getString(R.string.msg_error)
)
}
}
is UiState.Error -> requireContext().showSnackbar(
binding.root,
getString(R.string.msg_error)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
<string name="ocr_result_description">아래의 정보가 맞나요?</string>
<string name="ocr_result_student_id">학생증</string>
<string name="ocr_result_youth_id">청소년증</string>
<string name="ocr_result_check_fail_msg">회원 정보와 일치하지 않습니다.</string>

// ocr complete
<string name="ocr_complete_description">%s님의\nID를 발급했어요!</string>
Expand Down

0 comments on commit 4df4e9e

Please sign in to comment.