mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
Item click listener for listview
This commit is contained in:
parent
c2ccd95089
commit
9e4cc80ceb
1 changed files with 19 additions and 21 deletions
|
|
@ -23,6 +23,7 @@ import java.util.List;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
import butterknife.OnItemClick;
|
||||||
import fr.free.nrw.commons.R;
|
import fr.free.nrw.commons.R;
|
||||||
import fr.free.nrw.commons.utils.ResourceUtils;
|
import fr.free.nrw.commons.utils.ResourceUtils;
|
||||||
|
|
||||||
|
|
@ -164,10 +165,12 @@ public class NearbyListFragment extends ListFragment implements TaskListener {
|
||||||
|
|
||||||
listview.setAdapter(mAdapter);
|
listview.setAdapter(mAdapter);
|
||||||
|
|
||||||
listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
listener.onTaskFinished(result);
|
||||||
@Override
|
mAdapter.notifyDataSetChanged();
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnItemClick(R.id.listview) void onItemClicked(int position) {
|
||||||
Place place = places.get(position);
|
Place place = places.get(position);
|
||||||
LatLng placeLatLng = place.location;
|
LatLng placeLatLng = place.location;
|
||||||
|
|
||||||
|
|
@ -184,11 +187,6 @@ public class NearbyListFragment extends ListFragment implements TaskListener {
|
||||||
startActivity(mapIntent);
|
startActivity(mapIntent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
listener.onTaskFinished(result);
|
|
||||||
mAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<Place> loadAttractionsFromLocation(final LatLng curLatLng) {
|
private List<Place> loadAttractionsFromLocation(final LatLng curLatLng) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue