Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.view.View; import android.view.ViewGroup; public class Main { public static void drawBottomAlignItem(Canvas canvas, Drawable drawable, View child, ViewGroup.MarginLayoutParams params) { final int left = child.getLeft() - params.leftMargin; final int right = child.getRight() + params.rightMargin; final int top = child.getBottom() + params.bottomMargin; final int bottom = top + drawable.getIntrinsicHeight(); drawable.setBounds(left, top, right, bottom); drawable.draw(canvas); } }