Search in sources :

Example 1 with DownloadResourceGroup

use of net.osmand.plus.download.DownloadResourceGroup in project Osmand by osmandapp.

the class SearchDialogFragment method onItemClick.

@Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
    Object obj = listAdapter.getItem(position);
    if (obj instanceof DownloadResourceGroup) {
        String uniqueId = ((DownloadResourceGroup) obj).getUniqueId();
        final DownloadResourceGroupFragment regionDialogFragment = DownloadResourceGroupFragment.createInstance(uniqueId);
        ((DownloadActivity) getActivity()).showDialog(getActivity(), regionDialogFragment);
    } else if (obj instanceof IndexItem) {
        IndexItem indexItem = (IndexItem) obj;
        ItemViewHolder vh = (ItemViewHolder) v.getTag();
        View.OnClickListener ls = vh.getRightButtonAction(indexItem, vh.getClickAction(indexItem));
        ls.onClick(v);
    }
}
Also used : DownloadResourceGroup(net.osmand.plus.download.DownloadResourceGroup) BinaryMapDataObject(net.osmand.binary.BinaryMapDataObject) IndexItem(net.osmand.plus.download.IndexItem) DownloadActivity(net.osmand.plus.download.DownloadActivity)

Example 2 with DownloadResourceGroup

use of net.osmand.plus.download.DownloadResourceGroup in project Osmand by osmandapp.

the class DownloadResourceGroupFragment method onChildClick.

@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
    Object child = listAdapter.getChild(groupPosition, childPosition);
    if (child instanceof DownloadResourceGroup) {
        String uniqueId = ((DownloadResourceGroup) child).getUniqueId();
        final DownloadResourceGroupFragment regionDialogFragment = DownloadResourceGroupFragment.createInstance(uniqueId);
        ((DownloadActivity) getActivity()).showDialog(getActivity(), regionDialogFragment);
        return true;
    } else if (child instanceof IndexItem) {
        IndexItem indexItem = (IndexItem) child;
        ItemViewHolder vh = (ItemViewHolder) v.getTag();
        OnClickListener ls = vh.getRightButtonAction(indexItem, vh.getClickAction(indexItem));
        ls.onClick(v);
        return true;
    }
    return false;
}
Also used : DownloadResourceGroup(net.osmand.plus.download.DownloadResourceGroup) OnClickListener(android.view.View.OnClickListener) JSONObject(org.json.JSONObject) IndexItem(net.osmand.plus.download.IndexItem) DownloadActivity(net.osmand.plus.download.DownloadActivity)

Aggregations

DownloadActivity (net.osmand.plus.download.DownloadActivity)2 DownloadResourceGroup (net.osmand.plus.download.DownloadResourceGroup)2 IndexItem (net.osmand.plus.download.IndexItem)2 OnClickListener (android.view.View.OnClickListener)1 BinaryMapDataObject (net.osmand.binary.BinaryMapDataObject)1 JSONObject (org.json.JSONObject)1