Example usage for android.graphics.drawable BitmapDrawable getBounds

List of usage examples for android.graphics.drawable BitmapDrawable getBounds

Introduction

In this page you can find the example usage for android.graphics.drawable BitmapDrawable getBounds.

Prototype

@NonNull
public final Rect getBounds() 

Source Link

Document

Return the drawable's bounds Rect.

Usage

From source file:com.example.angelina.travelapp.map.MapFragment.java

/**
 * Helper method for creating start/end graphic used
 * to display the route on the map/*  w  w w .  j a v  a 2 s .co  m*/
 * @param p - point representing location on the map
 * @param pin - BitmapDrawable to use for the returned graphic
 * @return - a graphic representing the point
 */
private Graphic generateRoutePoints(final Point p, final BitmapDrawable pin) {
    final float offsetY = convertPixelsToDp(getActivity(), pin.getBounds().bottom);
    final PictureMarkerSymbol symbol = new PictureMarkerSymbol(pin);
    symbol.setOffsetY(offsetY);
    return new Graphic(p, symbol);
}