Merge change I9d12beeb into eclair

* changes:
  Change FasttrackBadgeWidget->QuickContactBadge and make public.
This commit is contained in:
Android (Google) Code Review
2009-09-30 13:00:46 -04:00
22 changed files with 204 additions and 66 deletions

View File

@ -36,12 +36,10 @@ import android.view.View.OnClickListener;
import com.android.internal.R;
/**
* Widget used to show an image with the standard fasttrack badge
* Widget used to show an image with the standard QuickContact badge
* and on-click behavior.
*
* @hide
*/
public class FasttrackBadgeWidget extends ImageView implements OnClickListener {
public class QuickContactBadge extends ImageView implements OnClickListener {
private Uri mContactUri;
private String mContactEmail;
@ -74,22 +72,22 @@ public class FasttrackBadgeWidget extends ImageView implements OnClickListener {
public FasttrackBadgeWidget(Context context) {
public QuickContactBadge(Context context) {
this(context, null);
}
public FasttrackBadgeWidget(Context context, AttributeSet attrs) {
public QuickContactBadge(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public FasttrackBadgeWidget(Context context, AttributeSet attrs, int defStyle) {
public QuickContactBadge(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
TypedArray a =
context.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.FasttrackBadgeWidget, defStyle, 0);
com.android.internal.R.styleable.QuickContactBadge, defStyle, 0);
mMode = a.getInt(com.android.internal.R.styleable.FasttrackBadgeWidget_fasttrackWindowSize,
mMode = a.getInt(com.android.internal.R.styleable.QuickContactBadge_quickContactWindowSize,
FastTrack.MODE_MEDIUM);
a.recycle();
@ -105,8 +103,8 @@ public class FasttrackBadgeWidget extends ImageView implements OnClickListener {
}
/**
* Assign the contact uri that this fasttrack badge should be associated
* with. Note that this is only used for displaying the fasttrack window and
* Assign the contact uri that this QuickContactBadge should be associated
* with. Note that this is only used for displaying the QuickContact window and
* won't bind the contact's photo for you.
*
* @param contactUri Either a {@link Contacts#CONTENT_URI} or
@ -122,7 +120,7 @@ public class FasttrackBadgeWidget extends ImageView implements OnClickListener {
private void onContactUriChanged() {
if (mContactUri == null && mContactEmail == null && mContactPhone == null) {
if (mNoBadgeBackground == null) {
mNoBadgeBackground = getResources().getDrawable(R.drawable.fasttrack_nobadge);
mNoBadgeBackground = getResources().getDrawable(R.drawable.quickcontact_nobadge);
}
setBackgroundDrawable(mNoBadgeBackground);
} else {
@ -173,7 +171,7 @@ public class FasttrackBadgeWidget extends ImageView implements OnClickListener {
}
/**
* Set the fasttrack window mode. Options are {@link FastTrack#MODE_SMALL},
* Set the QuickContact window mode. Options are {@link FastTrack#MODE_SMALL},
* {@link FastTrack#MODE_MEDIUM}, {@link FastTrack#MODE_LARGE}.
* @param size
*/