public static LayerDrawable createDTRatingMarker(final Resources res, final boolean supportsRating, final float difficulty, final float terrain, final float scaling) {
        final Drawable background = new ScalableDrawable(ViewUtils.getDrawable(R.drawable.marker_empty, true), scaling);
        final InsetsBuilder insetsBuilder = new InsetsBuilder(res, background.getIntrinsicWidth(), background.getIntrinsicHeight(), true);
        insetsBuilder.withInset(new InsetBuilder(background));
        int layers = 4;

        if (!supportsRating) {
            layers = 2;
            insetsBuilder.withInset(new InsetBuilder(R.drawable.marker_rating_notsupported, scaling));
        } else if (difficulty < 0.5 && terrain < 0.5) {
            layers = 2;
            insetsBuilder.withInset(new InsetBuilder(R.drawable.marker_rating_notavailable, scaling));
        } else {
            final String packageName = CgeoApplication.getInstance().getPackageName();
            insetsBuilder.withInset(new InsetBuilder(getDTRatingMarkerSection(res, packageName, "d", difficulty, scaling)));
            insetsBuilder.withInset(new InsetBuilder(getDTRatingMarkerSection(res, packageName, "t", terrain, scaling)));

            insetsBuilder.withInset(new InsetBuilder(R.drawable.marker_rating_fg, scaling));
        }

        return buildLayerDrawable(insetsBuilder, layers, 0);
    }
Create a LayerDrawable showing the caches difficulty and terrain rating. If the connector doesn't support D/T show a "-" instead, if the info is missing (not loaded) a "?"
@param res           Resources bundle
@param difficulty    Difficulty rating
@param terrain       Terrain rating
@return              LayerDrawable composed of round background and foreground showing the ratings
main/src/main/java/cgeo/geocaching/utils/MapMarkerUtils.java