Use static library resources from chips.
Change-Id: I4261004dda1bd106d0c0ad0aec8348920ffd8c7e
This commit is contained in:
parent
68c38d119f
commit
d5109cf7f0
|
@ -29,6 +29,7 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src/com/android/email)
|
|||
LOCAL_SRC_FILES += $(call all-java-files-under, src/com/beetstra)
|
||||
LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dir))
|
||||
LOCAL_AAPT_FLAGS := --auto-add-overlay
|
||||
LOCAL_AAPT_FLAGS += --extra-packages com.android.ex.chips
|
||||
|
||||
LOCAL_STATIC_JAVA_LIBRARIES := android-common com.android.emailcommon guava android-common-chips
|
||||
|
||||
|
|
|
@ -21,25 +21,10 @@ import com.android.ex.chips.RecipientEditTextView;
|
|||
|
||||
import android.accounts.Account;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
|
||||
public class RecipientAdapter extends BaseRecipientAdapter {
|
||||
public RecipientAdapter(Context context, RecipientEditTextView list) {
|
||||
super(context);
|
||||
Resources r = context.getResources();
|
||||
Bitmap def = BitmapFactory.decodeResource(r, R.drawable.ic_contact_picture);
|
||||
list.setChipDimensions(
|
||||
r.getDrawable(R.drawable.chip_background),
|
||||
r.getDrawable(R.drawable.chip_background_selected),
|
||||
r.getDrawable(R.drawable.chip_background_invalid),
|
||||
r.getDrawable(R.drawable.chip_delete), def, R.layout.more_item,
|
||||
R.layout.chips_alternate_item,
|
||||
r.getDimension(R.dimen.chip_height),
|
||||
r.getDimension(R.dimen.chip_padding),
|
||||
r.getDimension(R.dimen.chip_text_size),
|
||||
R.layout.copy_chip_dialog_layout);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,19 +38,4 @@ public class RecipientAdapter extends BaseRecipientAdapter {
|
|||
super.setAccount(new android.accounts.Account(account.name, "unknown"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDefaultPhotoResource() {
|
||||
return R.drawable.ic_contact_picture;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getItemLayout() {
|
||||
return R.layout.chips_recipient_dropdown_item;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getWaitingForDirectorySearchLayout() {
|
||||
return R.layout.chips_waiting_for_directory_search;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue