diff --git a/res/drawable-hdpi/bg_dragdrop.9.png b/res/drawable-hdpi/bg_dragdrop.9.png new file mode 100644 index 000000000..b8c98ddd4 Binary files /dev/null and b/res/drawable-hdpi/bg_dragdrop.9.png differ diff --git a/res/drawable-hdpi/drag_background_holo.9.png b/res/drawable-hdpi/drag_background_holo.9.png deleted file mode 100644 index 40f131f44..000000000 Binary files a/res/drawable-hdpi/drag_background_holo.9.png and /dev/null differ diff --git a/res/drawable-hdpi/list_activated_holo.9.png b/res/drawable-hdpi/list_activated_holo.9.png new file mode 100644 index 000000000..12a379ba2 Binary files /dev/null and b/res/drawable-hdpi/list_activated_holo.9.png differ diff --git a/res/drawable-mdpi/bg_dragdrop.9.png b/res/drawable-mdpi/bg_dragdrop.9.png new file mode 100644 index 000000000..c0d46beb3 Binary files /dev/null and b/res/drawable-mdpi/bg_dragdrop.9.png differ diff --git a/res/drawable-mdpi/drag_background_holo.9.png b/res/drawable-mdpi/drag_background_holo.9.png deleted file mode 100644 index 63a1f5a66..000000000 Binary files a/res/drawable-mdpi/drag_background_holo.9.png and /dev/null differ diff --git a/res/drawable-mdpi/list_activated_holo.9.png b/res/drawable-mdpi/list_activated_holo.9.png new file mode 100644 index 000000000..f162c9ac2 Binary files /dev/null and b/res/drawable-mdpi/list_activated_holo.9.png differ diff --git a/res/values/colors.xml b/res/values/colors.xml index d3082b551..cb6725303 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -49,10 +49,9 @@ - #ffd9e3bd - #ffffffff - #ffbedc62 - #ffff0000 + #ff999999 + #00ffffff + #fff10000 #0d0d0d diff --git a/src/com/android/email/activity/MailboxListFragment.java b/src/com/android/email/activity/MailboxListFragment.java index 797486820..b1a20634f 100644 --- a/src/com/android/email/activity/MailboxListFragment.java +++ b/src/com/android/email/activity/MailboxListFragment.java @@ -33,6 +33,7 @@ import android.content.ClipDescription; import android.content.Loader; import android.content.res.Resources; import android.database.Cursor; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.util.Log; @@ -74,7 +75,7 @@ public class MailboxListFragment extends ListFragment implements OnItemClickList // Colors used for drop targets private static Integer sDropTrashColor; - private static Integer sDropActiveColor; + private static Drawable sDropActiveDrawable; private long mLastLoadedAccountId = -1; private long mAccountId = -1; @@ -109,7 +110,7 @@ public class MailboxListFragment extends ListFragment implements OnItemClickList private Utility.ListStateSaver mSavedListState; private MailboxesAdapter.Callback mMailboxesAdapterCallback = new MailboxesAdapter.Callback() { - @Override + @Override public void onSetDropTargetBackground(MailboxListItem listItem) { listItem.setDropTargetBackground(mDragInProgress, mDragItemMailboxId); } @@ -163,8 +164,8 @@ public class MailboxListFragment extends ListFragment implements OnItemClickList } if (sDropTrashColor == null) { Resources res = getResources(); - sDropTrashColor = res.getColor(R.color.mailbox_drop_target_destructive_color); - sDropActiveColor = res.getColor(R.color.mailbox_drop_target_active_color); + sDropTrashColor = res.getColor(R.color.mailbox_drop_destructive_bg_color); + sDropActiveDrawable = res.getDrawable(R.drawable.list_activated_holo); } } @@ -508,7 +509,7 @@ public class MailboxListFragment extends ListFragment implements OnItemClickList newTarget.setBackgroundColor(sDropTrashColor); } else if (newTarget.isDropTarget(mDragItemMailboxId)) { Log.d("onDragLocation", "=== Mailbox " + newTarget.mMailboxId + " TARGET"); - newTarget.setBackgroundColor(sDropActiveColor); + newTarget.setBackgroundDrawable(sDropActiveDrawable); } else { Log.d("onDragLocation", "=== Mailbox " + newTarget.mMailboxId + " (CALL)"); targetAdapterPosition = NO_DROP_TARGET; diff --git a/src/com/android/email/activity/MailboxListItem.java b/src/com/android/email/activity/MailboxListItem.java index 78414a60a..df656507d 100644 --- a/src/com/android/email/activity/MailboxListItem.java +++ b/src/com/android/email/activity/MailboxListItem.java @@ -25,17 +25,22 @@ import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.RelativeLayout; +import android.widget.TextView; public class MailboxListItem extends RelativeLayout { // Colors used for drop targets - private static Integer sDropAvailableColor; - private static Integer sDropUnavailableColor; + private static Integer sDropUnavailableFgColor; + private static Integer sDropAvailableBgColor; + private static Integer sTextPrimaryColor; + private static Integer sTextSecondaryColor; public long mMailboxId; public Integer mMailboxType; public MailboxesAdapter mAdapter; private Drawable mBackground; + private TextView mLabelName; + private TextView mLabelCount; public MailboxListItem(Context context) { super(context); @@ -53,11 +58,15 @@ public class MailboxListItem extends RelativeLayout { protected void onFinishInflate() { super.onFinishInflate(); mBackground = getBackground(); - if (sDropAvailableColor == null) { + if (sDropAvailableBgColor == null) { Resources res = getResources(); - sDropAvailableColor = res.getColor(R.color.mailbox_drop_available_color); - sDropUnavailableColor = res.getColor(R.color.mailbox_drop_unavailable_color); + sDropAvailableBgColor = res.getColor(R.color.mailbox_drop_available_bg_color); + sDropUnavailableFgColor = res.getColor(R.color.mailbox_drop_unavailable_fg_color); + sTextPrimaryColor = res.getColor(R.color.text_primary_color); + sTextSecondaryColor = res.getColor(R.color.text_secondary_color); } + mLabelName = (TextView)findViewById(R.id.mailbox_name); + mLabelCount = (TextView)findViewById(R.id.message_count); } public boolean isDropTarget(long itemMailbox) { @@ -67,18 +76,18 @@ public class MailboxListItem extends RelativeLayout { return !ArrayUtils.contains(Mailbox.INVALID_DROP_TARGETS, mMailboxType); } - public boolean setDropTargetBackground(boolean dragInProgress, long itemMailbox) { + public void setDropTargetBackground(boolean dragInProgress, long itemMailbox) { if (dragInProgress) { if (isDropTarget(itemMailbox)) { - setBackgroundColor(sDropAvailableColor); - return true; + setBackgroundColor(sDropAvailableBgColor); } else { - setBackgroundColor(sDropUnavailableColor); - return false; + mLabelName.setTextColor(sDropUnavailableFgColor); + mLabelCount.setTextColor(sDropUnavailableFgColor); } } else { + mLabelName.setTextColor(sTextPrimaryColor); + mLabelCount.setTextColor(sTextSecondaryColor); setBackgroundDrawable(mBackground); - return false; } } } diff --git a/src/com/android/email/activity/MessageListFragment.java b/src/com/android/email/activity/MessageListFragment.java index 40ad92b47..f02f4a079 100644 --- a/src/com/android/email/activity/MessageListFragment.java +++ b/src/com/android/email/activity/MessageListFragment.java @@ -504,7 +504,7 @@ public class MessageListFragment extends ListFragment if (sBackground == null || mOldOrientation != newOrientation) { mOldOrientation = newOrientation; - sBackground = res.getDrawable(R.drawable.drag_background_holo); + sBackground = res.getDrawable(R.drawable.bg_dragdrop); sBackground.setBounds(0, 0, mDragWidth, mDragHeight); sDragOffset = (int)res.getDimension(R.dimen.message_list_drag_offset);