Dropdown items are now sorted fixes #1890
This commit is contained in:
parent
5ffcfa67d7
commit
2ad8d916ca
2 changed files with 9 additions and 0 deletions
|
@ -279,12 +279,14 @@ public class AdvancedEditPoiFragment extends Fragment
|
|||
public void setTagData(String[] tags) {
|
||||
tagAdapter.clear();
|
||||
tagAdapter.addAll(tags);
|
||||
tagAdapter.sort(String.CASE_INSENSITIVE_ORDER);
|
||||
tagAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setValueData(String[] values) {
|
||||
valueAdapter.clear();
|
||||
valueAdapter.addAll(values);
|
||||
valueAdapter.sort(String.CASE_INSENSITIVE_ORDER);
|
||||
valueAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,6 +65,7 @@ import net.osmand.util.Algorithms;
|
|||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -467,6 +468,12 @@ public class EditPoiDialogFragment extends DialogFragment {
|
|||
}
|
||||
};
|
||||
}
|
||||
adapter.sort(new Comparator<Object>() {
|
||||
@Override
|
||||
public int compare(Object lhs, Object rhs) {
|
||||
return lhs.toString().compareTo(rhs.toString());
|
||||
}
|
||||
});
|
||||
poiTypeEditText.setAdapter(adapter);
|
||||
poiTypeEditText.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
|
||||
|
|
Loading…
Reference in a new issue