Andrew Sapperstein | 8f1c01e | 2012-06-18 18:15:30 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 Google Inc. |
| 3 | * Licensed to The Android Open Source Project. |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 18 | package com.android.mail.browse; |
| 19 | |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 20 | |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 21 | import android.app.DialogFragment; |
| 22 | import android.app.Fragment; |
| 23 | import android.app.FragmentManager; |
| 24 | import android.app.FragmentTransaction; |
Andrew Sapperstein | 532f482 | 2012-06-14 12:48:35 -0700 | [diff] [blame] | 25 | import android.content.ActivityNotFoundException; |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 26 | import android.content.ContentValues; |
| 27 | import android.content.Context; |
Andrew Sapperstein | 532f482 | 2012-06-14 12:48:35 -0700 | [diff] [blame] | 28 | import android.content.Intent; |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 29 | import android.net.Uri; |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 30 | import android.os.Handler; |
Andrew Sapperstein | 532f482 | 2012-06-14 12:48:35 -0700 | [diff] [blame] | 31 | import android.os.Parcelable; |
Andrew Sapperstein | 381c322 | 2014-04-20 12:23:57 -0700 | [diff] [blame^] | 32 | import android.view.View; |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 33 | |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 34 | import com.android.mail.providers.Attachment; |
Andy Huang | 4f347e8 | 2014-02-25 17:32:28 -0800 | [diff] [blame] | 35 | import com.android.mail.providers.Message; |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 36 | import com.android.mail.providers.UIProvider; |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 37 | import com.android.mail.providers.UIProvider.AttachmentColumns; |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 38 | import com.android.mail.providers.UIProvider.AttachmentContentValueKeys; |
Andrew Sapperstein | 4cb51db | 2012-07-20 15:54:27 -0700 | [diff] [blame] | 39 | import com.android.mail.providers.UIProvider.AttachmentDestination; |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 40 | import com.android.mail.providers.UIProvider.AttachmentState; |
Paul Westbrook | b334c90 | 2012-06-25 11:42:46 -0700 | [diff] [blame] | 41 | import com.android.mail.utils.LogTag; |
Andrew Sapperstein | 532f482 | 2012-06-14 12:48:35 -0700 | [diff] [blame] | 42 | import com.android.mail.utils.LogUtils; |
| 43 | import com.android.mail.utils.Utils; |
| 44 | |
| 45 | import java.util.ArrayList; |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 46 | |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 47 | public class AttachmentActionHandler { |
| 48 | private static final String PROGRESS_FRAGMENT_TAG = "attachment-progress"; |
| 49 | |
Andy Huang | 4f347e8 | 2014-02-25 17:32:28 -0800 | [diff] [blame] | 50 | private String mAccount; |
| 51 | private Message mMessage; |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 52 | private Attachment mAttachment; |
| 53 | |
| 54 | private final AttachmentCommandHandler mCommandHandler; |
| 55 | private final AttachmentViewInterface mView; |
| 56 | private final Context mContext; |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 57 | private final Handler mHandler; |
| 58 | private FragmentManager mFragmentManager; |
Martin Hibdon | 519c218 | 2013-09-20 17:27:57 -0700 | [diff] [blame] | 59 | private boolean mViewOnFinish; |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 60 | |
Paul Westbrook | b334c90 | 2012-06-25 11:42:46 -0700 | [diff] [blame] | 61 | private static final String LOG_TAG = LogTag.getLogTag(); |
Andrew Sapperstein | 532f482 | 2012-06-14 12:48:35 -0700 | [diff] [blame] | 62 | |
Andy Huang | 4f347e8 | 2014-02-25 17:32:28 -0800 | [diff] [blame] | 63 | private static OptionHandler sOptionHandler = new OptionHandler(); |
| 64 | |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 65 | public AttachmentActionHandler(Context context, AttachmentViewInterface view) { |
| 66 | mCommandHandler = new AttachmentCommandHandler(context); |
| 67 | mView = view; |
| 68 | mContext = context; |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 69 | mHandler = new Handler(); |
Martin Hibdon | 519c218 | 2013-09-20 17:27:57 -0700 | [diff] [blame] | 70 | mViewOnFinish = true; |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | public void initialize(FragmentManager fragmentManager) { |
| 74 | mFragmentManager = fragmentManager; |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 75 | } |
| 76 | |
Andy Huang | 4f347e8 | 2014-02-25 17:32:28 -0800 | [diff] [blame] | 77 | public void setAccount(String account) { |
| 78 | mAccount = account; |
| 79 | } |
| 80 | |
| 81 | public void setMessage(Message message) { |
| 82 | mMessage = message; |
| 83 | } |
| 84 | |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 85 | public void setAttachment(Attachment attachment) { |
| 86 | mAttachment = attachment; |
| 87 | } |
| 88 | |
Martin Hibdon | 519c218 | 2013-09-20 17:27:57 -0700 | [diff] [blame] | 89 | public void setViewOnFinish(boolean viewOnFinish) { |
| 90 | mViewOnFinish = viewOnFinish; |
| 91 | } |
| 92 | |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 93 | public void showAttachment(int destination) { |
Mark Wei | 7bed4bc | 2013-01-22 22:56:22 -0800 | [diff] [blame] | 94 | if (mView == null) { |
| 95 | return; |
| 96 | } |
| 97 | |
Paul Westbrook | a25b65e | 2012-09-25 09:21:52 -0700 | [diff] [blame] | 98 | // If the caller requested that this attachments be saved to the external storage, we should |
| 99 | // verify that the it was saved there. |
| 100 | if (mAttachment.isPresentLocally() && |
| 101 | (destination == AttachmentDestination.CACHE || |
| 102 | mAttachment.destination == destination)) { |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 103 | mView.viewAttachment(); |
| 104 | } else { |
Scott Kennedy | 9e2d407 | 2013-03-21 21:46:01 -0700 | [diff] [blame] | 105 | showDownloadingDialog(); |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 106 | startDownloadingAttachment(destination); |
| 107 | } |
| 108 | } |
| 109 | |
Mark Wei | 7bed4bc | 2013-01-22 22:56:22 -0800 | [diff] [blame] | 110 | /** |
| 111 | * Start downloading the full size attachment set with |
| 112 | * {@link #setAttachment(Attachment)} immediately. |
| 113 | */ |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 114 | public void startDownloadingAttachment(int destination) { |
Mark Wei | 2674535 | 2013-01-17 21:40:34 -0800 | [diff] [blame] | 115 | startDownloadingAttachment(destination, UIProvider.AttachmentRendition.BEST, 0, false); |
Andrew Sapperstein | 4cb51db | 2012-07-20 15:54:27 -0700 | [diff] [blame] | 116 | } |
| 117 | |
Mark Wei | 2674535 | 2013-01-17 21:40:34 -0800 | [diff] [blame] | 118 | public void startDownloadingAttachment( |
| 119 | int destination, int rendition, int additionalPriority, boolean delayDownload) { |
| 120 | startDownloadingAttachment( |
| 121 | mAttachment, destination, rendition, additionalPriority, delayDownload); |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 122 | } |
| 123 | |
Mark Wei | 2674535 | 2013-01-17 21:40:34 -0800 | [diff] [blame] | 124 | private void startDownloadingAttachment( |
| 125 | Attachment attachment, int destination, int rendition, int additionalPriority, |
| 126 | boolean delayDownload) { |
Andrew Sapperstein | 7434e80 | 2013-06-21 11:26:49 -0700 | [diff] [blame] | 127 | final ContentValues params = new ContentValues(5); |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 128 | params.put(AttachmentColumns.STATE, AttachmentState.DOWNLOADING); |
| 129 | params.put(AttachmentColumns.DESTINATION, destination); |
Mark Wei | 1aee17e | 2013-01-14 14:47:16 -0800 | [diff] [blame] | 130 | params.put(AttachmentContentValueKeys.RENDITION, rendition); |
Mark Wei | 2674535 | 2013-01-17 21:40:34 -0800 | [diff] [blame] | 131 | params.put(AttachmentContentValueKeys.ADDITIONAL_PRIORITY, additionalPriority); |
| 132 | params.put(AttachmentContentValueKeys.DELAY_DOWNLOAD, delayDownload); |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 133 | |
Andrew Sapperstein | 4cb51db | 2012-07-20 15:54:27 -0700 | [diff] [blame] | 134 | mCommandHandler.sendCommand(attachment.uri, params); |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | public void cancelAttachment() { |
| 138 | final ContentValues params = new ContentValues(1); |
| 139 | params.put(AttachmentColumns.STATE, AttachmentState.NOT_SAVED); |
| 140 | |
| 141 | mCommandHandler.sendCommand(mAttachment.uri, params); |
| 142 | } |
| 143 | |
Mark Wei | 47ca4e2 | 2012-10-17 16:20:15 -0700 | [diff] [blame] | 144 | public void startRedownloadingAttachment(Attachment attachment) { |
| 145 | final ContentValues params = new ContentValues(2); |
| 146 | params.put(AttachmentColumns.STATE, AttachmentState.REDOWNLOADING); |
| 147 | params.put(AttachmentColumns.DESTINATION, attachment.destination); |
| 148 | |
| 149 | mCommandHandler.sendCommand(attachment.uri, params); |
| 150 | } |
| 151 | |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 152 | /** |
| 153 | * Displays a loading dialog to be used for downloading attachments. |
| 154 | * Must be called on the UI thread. |
| 155 | */ |
Mark Wei | ce9db80 | 2013-08-08 14:57:29 -0700 | [diff] [blame] | 156 | public void showDownloadingDialog() { |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 157 | final FragmentTransaction ft = mFragmentManager.beginTransaction(); |
| 158 | final Fragment prev = mFragmentManager.findFragmentByTag(PROGRESS_FRAGMENT_TAG); |
| 159 | if (prev != null) { |
| 160 | ft.remove(prev); |
| 161 | } |
| 162 | ft.addToBackStack(null); |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 163 | |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 164 | // Create and show the dialog. |
| 165 | final DialogFragment newFragment = AttachmentProgressDialogFragment.newInstance( |
Scott Kennedy | 9e2d407 | 2013-03-21 21:46:01 -0700 | [diff] [blame] | 166 | mAttachment); |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 167 | newFragment.show(ft, PROGRESS_FRAGMENT_TAG); |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 168 | } |
| 169 | |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 170 | /** |
| 171 | * Update progress-related views. Will also trigger a view intent if a progress dialog was |
| 172 | * previously brought up (by tapping 'View') and the download has now finished. |
| 173 | */ |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 174 | public void updateStatus(boolean loaderResult) { |
Mark Wei | 7bed4bc | 2013-01-22 22:56:22 -0800 | [diff] [blame] | 175 | if (mView == null) { |
| 176 | return; |
| 177 | } |
| 178 | |
Andrew Sapperstein | 4cb51db | 2012-07-20 15:54:27 -0700 | [diff] [blame] | 179 | final boolean showProgress = mAttachment.shouldShowProgress(); |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 180 | |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 181 | final AttachmentProgressDialogFragment dialog = (AttachmentProgressDialogFragment) |
| 182 | mFragmentManager.findFragmentByTag(PROGRESS_FRAGMENT_TAG); |
| 183 | if (dialog != null && dialog.isShowingDialogForAttachment(mAttachment)) { |
| 184 | dialog.setProgress(mAttachment.downloadedSize); |
Paul Westbrook | bedcad9 | 2012-08-22 00:33:04 -0700 | [diff] [blame] | 185 | |
| 186 | // We don't want the progress bar to switch back to indeterminate mode after |
| 187 | // have been in determinate progress mode. |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 188 | final boolean indeterminate = !showProgress && dialog.isIndeterminate(); |
| 189 | dialog.setIndeterminate(indeterminate); |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 190 | |
Mark Wei | bbe74ae | 2012-11-19 11:20:09 -0800 | [diff] [blame] | 191 | if (loaderResult && mAttachment.isDownloadFinishedOrFailed()) { |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 192 | mHandler.post(new Runnable() { |
| 193 | @Override |
| 194 | public void run() { |
| 195 | dialog.dismiss(); |
| 196 | } |
| 197 | }); |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 198 | } |
| 199 | |
Martin Hibdon | 519c218 | 2013-09-20 17:27:57 -0700 | [diff] [blame] | 200 | if (mAttachment.state == AttachmentState.SAVED && mViewOnFinish) { |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 201 | mView.viewAttachment(); |
| 202 | } |
| 203 | } else { |
| 204 | mView.updateProgress(showProgress); |
| 205 | } |
| 206 | |
Andrew Sapperstein | 532f482 | 2012-06-14 12:48:35 -0700 | [diff] [blame] | 207 | // Call on update status for the view so that it can do some specific things. |
| 208 | mView.onUpdateStatus(); |
| 209 | } |
| 210 | |
Andrew Sapperstein | a95161c | 2012-07-31 16:00:21 -0700 | [diff] [blame] | 211 | public boolean isProgressDialogVisible() { |
Paul Westbrook | 8081df4 | 2012-09-10 15:43:36 -0700 | [diff] [blame] | 212 | final Fragment dialog = mFragmentManager.findFragmentByTag(PROGRESS_FRAGMENT_TAG); |
| 213 | return dialog != null && dialog.isVisible(); |
Andrew Sapperstein | a95161c | 2012-07-31 16:00:21 -0700 | [diff] [blame] | 214 | } |
| 215 | |
Andrew Sapperstein | 532f482 | 2012-06-14 12:48:35 -0700 | [diff] [blame] | 216 | public void shareAttachment() { |
Sara Ting | d2f279f | 2012-09-26 11:01:05 -0700 | [diff] [blame] | 217 | if (mAttachment.contentUri == null) { |
| 218 | return; |
| 219 | } |
| 220 | |
Andrew Sapperstein | 532f482 | 2012-06-14 12:48:35 -0700 | [diff] [blame] | 221 | Intent intent = new Intent(Intent.ACTION_SEND); |
| 222 | intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION |
| 223 | | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); |
| 224 | |
| 225 | final Uri uri = Utils.normalizeUri(mAttachment.contentUri); |
| 226 | intent.putExtra(Intent.EXTRA_STREAM, uri); |
Mark Wei | 8750066 | 2013-02-20 14:29:53 -0800 | [diff] [blame] | 227 | intent.setType(Utils.normalizeMimeType(mAttachment.getContentType())); |
Andrew Sapperstein | 532f482 | 2012-06-14 12:48:35 -0700 | [diff] [blame] | 228 | |
| 229 | try { |
| 230 | mContext.startActivity(intent); |
| 231 | } catch (ActivityNotFoundException e) { |
| 232 | // couldn't find activity for SEND intent |
| 233 | LogUtils.e(LOG_TAG, "Couldn't find Activity for intent", e); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | public void shareAttachments(ArrayList<Parcelable> uris) { |
| 238 | Intent intent = new Intent(Intent.ACTION_SEND_MULTIPLE); |
| 239 | intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION |
| 240 | | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); |
| 241 | |
| 242 | intent.setType("image/*"); |
| 243 | intent.putParcelableArrayListExtra( |
| 244 | Intent.EXTRA_STREAM, uris); |
| 245 | |
| 246 | try { |
| 247 | mContext.startActivity(intent); |
| 248 | } catch (ActivityNotFoundException e) { |
| 249 | // couldn't find activity for SEND_MULTIPLE intent |
| 250 | LogUtils.e(LOG_TAG, "Couldn't find Activity for intent", e); |
| 251 | } |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 252 | } |
Andy Huang | 4f347e8 | 2014-02-25 17:32:28 -0800 | [diff] [blame] | 253 | |
| 254 | public static void setOptionHandler(OptionHandler handler) { |
| 255 | sOptionHandler = handler; |
| 256 | } |
| 257 | |
| 258 | public boolean shouldShowExtraOption1() { |
| 259 | return (sOptionHandler != null) && sOptionHandler.shouldShowExtraOption1(); |
| 260 | } |
| 261 | |
| 262 | public void handleOption1() { |
| 263 | if (sOptionHandler == null) { |
| 264 | return; |
| 265 | } |
| 266 | sOptionHandler.handleOption1(mContext, mAccount, mMessage, mAttachment, mFragmentManager); |
| 267 | } |
| 268 | |
Andrew Sapperstein | 381c322 | 2014-04-20 12:23:57 -0700 | [diff] [blame^] | 269 | public static boolean shouldShowAboveBarAttachmentLayout(Context context) { |
| 270 | return (sOptionHandler != null) && |
| 271 | sOptionHandler.shouldShowAboveBarAttachmentLayout(context); |
| 272 | } |
| 273 | |
| 274 | public static void setupAboveBarAttachmentLayout(View view) { |
| 275 | if (sOptionHandler != null) { |
| 276 | sOptionHandler.setupAboveBarAttachmentLayout(view); |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | public static void onOverflowOpened(Context context) { |
| 281 | if(sOptionHandler != null) { |
| 282 | sOptionHandler.onOverflowOpened(context); |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | public static void registerDismissListener(Uri conversationUri, |
| 287 | AboveAttachmentLayoutDismissedListener listener) { |
| 288 | if (sOptionHandler != null) { |
| 289 | sOptionHandler.registerDismissListener(conversationUri, listener); |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | public static void unregisterDismissListeners(Uri conversationUri) { |
| 294 | if(sOptionHandler != null) { |
| 295 | sOptionHandler.unregisterDismissListeners(conversationUri); |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | |
Andy Huang | 4f347e8 | 2014-02-25 17:32:28 -0800 | [diff] [blame] | 300 | /** |
| 301 | * A default, no-op option class. Override this and set it globally with |
| 302 | * {@link AttachmentActionHandler#setOptionHandler(OptionHandler)}.<br> |
| 303 | * <br> |
| 304 | * Subclasses of this type will live pretty much forever, so really, really try to avoid |
| 305 | * keeping any state as member variables in them. |
| 306 | */ |
| 307 | public static class OptionHandler { |
| 308 | |
| 309 | public boolean shouldShowExtraOption1() { |
| 310 | return false; |
| 311 | } |
| 312 | |
Andy Huang | 4f347e8 | 2014-02-25 17:32:28 -0800 | [diff] [blame] | 313 | public void handleOption1(Context context, String account, Message message, |
| 314 | Attachment attachment, FragmentManager fm) { |
| 315 | // no-op |
| 316 | } |
| 317 | |
Andrew Sapperstein | 381c322 | 2014-04-20 12:23:57 -0700 | [diff] [blame^] | 318 | public boolean shouldShowAboveBarAttachmentLayout(Context context) { |
| 319 | return false; |
| 320 | } |
| 321 | |
| 322 | public void setupAboveBarAttachmentLayout(View view) { /* no-op */ } |
| 323 | |
| 324 | public void onOverflowOpened(Context context) { /* no-op */ } |
| 325 | |
| 326 | public void registerDismissListener(Uri conversationUri, |
| 327 | AboveAttachmentLayoutDismissedListener listener) { |
| 328 | // no-op |
| 329 | } |
| 330 | |
| 331 | public void unregisterDismissListeners(Uri conversationUri) { |
| 332 | // no-op |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | public interface AboveAttachmentLayoutDismissedListener { |
| 337 | void onOtherLayoutDismissed(); |
Andy Huang | 4f347e8 | 2014-02-25 17:32:28 -0800 | [diff] [blame] | 338 | } |
| 339 | |
Andrew Sapperstein | 4aa1c13 | 2012-06-08 17:53:41 -0700 | [diff] [blame] | 340 | } |