Long value to String 2
This commit is contained in:
parent
536f9eb83a
commit
8c92180a56
@ -31,7 +31,7 @@ class QrResultFragment : Fragment(R.layout.fragment_qr_result) {
|
|||||||
if (key == QrScanDestination.REQUEST_KEY) {
|
if (key == QrScanDestination.REQUEST_KEY) {
|
||||||
val code = QrScanDestination.getDataIfExist(bundle)
|
val code = QrScanDestination.getDataIfExist(bundle)
|
||||||
if (code != null) {
|
if (code != null) {
|
||||||
viewModel.sendResult(code.toLong())
|
viewModel.sendResult(code.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ class QrResultViewModel(
|
|||||||
private val _state = MutableStateFlow<State>(State.Loading)
|
private val _state = MutableStateFlow<State>(State.Loading)
|
||||||
val state = _state.asStateFlow()
|
val state = _state.asStateFlow()
|
||||||
|
|
||||||
fun updateState(code: Long?) {
|
fun updateState(code: String?) {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
_state.emit(State.Loading)
|
_state.emit(State.Loading)
|
||||||
if (code == null) {
|
if (code == null) {
|
||||||
@ -54,7 +54,7 @@ class QrResultViewModel(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun sendResult(code : Long) {
|
fun sendResult(code : String) {
|
||||||
updateState(code)
|
updateState(code)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user