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() {
3939 .doOnSuccess {
4040 counties.clear()
4141 counties.addAll(it)
42+ counties.sortBy { c -> c.order }
4243 }
4344 .observeOn(AndroidSchedulers .mainThread())
4445 .subscribe({
@@ -54,11 +55,11 @@ class PollingStationSelectionViewModel : BaseViewModel() {
5455 val countyNames = counties.sortedBy { county -> county.order }.map { it.name }
5556
5657 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() ))
5859 } else {
5960 hadSelectedCounty = true
6061 val selectedCountyIndex = counties.indexOfFirst { it.code == countyCode }
61- countiesLiveData.postValue(Result .Success (countyNames))
62+ countiesLiveData.postValue(Result .Success (countyNames.toList() ))
6263
6364 if (selectedCountyIndex >= 0 ) {
6465 selectionLiveData.postValue(Pair (selectedCountyIndex, pollingStationNumber))
You can’t perform that action at this time.
0 commit comments