am b439221a: Merge "QuickContactBadge shows its pressed state" into honeycomb

* commit 'b439221a5aa7c36fedb242ee9180ce46e4ad19b7':
  QuickContactBadge shows its pressed state
This commit is contained in:
Gilles Debunne
2011-01-13 10:19:30 -08:00
committed by Android Git Automerger

View File

@@ -112,6 +112,16 @@ public class QuickContactBadge extends ImageView implements OnClickListener {
mBadgeBackground = getBackground();
}
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
Drawable d = mOverlay;
if (d != null && d.isStateful()) {
d.setState(getDrawableState());
invalidate();
}
}
private void init() {
mQueryHandler = new QueryHandler(mContext.getContentResolver());
setOnClickListener(this);
@@ -130,7 +140,8 @@ public class QuickContactBadge extends ImageView implements OnClickListener {
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (mOverlay == null || mOverlay.getIntrinsicWidth() == 0 || mOverlay.getIntrinsicHeight() == 0) {
if (mOverlay == null || mOverlay.getIntrinsicWidth() == 0 ||
mOverlay.getIntrinsicHeight() == 0) {
return; // nothing to draw
}