summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Sapperstein <asapperstein@google.com>2014-08-08 17:36:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-06 23:49:20 +0000
commit327774c891c252fa5311ee8e5b158db544a8c6b9 (patch)
treec11d8c937108909000bee98670050307633f08bd /src
parenta4b23e5b5ae6afd97b7241b73c2dbb6ceeacc58e (diff)
parente1557036849265afc24528be9effbe299b640bff (diff)
downloadandroid_packages_apps_UnifiedEmail-327774c891c252fa5311ee8e5b158db544a8c6b9.tar.gz
android_packages_apps_UnifiedEmail-327774c891c252fa5311ee8e5b158db544a8c6b9.tar.bz2
android_packages_apps_UnifiedEmail-327774c891c252fa5311ee8e5b158db544a8c6b9.zip
Merge changes I612bb54c,I611f0f7e into ub-gmail-ur14-dev
* changes: CV attachments. b/16138036. Remove above attachment promo. b/16138036.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/mail/browse/AttachmentActionHandler.java57
-rw-r--r--src/com/android/mail/browse/ConversationViewAdapter.java22
-rw-r--r--src/com/android/mail/browse/EmlMessageViewFragment.java6
-rw-r--r--src/com/android/mail/browse/MessageAttachmentBar.java2
-rw-r--r--src/com/android/mail/browse/MessageFooterView.java74
-rw-r--r--src/com/android/mail/text/UrlSpan.java45
-rw-r--r--src/com/android/mail/ui/AttachmentTileGrid.java24
-rw-r--r--src/com/android/mail/ui/ConversationViewFragment.java32
-rw-r--r--src/com/android/mail/ui/SecureConversationViewController.java30
-rw-r--r--src/com/android/mail/ui/SecureConversationViewFragment.java6
-rw-r--r--src/com/android/mail/utils/StyleUtils.java19
11 files changed, 20 insertions, 297 deletions
diff --git a/src/com/android/mail/browse/AttachmentActionHandler.java b/src/com/android/mail/browse/AttachmentActionHandler.java
index 9d5ec8f25..073de9d05 100644
--- a/src/com/android/mail/browse/AttachmentActionHandler.java
+++ b/src/com/android/mail/browse/AttachmentActionHandler.java
@@ -29,7 +29,6 @@ import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.Parcelable;
-import android.view.View;
import com.android.mail.providers.Attachment;
import com.android.mail.providers.Message;
@@ -43,7 +42,6 @@ import com.android.mail.utils.LogUtils;
import com.android.mail.utils.Utils;
import java.util.ArrayList;
-import java.util.List;
public class AttachmentActionHandler {
private static final String PROGRESS_FRAGMENT_TAG = "attachment-progress";
@@ -267,38 +265,6 @@ public class AttachmentActionHandler {
sOptionHandler.handleOption1(mContext, mAccount, mMessage, mAttachment, mFragmentManager);
}
- public static boolean shouldShowAboveBarAttachmentLayout(
- Context context, List<Attachment> attachments) {
- return (sOptionHandler != null) &&
- sOptionHandler.shouldShowAboveBarAttachmentLayout(context, attachments);
- }
-
- public static void setupAboveBarAttachmentLayout(View view) {
- if (sOptionHandler != null) {
- sOptionHandler.setupAboveBarAttachmentLayout(view);
- }
- }
-
- public static void onOverflowOpened(Context context, Attachment attachment) {
- if(sOptionHandler != null) {
- sOptionHandler.onOverflowOpened(context, attachment);
- }
- }
-
- public static void registerDismissListener(Uri conversationUri,
- AboveAttachmentLayoutDismissedListener listener) {
- if (sOptionHandler != null) {
- sOptionHandler.registerDismissListener(conversationUri, listener);
- }
- }
-
- public static void unregisterDismissListeners(Uri conversationUri) {
- if(sOptionHandler != null) {
- sOptionHandler.unregisterDismissListeners(conversationUri);
- }
- }
-
-
/**
* A default, no-op option class. Override this and set it globally with
* {@link AttachmentActionHandler#setOptionHandler(OptionHandler)}.<br>
@@ -316,28 +282,5 @@ public class AttachmentActionHandler {
Attachment attachment, FragmentManager fm) {
// no-op
}
-
- public boolean shouldShowAboveBarAttachmentLayout(
- Context context, List<Attachment> attachments) {
- return false;
- }
-
- public void setupAboveBarAttachmentLayout(View view) { /* no-op */ }
-
- public void onOverflowOpened(Context context, Attachment attachment) { /* no-op */ }
-
- public void registerDismissListener(Uri conversationUri,
- AboveAttachmentLayoutDismissedListener listener) {
- // no-op
- }
-
- public void unregisterDismissListeners(Uri conversationUri) {
- // no-op
- }
}
-
- public interface AboveAttachmentLayoutDismissedListener {
- void onOtherLayoutDismissed();
- }
-
}
diff --git a/src/com/android/mail/browse/ConversationViewAdapter.java b/src/com/android/mail/browse/ConversationViewAdapter.java
index f562dd554..b63305d13 100644
--- a/src/com/android/mail/browse/ConversationViewAdapter.java
+++ b/src/com/android/mail/browse/ConversationViewAdapter.java
@@ -342,8 +342,7 @@ public class ConversationViewAdapter extends BaseAdapter {
}
}
- public static class MessageFooterItem extends ConversationOverlayItem implements
- AttachmentActionHandler.AboveAttachmentLayoutDismissedListener {
+ public static class MessageFooterItem extends ConversationOverlayItem {
private final ConversationViewAdapter mAdapter;
/**
@@ -374,7 +373,7 @@ public class ConversationViewAdapter extends BaseAdapter {
@Override
public void bindView(View v, boolean measureOnly) {
final MessageFooterView attachmentsView = (MessageFooterView) v;
- attachmentsView.bind(mHeaderItem, this, measureOnly);
+ attachmentsView.bind(mHeaderItem, measureOnly);
}
@Override
@@ -407,23 +406,6 @@ public class ConversationViewAdapter extends BaseAdapter {
public MessageHeaderItem getHeaderItem() {
return mHeaderItem;
}
-
- @Override
- public void onOtherLayoutDismissed() {
- final MessageFooterView view = mAdapter.mFooterCallbacks.getViewForItem(this);
-
- // the item has a view, use the normal path
- if (view != null) {
- view.collapseAboveBarAttachmentsView();
- return;
- }
-
- // the item is offscreen or otherwise doesn't have a view
- // just update the HTML
- final int newHeight = mAdapter.mFooterCallbacks.getUpdatedHeight(this);
- setHeight(newHeight);
- mAdapter.mFooterCallbacks.setMessageSpacerHeight(this, newHeight);
- }
}
public class SuperCollapsedBlockItem extends ConversationOverlayItem {
diff --git a/src/com/android/mail/browse/EmlMessageViewFragment.java b/src/com/android/mail/browse/EmlMessageViewFragment.java
index 2a146f238..306c138c7 100644
--- a/src/com/android/mail/browse/EmlMessageViewFragment.java
+++ b/src/com/android/mail/browse/EmlMessageViewFragment.java
@@ -187,12 +187,6 @@ public class EmlMessageViewFragment extends Fragment
}
@Override
- public void onDestroyView() {
- super.onDestroyView();
- mViewController.onDestroyView();
- }
-
- @Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
if (Utils.isRunningKitkatOrLater()) {
inflater.inflate(R.menu.eml_fragment_menu, menu);
diff --git a/src/com/android/mail/browse/MessageAttachmentBar.java b/src/com/android/mail/browse/MessageAttachmentBar.java
index 238768e8c..c7121b2e0 100644
--- a/src/com/android/mail/browse/MessageAttachmentBar.java
+++ b/src/com/android/mail/browse/MessageAttachmentBar.java
@@ -235,8 +235,6 @@ public class MessageAttachmentBar extends FrameLayout implements OnClickListener
menu.findItem(R.id.attachment_extra_option1).setVisible(shouldShowExtraOption1());
mPopup.show();
-
- AttachmentActionHandler.onOverflowOpened(getContext(), mAttachment);
}
} else {
// Handles clicking the attachment
diff --git a/src/com/android/mail/browse/MessageFooterView.java b/src/com/android/mail/browse/MessageFooterView.java
index a8ade0afe..d5b65d776 100644
--- a/src/com/android/mail/browse/MessageFooterView.java
+++ b/src/com/android/mail/browse/MessageFooterView.java
@@ -30,26 +30,21 @@ import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.ViewGroup;
import android.widget.LinearLayout;
-import android.widget.TextView;
import com.android.mail.R;
import com.android.mail.analytics.Analytics;
import com.android.mail.browse.AttachmentLoader.AttachmentCursor;
import com.android.mail.browse.ConversationContainer.DetachListener;
-import com.android.mail.browse.ConversationViewAdapter.MessageFooterItem;
import com.android.mail.browse.ConversationViewAdapter.MessageHeaderItem;
import com.android.mail.providers.Account;
import com.android.mail.providers.Attachment;
-import com.android.mail.providers.Conversation;
import com.android.mail.providers.Message;
import com.android.mail.ui.AccountFeedbackActivity;
import com.android.mail.ui.AttachmentTile;
import com.android.mail.ui.AttachmentTileGrid;
import com.android.mail.utils.LogTag;
import com.android.mail.utils.LogUtils;
-import com.android.mail.utils.Utils;
import com.google.common.base.Objects;
import com.google.common.collect.Lists;
@@ -59,16 +54,13 @@ import java.util.List;
public class MessageFooterView extends LinearLayout implements DetachListener,
LoaderManager.LoaderCallbacks<Cursor>, View.OnClickListener {
- private MessageFooterItem mMessageFooterItem;
private MessageHeaderItem mMessageHeaderItem;
private LoaderManager mLoaderManager;
private FragmentManager mFragmentManager;
private AttachmentCursor mAttachmentsCursor;
private View mViewEntireMessagePrompt;
- private TextView mTitleText;
private AttachmentTileGrid mAttachmentGrid;
private LinearLayout mAttachmentBarList;
- private View mAboveAttachmentBarListLayout;
private final LayoutInflater mInflater;
@@ -86,12 +78,6 @@ public class MessageFooterView extends LinearLayout implements DetachListener,
* Callbacks for the MessageFooterView to enable resizing the height.
*/
public interface MessageFooterCallbacks {
- void setMessageSpacerHeight(MessageFooterItem item, int newSpacerHeight);
-
- MessageFooterView getViewForItem(MessageFooterItem item);
-
- int getUpdatedHeight(MessageFooterItem item);
-
/**
* @return <tt>true</tt> if this footer is contained within a SecureConversationViewFragment
* and cannot assume the content is <strong>not</strong> malicious
@@ -114,10 +100,8 @@ public class MessageFooterView extends LinearLayout implements DetachListener,
super.onFinishInflate();
mViewEntireMessagePrompt = findViewById(R.id.view_entire_message_prompt);
- mTitleText = (TextView) findViewById(R.id.attachments_header_text);
mAttachmentGrid = (AttachmentTileGrid) findViewById(R.id.attachment_tile_grid);
mAttachmentBarList = (LinearLayout) findViewById(R.id.attachment_bar_list);
- mAboveAttachmentBarListLayout = findViewById(R.id.above_attachment_bar_list_layout);
mViewEntireMessagePrompt.setOnClickListener(this);
}
@@ -131,8 +115,7 @@ public class MessageFooterView extends LinearLayout implements DetachListener,
}
public void bind(
- MessageHeaderItem headerItem, MessageFooterItem footerItem, boolean measureOnly) {
- mMessageFooterItem = footerItem;
+ MessageHeaderItem headerItem, boolean measureOnly) {
mMessageHeaderItem = headerItem;
final Integer attachmentLoaderId = getAttachmentLoaderId();
@@ -149,10 +132,8 @@ public class MessageFooterView extends LinearLayout implements DetachListener,
mAttachmentGrid.removeAllViewsInLayout();
mAttachmentBarList.removeAllViewsInLayout();
mViewEntireMessagePrompt.setVisibility(View.GONE);
- mTitleText.setVisibility(View.GONE);
mAttachmentGrid.setVisibility(View.GONE);
mAttachmentBarList.setVisibility(View.GONE);
- hideAboveAttachmentBarListLayout();
}
mOldAttachmentLoaderId = attachmentLoaderId;
@@ -176,25 +157,6 @@ public class MessageFooterView extends LinearLayout implements DetachListener,
setVisibility(mMessageHeaderItem.isExpanded() ? VISIBLE : GONE);
}
- private void hideAboveAttachmentBarListLayout() {
- if (mAboveAttachmentBarListLayout != null) {
- mAboveAttachmentBarListLayout.setVisibility(GONE);
- }
- }
-
- private void showAboveAttachmentBarListLayout() {
- if (mAboveAttachmentBarListLayout != null) {
- final Conversation conversation = mMessageHeaderItem.getMessage().getConversation();
- if (conversation == null) {
- hideAboveAttachmentBarListLayout();
- return;
- }
- AttachmentActionHandler.registerDismissListener(conversation.uri, mMessageFooterItem);
- mAboveAttachmentBarListLayout.setVisibility(VISIBLE);
- AttachmentActionHandler.setupAboveBarAttachmentLayout(mAboveAttachmentBarListLayout);
- }
- }
-
private void renderAttachments(boolean loaderResult) {
final List<Attachment> attachments;
if (mAttachmentsCursor != null && !mAttachmentsCursor.isClosed()) {
@@ -241,8 +203,6 @@ public class MessageFooterView extends LinearLayout implements DetachListener,
return;
}
- mTitleText.setVisibility(View.VISIBLE);
-
if (!tiledAttachments.isEmpty()) {
renderTiledAttachments(tiledAttachments, loaderResult);
}
@@ -262,14 +222,6 @@ public class MessageFooterView extends LinearLayout implements DetachListener,
private void renderBarAttachments(List<Attachment> barAttachments, boolean loaderResult) {
mAttachmentBarList.setVisibility(View.VISIBLE);
- if (!barAttachments.isEmpty() &&
- AttachmentActionHandler.shouldShowAboveBarAttachmentLayout(
- getContext(), barAttachments)) {
- showAboveAttachmentBarListLayout();
- } else {
- hideAboveAttachmentBarListLayout();
- }
-
final Account account = getAccount();
for (Attachment attachment : barAttachments) {
final Uri id = attachment.getIdentifierUri();
@@ -368,28 +320,4 @@ public class MessageFooterView extends LinearLayout implements DetachListener,
private Account getAccount() {
return mAccountController != null ? mAccountController.getAccount() : null;
}
-
- public void collapseAboveBarAttachmentsView() {
- measureHeight();
- mAboveAttachmentBarListLayout.setVisibility(View.GONE);
- updateSpacerHeight();
- }
-
- private int measureHeight() {
- ViewGroup parent = (ViewGroup) getParent();
- if (parent == null) {
- LogUtils.e(LOG_TAG, new Error(), "Unable to measure height of detached header");
- return getHeight();
- }
- return Utils.measureViewHeight(this, parent);
- }
-
- private void updateSpacerHeight() {
- final int h = measureHeight();
-
- mMessageFooterItem.setHeight(h);
- if (mCallbacks != null) {
- mCallbacks.setMessageSpacerHeight(mMessageFooterItem, h);
- }
- }
}
diff --git a/src/com/android/mail/text/UrlSpan.java b/src/com/android/mail/text/UrlSpan.java
deleted file mode 100644
index 7d7f98949..000000000
--- a/src/com/android/mail/text/UrlSpan.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2014 Google Inc.
- * Licensed to The Android Open Source Project.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.mail.text;
-
-import android.text.TextPaint;
-import android.text.style.URLSpan;
-
-/**
- * Extension to URLSpan that does not have underlines.
- * Stupid URLSpan.<p/>
- *
- * WARNING: this span will not work if the TextView it uses
- * saves and restores its text since TextView can only save
- * and restore {@link android.text.ParcelableSpan}s which
- * can only be implemented by framework Spans.
- */
-public class UrlSpan extends URLSpan {
- public UrlSpan(String url) {
- super(url);
- }
-
- /**
- * Makes the text in the link color and not underlined.
- */
- @Override
- public void updateDrawState(TextPaint ds) {
- ds.setColor(ds.linkColor);
- ds.setUnderlineText(false);
- }
-}
diff --git a/src/com/android/mail/ui/AttachmentTileGrid.java b/src/com/android/mail/ui/AttachmentTileGrid.java
index b5fefcc09..5b1e76f95 100644
--- a/src/com/android/mail/ui/AttachmentTileGrid.java
+++ b/src/com/android/mail/ui/AttachmentTileGrid.java
@@ -18,6 +18,7 @@ package com.android.mail.ui;
import android.app.FragmentManager;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.Bitmap;
import android.util.AttributeSet;
import android.view.LayoutInflater;
@@ -48,6 +49,7 @@ public class AttachmentTileGrid extends FrameLayout implements AttachmentPreview
MessageAttachmentTile.PhotoViewHandler {
private final LayoutInflater mInflater;
private final int mTileMinSize;
+ private final int mTilePadding;
private int mColumnCount;
private List<Attachment> mAttachments;
private final HashMap<String, AttachmentPreview> mAttachmentPreviews;
@@ -58,8 +60,9 @@ public class AttachmentTileGrid extends FrameLayout implements AttachmentPreview
public AttachmentTileGrid(Context context, AttributeSet attrs) {
super(context, attrs);
mInflater = LayoutInflater.from(context);
- mTileMinSize = context.getResources()
- .getDimensionPixelSize(R.dimen.attachment_tile_min_size);
+ final Resources res = context.getResources();
+ mTileMinSize = res.getDimensionPixelSize(R.dimen.attachment_tile_min_size);
+ mTilePadding = res.getDimensionPixelSize(R.dimen.attachment_tile_padding);
mAttachmentPreviews = Maps.newHashMap();
}
@@ -150,8 +153,10 @@ public class AttachmentTileGrid extends FrameLayout implements AttachmentPreview
// Let width = given width.
// Let height = image size + bottom padding.
- final int imageSize = (width) / mColumnCount;
- final int remainder = width - (imageSize * mColumnCount);
+ final int widthMinusPadding = width - (mColumnCount - 1) * mTilePadding;
+
+ final int imageSize = (widthMinusPadding) / mColumnCount;
+ final int remainder = widthMinusPadding - (imageSize * mColumnCount);
for (int i = 0; i < childCount; i++) {
final View child = getChildAt(i);
@@ -167,7 +172,8 @@ public class AttachmentTileGrid extends FrameLayout implements AttachmentPreview
// Then multiply by the height of one tile to get the grid height.
final int numRows = ((childCount - 1) / mColumnCount) + 1;
setMeasuredDimension(width,
- numRows*(imageSize + getChildAt(0).getPaddingBottom()));
+ numRows * (imageSize + getChildAt(0).getPaddingBottom()) +
+ (numRows - 1) * mTilePadding);
}
@Override
@@ -184,7 +190,7 @@ public class AttachmentTileGrid extends FrameLayout implements AttachmentPreview
boolean skipBeginningOfRowFirstTime = true;
final boolean isRtl = ViewUtils.isViewRtl(this);
final int width = getMeasuredWidth();
- int childLeft = (isRtl) ? width - getChildAt(0).getMeasuredWidth() : 0;;
+ int childLeft = (isRtl) ? width - getChildAt(0).getMeasuredWidth() : 0;
int childTop = 0;
// Layout the grid.
@@ -200,7 +206,7 @@ public class AttachmentTileGrid extends FrameLayout implements AttachmentPreview
// to reflect the top of the new row.
if (!skipBeginningOfRowFirstTime && i % mColumnCount == 0) {
childLeft = (isRtl) ? width - childWidth : 0;
- childTop += childHeight;
+ childTop += childHeight + mTilePadding;
} else {
skipBeginningOfRowFirstTime = false;
}
@@ -209,9 +215,9 @@ public class AttachmentTileGrid extends FrameLayout implements AttachmentPreview
childLeft + childWidth, childTop + childHeight);
if (isRtl) {
- childLeft -= childWidth;
+ childLeft -= childWidth - mTilePadding;
} else {
- childLeft += childWidth;
+ childLeft += childWidth + mTilePadding;
}
}
}
diff --git a/src/com/android/mail/ui/ConversationViewFragment.java b/src/com/android/mail/ui/ConversationViewFragment.java
index e0389d806..f5a0cdad7 100644
--- a/src/com/android/mail/ui/ConversationViewFragment.java
+++ b/src/com/android/mail/ui/ConversationViewFragment.java
@@ -48,7 +48,6 @@ import com.android.mail.FormattedDateBuilder;
import com.android.mail.R;
import com.android.mail.analytics.Analytics;
import com.android.mail.analytics.AnalyticsTimer;
-import com.android.mail.browse.AttachmentActionHandler;
import com.android.mail.browse.ConversationContainer;
import com.android.mail.browse.ConversationContainer.OverlayPosition;
import com.android.mail.browse.ConversationFooterView.ConversationFooterCallbacks;
@@ -453,10 +452,6 @@ public class ConversationViewFragment extends AbstractConversationViewFragment i
public void onDestroyView() {
super.onDestroyView();
mConversationContainer.setOverlayAdapter(null);
- // AdViewFragment has no conversation and will crash.
- if (mConversation != null) {
- AttachmentActionHandler.unregisterDismissListeners(mConversation.uri);
- }
mAdapter = null;
resetLoadWaiting(); // be sure to unregister any active load observer
mViewsCreated = false;
@@ -913,7 +908,7 @@ public class ConversationViewFragment extends AbstractConversationViewFragment i
* @param convItem adapter item with data to render and measure
* @return height of the rendered view in screen px
*/
- public int measureOverlayHeight(ConversationOverlayItem convItem) {
+ private int measureOverlayHeight(ConversationOverlayItem convItem) {
final int type = convItem.getType();
final View convertView = mConversationContainer.getScrapView(type);
@@ -1620,31 +1615,6 @@ public class ConversationViewFragment extends AbstractConversationViewFragment i
mDiff = (expanded ? 1 : -1) * Math.abs(i.getHeight() - heightBefore);
}
- // START MessageFooterCallbacks
-
- @Override
- public void setMessageSpacerHeight(MessageFooterItem item, int newSpacerHeight) {
- mConversationContainer.invalidateSpacerGeometry();
-
- // update message HTML spacer height
- final int h = mWebView.screenPxToWebPx(newSpacerHeight);
- LogUtils.i(LAYOUT_TAG, "setting HTML spacer h=%dwebPx (%dscreenPx)", h, newSpacerHeight);
- mWebView.loadUrl(String.format("javascript:setMessageFooterSpacerHeight('%s', %s);",
- mTemplates.getMessageDomId(item.getHeaderItem().getMessage()), h));
- }
-
- @Override
- public MessageFooterView getViewForItem(MessageFooterItem item) {
- return (MessageFooterView) mConversationContainer.getViewForItem(item);
- }
-
- @Override
- public int getUpdatedHeight(MessageFooterItem item) {
- return measureOverlayHeight(item);
- }
-
- // END MessageFooterCallbacks
-
/**
* @return {@code true} because either the Print or Print All menu item is shown in GMail
*/
diff --git a/src/com/android/mail/ui/SecureConversationViewController.java b/src/com/android/mail/ui/SecureConversationViewController.java
index ea38e5dff..325ad56ce 100644
--- a/src/com/android/mail/ui/SecureConversationViewController.java
+++ b/src/com/android/mail/ui/SecureConversationViewController.java
@@ -29,10 +29,8 @@ import android.webkit.WebSettings;
import com.android.mail.FormattedDateBuilder;
import com.android.mail.R;
-import com.android.mail.browse.AttachmentActionHandler;
import com.android.mail.browse.ConversationMessage;
import com.android.mail.browse.ConversationViewAdapter;
-import com.android.mail.browse.ConversationViewAdapter.MessageFooterItem;
import com.android.mail.browse.ConversationViewAdapter.MessageHeaderItem;
import com.android.mail.browse.ConversationViewHeader;
import com.android.mail.browse.InlineAttachmentViewIntentBuilderCreator;
@@ -166,12 +164,6 @@ public class SecureConversationViewController implements
R.dimen.conversation_message_content_margin_side) / r.getDisplayMetrics().density);
}
- public void onDestroyView() {
- if (mMessage != null && mMessage.getConversation() != null) {
- AttachmentActionHandler.unregisterDismissListeners(mMessage.getConversation().uri);
- }
- }
-
@Override
public void onNotifierScroll(final int y) {
// We need to decide whether or not to display the snap header.
@@ -222,8 +214,7 @@ public class SecureConversationViewController implements
if (mMessage.hasAttachments) {
mMessageFooterView.setVisibility(View.VISIBLE);
- mMessageFooterView.bind(
- item, ConversationViewAdapter.newMessageFooterItem(null, item), false);
+ mMessageFooterView.bind(item, false);
}
}
@@ -299,23 +290,4 @@ public class SecureConversationViewController implements
}
// End MessageHeaderViewCallbacks implementations
-
- // START MessageFooterCallbacks
-
- @Override
- public void setMessageSpacerHeight(MessageFooterItem item, int newSpacerHeight) {
- // Do nothing.
- }
-
- @Override
- public MessageFooterView getViewForItem(MessageFooterItem item) {
- return mMessageFooterView;
- }
-
- @Override
- public int getUpdatedHeight(MessageFooterItem item) {
- return 0; // should never get called since we'll always have a footer view
- }
-
- // END MessageFooterCallbacks
}
diff --git a/src/com/android/mail/ui/SecureConversationViewFragment.java b/src/com/android/mail/ui/SecureConversationViewFragment.java
index 29b79a7ba..7c4a9d9c6 100644
--- a/src/com/android/mail/ui/SecureConversationViewFragment.java
+++ b/src/com/android/mail/ui/SecureConversationViewFragment.java
@@ -141,12 +141,6 @@ public class SecureConversationViewFragment extends AbstractConversationViewFrag
mViewController.onActivityCreated(savedInstanceState);
}
- @Override
- public void onDestroyView() {
- super.onDestroyView();
- mViewController.onDestroyView();
- }
-
// Start implementations of SecureConversationViewControllerCallbacks
@Override
diff --git a/src/com/android/mail/utils/StyleUtils.java b/src/com/android/mail/utils/StyleUtils.java
index 3943a5b56..622f19e02 100644
--- a/src/com/android/mail/utils/StyleUtils.java
+++ b/src/com/android/mail/utils/StyleUtils.java
@@ -24,30 +24,11 @@ import android.view.View;
import android.widget.TextView;
import com.android.mail.text.LinkStyleSpan;
-import com.android.mail.text.UrlSpan;
/**
* Utility class for styling UI.
*/
public class StyleUtils {
-
- /**
- * Removes any {@link android.text.style.URLSpan}s from the text view
- * and replaces them with their non-underline version {@link com.android.mail.text.UrlSpan}.
- */
- public static void stripUnderlines(TextView textView) {
- final Spannable spannable = (Spannable) textView.getText();
- final URLSpan[] urls = textView.getUrls();
-
- for (URLSpan span : urls) {
- final int start = spannable.getSpanStart(span);
- final int end = spannable.getSpanEnd(span);
- spannable.removeSpan(span);
- span = new UrlSpan(span.getURL());
- spannable.setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
- }
- }
-
/**
* Removes any {@link android.text.style.URLSpan}s from the text view and replaces them with a
* non-underline version {@link LinkStyleSpan} which calls the supplied listener when clicked.