Skip to content

Instantly share code, notes, and snippets.

@p-fischer
p-fischer / DialogUtils.java
Last active October 26, 2018 08:58
Create a fullscreen dialog with margins - either in normal or in immersive mode
package com.exmample.utils;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
@p-fischer
p-fischer / MapboxExtensions.kt
Last active March 26, 2019 14:43
Mapbox dragging
fun MapboxMap.resolveSymbolId(location: LatLng) = resolveAnnotationId(location, SymbolManager.ID_GEOJSON_LAYER)
fun MapboxMap.resolveSymbolId(screenLocation: PointF) = resolveAnnotationId(screenLocation, SymbolManager.ID_GEOJSON_LAYER)
/**
* Check if an annotation is located at a given coordinate.
*
* @param location click location in real world coordinates
*
* @return annotation ID if an annotation exists, null otherwise