Fixed ArrayAdapter.addAll for 2.3
This commit is contained in:
parent
c34024f7f4
commit
28a0f59bb5
7 changed files with 32 additions and 10 deletions
|
@ -67,7 +67,9 @@ public class ActiveDownloadsDialogFragment extends DialogFragment implements Dow
|
|||
if(items.isEmpty()) {
|
||||
dlgFragment.dismissAllowingStateLoss();
|
||||
}
|
||||
addAll(context.getDownloadThread().getCurrentDownloadingItems());
|
||||
for (IndexItem item : context.getDownloadThread().getCurrentDownloadingItems()) {
|
||||
add(item);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -62,7 +62,9 @@ public class CountrySelectionFragment extends BaseOsmAndDialogFragment {
|
|||
ListView listView = (ListView) view.findViewById(android.R.id.list);
|
||||
final ArrayAdapter<CountryItem> adapter = new ListAdapter(getListItemIcon());
|
||||
if (countryItems.size() > 0) {
|
||||
adapter.addAll(countryItems);
|
||||
for (CountryItem item : countryItems) {
|
||||
adapter.add(item);
|
||||
}
|
||||
}
|
||||
listView.setAdapter(adapter);
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
|
|
@ -31,9 +31,13 @@ public abstract class SearchSelectionFragment extends BaseOsmAndDialogFragment {
|
|||
ListView listView = (ListView) view.findViewById(android.R.id.list);
|
||||
final ArrayAdapter<String> adapter = new ListAdapter(getActivity(), getListItemIcon());
|
||||
if (getArray() != null) {
|
||||
adapter.addAll(getArray());
|
||||
for (String s : getArray()) {
|
||||
adapter.add(s);
|
||||
}
|
||||
} else if (getList() != null) {
|
||||
adapter.addAll(getList());
|
||||
for (String s : getList()) {
|
||||
adapter.add(s);
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("Either getArray() or getList() must return non null value.");
|
||||
}
|
||||
|
|
|
@ -41,7 +41,11 @@ public class UsersReportFragment extends BaseOsmAndDialogFragment {
|
|||
|
||||
@Override
|
||||
public void onResponse(RankingUserByMonthResponse response) {
|
||||
adapter.addAll(Arrays.asList(response.rows));
|
||||
if (response != null && response.rows != null) {
|
||||
for (UserRankingByMonth rankingByMonth : response.rows) {
|
||||
adapter.add(rankingByMonth);
|
||||
}
|
||||
}
|
||||
view.findViewById(R.id.progress).setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -676,7 +676,9 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
|||
|
||||
final Spinner fromSpinner = ((Spinner) view.findViewById(R.id.FromSpinner));
|
||||
RouteSpinnerArrayAdapter fromAdapter = new RouteSpinnerArrayAdapter(view.getContext());
|
||||
fromAdapter.addAll(fromActions);
|
||||
for (RouteSpinnerRow row : fromActions) {
|
||||
fromAdapter.add(row);
|
||||
}
|
||||
fromSpinner.setAdapter(fromAdapter);
|
||||
if (start != null) {
|
||||
fromSpinner.setSelection(startPos);
|
||||
|
@ -730,7 +732,9 @@ public class MapRouteInfoMenu implements IRouteInformationListener {
|
|||
addMarkersToSpinner(toActions);
|
||||
|
||||
RouteSpinnerArrayAdapter toAdapter = new RouteSpinnerArrayAdapter(view.getContext());
|
||||
toAdapter.addAll(toActions);
|
||||
for (RouteSpinnerRow row : toActions) {
|
||||
toAdapter.add(row);
|
||||
}
|
||||
toSpinner.setAdapter(toAdapter);
|
||||
return toSpinner;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,9 @@ public class MapMarkerSelectionFragment extends BaseOsmAndDialogFragment {
|
|||
final ArrayAdapter<MapMarker> adapter = new MapMarkersListAdapter();
|
||||
List<MapMarker> markers = getMyApplication().getMapMarkersHelper().getActiveMapMarkers();
|
||||
if (markers.size() > 0) {
|
||||
adapter.addAll(markers);
|
||||
for (MapMarker marker : markers) {
|
||||
adapter.add(marker);
|
||||
}
|
||||
}
|
||||
listView.setAdapter(adapter);
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
|
|
@ -250,14 +250,18 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
|
|||
|
||||
public void setTagData(String[] tags) {
|
||||
tagAdapter.clear();
|
||||
tagAdapter.addAll(tags);
|
||||
for (String s : tags) {
|
||||
tagAdapter.add(s);
|
||||
}
|
||||
tagAdapter.sort(String.CASE_INSENSITIVE_ORDER);
|
||||
tagAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setValueData(String[] values) {
|
||||
valueAdapter.clear();
|
||||
valueAdapter.addAll(values);
|
||||
for (String s : values) {
|
||||
valueAdapter.add(s);
|
||||
}
|
||||
valueAdapter.sort(String.CASE_INSENSITIVE_ORDER);
|
||||
valueAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue