File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
app/src/main/java/ro/code4/monitorizarevot/ui/section/selection Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ class PollingStationSelectionViewModel : BaseViewModel() {
39
39
.doOnSuccess {
40
40
counties.clear()
41
41
counties.addAll(it)
42
+ counties.sortBy { c -> c.order }
42
43
}
43
44
.observeOn(AndroidSchedulers .mainThread())
44
45
.subscribe({
@@ -54,11 +55,11 @@ class PollingStationSelectionViewModel : BaseViewModel() {
54
55
val countyNames = counties.sortedBy { county -> county.order }.map { it.name }
55
56
56
57
if (countyCode.isNullOrBlank()) {
57
- countiesLiveData.postValue(Result .Success (listOf (app.getString(R .string.polling_station_spinner_choose)) + countyNames))
58
+ countiesLiveData.postValue(Result .Success (listOf (app.getString(R .string.polling_station_spinner_choose)) + countyNames.toList() ))
58
59
} else {
59
60
hadSelectedCounty = true
60
61
val selectedCountyIndex = counties.indexOfFirst { it.code == countyCode }
61
- countiesLiveData.postValue(Result .Success (countyNames))
62
+ countiesLiveData.postValue(Result .Success (countyNames.toList() ))
62
63
63
64
if (selectedCountyIndex >= 0 ) {
64
65
selectionLiveData.postValue(Pair (selectedCountyIndex, pollingStationNumber))
You can’t perform that action at this time.
0 commit comments