I have created a hovering dialog to show to the user, but I am wondering would it be possible to show a dialog and still be able to do things in the outside the dialog?
Thanks in advance for any help! :D
This is my MainActivity:
mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng point) {
if(clicked)
{
List<Address> addresses = new ArrayList<>();
try {
addresses = geocoder.getFromLocation(point.latitude, point.longitude,1);
} catch (IOException e) {
e.printStackTrace();
}
android.location.Address address = addresses.get(0);
if (address != null) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < address.getMaxAddressLineIndex(); i++){
sb.append(address.getAddressLine(i) + " ");
}
dialog = new Dialog(context);
dialog.setContentView(R.layout.map_dialog);
dialog.setTitle("IS THIS YOUR LOCATION?");
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(false);
text = (TextView) dialog.findViewById(R.id.textLocations);
text.setText(sb.toString());
dialog.show();
Window window = dialog.getWindow();
WindowManager.LayoutParams params = window.getAttributes();
params.gravity = Gravity.BOTTOM;
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
window.setAttributes(params);
}
mMap.clear();
mMap.addMarker(new MarkerOptions().position(point).draggable(false));
mMap.moveCamera(CameraUpdateFactory.newLatLng(point));
}
}
});