summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Lemieux <jplemieux@google.com>2014-10-01 23:01:29 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-01 23:01:30 +0000
commit777885a47872772e4953dae6dc18023e310e41b6 (patch)
treedf2e687a7bd522d5ef48f8b240d3b478b093c801 /src
parent456bec29f542b4462442bfbf594f0adf1e108489 (diff)
parent4958af88fe77f0c5c92ab0f7e1e6cbba645c3180 (diff)
downloadandroid_packages_apps_UnifiedEmail-777885a47872772e4953dae6dc18023e310e41b6.tar.gz
android_packages_apps_UnifiedEmail-777885a47872772e4953dae6dc18023e310e41b6.tar.bz2
android_packages_apps_UnifiedEmail-777885a47872772e4953dae6dc18023e310e41b6.zip
Merge "Remove wide-mode and normal-mode from TL" into ub-gmail-ur14-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/mail/browse/ConversationItemView.java12
-rw-r--r--src/com/android/mail/browse/ConversationItemViewCoordinates.java58
2 files changed, 9 insertions, 61 deletions
diff --git a/src/com/android/mail/browse/ConversationItemView.java b/src/com/android/mail/browse/ConversationItemView.java
index a43b5f372..2010be0d8 100644
--- a/src/com/android/mail/browse/ConversationItemView.java
+++ b/src/com/android/mail/browse/ConversationItemView.java
@@ -662,8 +662,7 @@ public class ConversationItemView extends View
}
mHeader.viewWidth = mViewWidth;
- mConfig.updateWidth(wSize).setViewMode(currentMode)
- .setLayoutDirection(ViewCompat.getLayoutDirection(this));
+ mConfig.updateWidth(wSize).setLayoutDirection(ViewCompat.getLayoutDirection(this));
Resources res = getResources();
mHeader.standardScaledDimen = res.getDimensionPixelOffset(R.dimen.standard_scaled_dimen);
@@ -764,8 +763,8 @@ public class ConversationItemView extends View
Context context = getContext();
mHeader.messageInfoString = SendersView
.createMessageInfo(context, mHeader.conversation, true);
- int maxChars = ConversationItemViewCoordinates.getSendersLength(context,
- mCoordinates.getMode(), mHeader.conversation.hasAttachments);
+ final int maxChars = ConversationItemViewCoordinates.getSendersLength(context,
+ mHeader.conversation.hasAttachments);
mHeader.mSenderAvatarModel.clear();
mHeader.displayableNames.clear();
@@ -812,9 +811,8 @@ public class ConversationItemView extends View
}
if (mCoordinates.contactImagesWidth <= 0 || mCoordinates.contactImagesHeight <= 0) {
LogUtils.w(LOG_TAG,
- "Contact image width(%d) or height(%d) is 0 for mode: (%d).",
- mCoordinates.contactImagesWidth, mCoordinates.contactImagesHeight,
- mCoordinates.getMode());
+ "Contact image width(%d) or height(%d) is 0",
+ mCoordinates.contactImagesWidth, mCoordinates.contactImagesHeight);
return;
}
diff --git a/src/com/android/mail/browse/ConversationItemViewCoordinates.java b/src/com/android/mail/browse/ConversationItemViewCoordinates.java
index c19cf5b78..b6a10297f 100644
--- a/src/com/android/mail/browse/ConversationItemViewCoordinates.java
+++ b/src/com/android/mail/browse/ConversationItemViewCoordinates.java
@@ -31,7 +31,6 @@ import android.view.ViewGroup;
import android.widget.TextView;
import com.android.mail.R;
-import com.android.mail.ui.ViewMode;
import com.android.mail.utils.Utils;
import com.android.mail.utils.ViewUtils;
import com.google.common.base.Objects;
@@ -48,11 +47,6 @@ import com.google.common.base.Objects;
public class ConversationItemViewCoordinates {
private static final int SINGLE_LINE = 1;
- // Modes
- static final int MODE_COUNT = 2;
- static final int WIDE_MODE = 0;
- static final int NORMAL_MODE = 1;
-
// Left-side gadget modes
static final int GADGET_NONE = 0;
static final int GADGET_CONTACT_PHOTO = 1;
@@ -65,7 +59,6 @@ public class ConversationItemViewCoordinates {
*/
public static final class Config {
private int mWidth;
- private int mViewMode = ViewMode.UNKNOWN;
private int mGadgetMode = GADGET_NONE;
private int mLayoutDirection = View.LAYOUT_DIRECTION_LTR;
private boolean mShowFolders = false;
@@ -74,11 +67,6 @@ public class ConversationItemViewCoordinates {
private boolean mShowPersonalIndicator = false;
private boolean mUseFullMargins = false;
- public Config setViewMode(int viewMode) {
- mViewMode = viewMode;
- return this;
- }
-
public Config withGadget(int gadget) {
mGadgetMode = gadget;
return this;
@@ -113,10 +101,6 @@ public class ConversationItemViewCoordinates {
return mWidth;
}
- public int getViewMode() {
- return mViewMode;
- }
-
public int getGadgetMode() {
return mGadgetMode;
}
@@ -139,7 +123,7 @@ public class ConversationItemViewCoordinates {
private int getCacheKey() {
// hash the attributes that contribute to item height and child view geometry
- return Objects.hashCode(mWidth, mViewMode, mGadgetMode, mShowFolders, mShowReplyState,
+ return Objects.hashCode(mWidth, mGadgetMode, mShowFolders, mShowReplyState,
mShowPersonalIndicator, mLayoutDirection, mUseFullMargins);
}
@@ -184,11 +168,6 @@ public class ConversationItemViewCoordinates {
}
}
- /**
- * One of either NORMAL_MODE or WIDE_MODE.
- */
- private final int mMode;
-
final int height;
// Star.
@@ -262,19 +241,10 @@ public class ConversationItemViewCoordinates {
final int contactImagesX;
final int contactImagesY;
-
- /**
- * The smallest item width for which we use the "wide" layout.
- */
- private final int mMinListWidthForWide;
-
private ConversationItemViewCoordinates(final Context context, final Config config,
final CoordinatesCache cache) {
Utils.traceBeginSection("CIV coordinates constructor");
final Resources res = context.getResources();
- mMinListWidthForWide = res.getDimensionPixelSize(R.dimen.list_min_width_is_wide);
-
- mMode = calculateMode(res, config);
final int layoutId = R.layout.conversation_item_view;
@@ -449,10 +419,6 @@ public class ConversationItemViewCoordinates {
}
}
- public int getMode() {
- return mMode;
- }
-
/**
* Returns a negative corrective value that you can apply to a TextView's vertical dimensions
* that will nudge the first line of text upwards such that uppercase Latin characters are
@@ -468,22 +434,6 @@ public class ConversationItemViewCoordinates {
}
/**
- * Returns the mode of the header view (Wide/Normal).
- */
- private int calculateMode(Resources res, Config config) {
- switch (config.getViewMode()) {
- case ViewMode.CONVERSATION_LIST:
- return config.getWidth() >= mMinListWidthForWide ? WIDE_MODE : NORMAL_MODE;
-
- case ViewMode.SEARCH_RESULTS_LIST:
- return res.getInteger(R.integer.conversation_list_search_header_mode);
-
- default:
- return res.getInteger(R.integer.conversation_header_mode);
- }
- }
-
- /**
* Returns the x coordinates of a view by tracing up its hierarchy.
*/
private static int getX(View view) {
@@ -510,12 +460,12 @@ public class ConversationItemViewCoordinates {
/**
* Returns the length (maximum of characters) of subject in this mode.
*/
- public static int getSendersLength(Context context, int mode, boolean hasAttachments) {
+ public static int getSendersLength(Context context, boolean hasAttachments) {
final Resources res = context.getResources();
if (hasAttachments) {
- return res.getIntArray(R.array.senders_with_attachment_lengths)[mode];
+ return res.getInteger(R.integer.senders_with_attachment_lengths);
} else {
- return res.getIntArray(R.array.senders_lengths)[mode];
+ return res.getInteger(R.integer.senders_lengths);
}
}