1

I have a map in my app and in map I am creating a cluster of nearby requests locations. Also,I am opening a custom dialog on ClusterClick which shows all the requests in that cluster. All this is working perfectly. I only want to position dialog below/above cluster so that cluster is also visible with dialog. Please tell me how to do it. Adding code of creating cluster and dialog

cluster creation code

mClusterManager.setRenderer(new MyClusterRenderer(getActivity(), map, mClusterManager));
    map.setOnMarkerClickListener(mClusterManager);
    mClusterManager
            .setOnClusterClickListener(new ClusterManager.OnClusterClickListener<MyItem>() {
                @Override
                public boolean onClusterClick(Cluster<MyItem> cluster) {
                    clickedCluster = cluster;
                    showPopUp(clickedCluster);
                    return false;
                }
            });

Dialog creation code

public void showPopUp(Cluster<MyItem>myItemCluster)
{
   dialog = new Dialog(getActivity());
    dialog.setContentView(R.layout.popup_map);

    ListView lv_cluster= (ListView) dialog.findViewById(R.id.lv_cluster);
    clusterItems.addAll(myItemCluster.getItems());
    ClusterAdapter clusterAdapter=new ClusterAdapter(getActivity(),clusterItems);
    lv_cluster.setAdapter(clusterAdapter);
    dialog.show();
    dialog.setCanceledOnTouchOutside(false);
    dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            clusterItems.clear();
        }
    });
    //clusterItems.clear();
}
Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84

0 Answers0