summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Stefani <luca.stefani.ge1@gmail.com>2020-03-16 16:27:26 +0100
committerLuca Stefani <luca.stefani.ge1@gmail.com>2020-03-16 16:29:30 +0100
commit48670efa8357c2a1dde3179b3e52397d063eea19 (patch)
tree289a6201954325405ff65a9673238055d1ed2fc8
parentce0f619fa209dbb0f7bea6930e4a602a1b733d48 (diff)
downloadpackages_apps_Messaging-48670efa8357c2a1dde3179b3e52397d063eea19.tar.gz
packages_apps_Messaging-48670efa8357c2a1dde3179b3e52397d063eea19.tar.bz2
packages_apps_Messaging-48670efa8357c2a1dde3179b3e52397d063eea19.zip
Revert "Messaging: Implement saved video attachments in MMS"
This reverts commit 34bda0bc79f45c6596b427d2c8e34e7991fc7e15. Change-Id: Ifa36d21e90606c943bccd96f49acbfeed0bca7a5
-rw-r--r--res/layout/gallery_grid_item_view.xml16
-rw-r--r--src/com/android/messaging/datamodel/GalleryBoundCursorLoader.java2
-rw-r--r--src/com/android/messaging/datamodel/data/GalleryGridItemData.java38
-rw-r--r--src/com/android/messaging/datamodel/data/MessagePartData.java17
-rw-r--r--src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java30
5 files changed, 12 insertions, 91 deletions
diff --git a/res/layout/gallery_grid_item_view.xml b/res/layout/gallery_grid_item_view.xml
index 88e4a1b..8b7ee58 100644
--- a/res/layout/gallery_grid_item_view.xml
+++ b/res/layout/gallery_grid_item_view.xml
@@ -27,22 +27,6 @@
android:layout_height="match_parent"
android:scaleType="centerCrop" />
- <FrameLayout
- android:id="@+id/video_button"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:visibility="invisible">
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:background="@drawable/transparent_button_background"
- android:scaleType="fitCenter"
- android:src="@drawable/ic_video_play_light"
- android:contentDescription="@string/video_thumbnail_view_play_button_content_description"/>
- </FrameLayout>
-
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
diff --git a/src/com/android/messaging/datamodel/GalleryBoundCursorLoader.java b/src/com/android/messaging/datamodel/GalleryBoundCursorLoader.java
index edcb150..28ec303 100644
--- a/src/com/android/messaging/datamodel/GalleryBoundCursorLoader.java
+++ b/src/com/android/messaging/datamodel/GalleryBoundCursorLoader.java
@@ -35,7 +35,7 @@ public class GalleryBoundCursorLoader extends BoundCursorLoader {
private static final String SORT_ORDER = Media.DATE_MODIFIED + " DESC";
private static final String IMAGE_SELECTION = createSelection(
MessagePartData.ACCEPTABLE_IMAGE_TYPES,
- new Integer[] { FileColumns.MEDIA_TYPE_IMAGE, FileColumns.MEDIA_TYPE_VIDEO });
+ new Integer[] { FileColumns.MEDIA_TYPE_IMAGE });
public GalleryBoundCursorLoader(final String bindingId, final Context context) {
super(bindingId, context, STORAGE_URI, GalleryGridItemData.IMAGE_PROJECTION,
diff --git a/src/com/android/messaging/datamodel/data/GalleryGridItemData.java b/src/com/android/messaging/datamodel/data/GalleryGridItemData.java
index cb6fc98..6649757 100644
--- a/src/com/android/messaging/datamodel/data/GalleryGridItemData.java
+++ b/src/com/android/messaging/datamodel/data/GalleryGridItemData.java
@@ -26,7 +26,6 @@ import android.text.TextUtils;
import com.android.messaging.datamodel.media.FileImageRequestDescriptor;
import com.android.messaging.datamodel.media.ImageRequest;
import com.android.messaging.datamodel.media.UriImageRequestDescriptor;
-import com.android.messaging.datamodel.media.VideoThumbnailRequestDescriptor;
import com.android.messaging.util.Assert;
/**
@@ -60,7 +59,6 @@ public class GalleryGridItemData {
private UriImageRequestDescriptor mImageData;
private String mContentType;
private boolean mIsDocumentPickerItem;
- private boolean mIsVideoItem;
private long mDateSeconds;
public GalleryGridItemData() {
@@ -73,10 +71,6 @@ public class GalleryGridItemData {
mImageData = null;
mContentType = null;
} else {
-
- String mimeType = cursor.getString(INDEX_MIME_TYPE);
- mIsVideoItem = mimeType != null && mimeType.toLowerCase().contains("video/");
-
int sourceWidth = cursor.getInt(INDEX_WIDTH);
int sourceHeight = cursor.getInt(INDEX_HEIGHT);
@@ -91,25 +85,15 @@ public class GalleryGridItemData {
mContentType = cursor.getString(INDEX_MIME_TYPE);
final String dateModified = cursor.getString(INDEX_DATE_MODIFIED);
mDateSeconds = !TextUtils.isEmpty(dateModified) ? Long.parseLong(dateModified) : -1;
- if (mIsVideoItem) {
- mImageData = new VideoThumbnailRequestDescriptor(
- cursor.getLong(INDEX_ID),
- cursor.getString(INDEX_DATA_PATH),
- desiredWidth,
- desiredHeight,
- sourceWidth,
- sourceHeight);
- } else {
- mImageData = new FileImageRequestDescriptor(
- cursor.getString(INDEX_DATA_PATH),
- desiredWidth,
- desiredHeight,
- sourceWidth,
- sourceHeight,
- true /* canUseThumbnail */,
- true /* allowCompression */,
- true /* isStatic */);
- }
+ mImageData = new FileImageRequestDescriptor(
+ cursor.getString(INDEX_DATA_PATH),
+ desiredWidth,
+ desiredHeight,
+ sourceWidth,
+ sourceHeight,
+ true /* canUseThumbnail */,
+ true /* allowCompression */,
+ true /* isStatic */);
}
}
@@ -117,10 +101,6 @@ public class GalleryGridItemData {
return mIsDocumentPickerItem;
}
- public boolean isVideoItem() {
- return mIsVideoItem;
- }
-
public Uri getImageUri() {
return mImageData.uri;
}
diff --git a/src/com/android/messaging/datamodel/data/MessagePartData.java b/src/com/android/messaging/datamodel/data/MessagePartData.java
index a41eb3d..fffaca8 100644
--- a/src/com/android/messaging/datamodel/data/MessagePartData.java
+++ b/src/com/android/messaging/datamodel/data/MessagePartData.java
@@ -53,21 +53,8 @@ import java.util.concurrent.TimeUnit;
public class MessagePartData implements Parcelable {
public static final int UNSPECIFIED_SIZE = MessagingContentProvider.UNSPECIFIED_SIZE;
public static final String[] ACCEPTABLE_IMAGE_TYPES =
- new String[] {
- // Images
- ContentType.IMAGE_JPEG,
- ContentType.IMAGE_JPG,
- ContentType.IMAGE_PNG,
- ContentType.IMAGE_GIF,
-
- // Videos
- ContentType.VIDEO_MP4,
- ContentType.VIDEO_MPEG,
- ContentType.VIDEO_MPEG4,
- ContentType.VIDEO_3GP,
- ContentType.VIDEO_3GPP,
- ContentType.VIDEO_WEBM,
- };
+ new String[] { ContentType.IMAGE_JPEG, ContentType.IMAGE_JPG, ContentType.IMAGE_PNG,
+ ContentType.IMAGE_GIF };
private static final String[] sProjection = {
PartColumns._ID,
diff --git a/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java b/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java
index 2006f57..3d71fe6 100644
--- a/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java
+++ b/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java
@@ -51,7 +51,6 @@ public class GalleryGridItemView extends FrameLayout {
@VisibleForTesting
GalleryGridItemData mData;
- private View mVideoButtonOverlayView;
private AsyncImageView mImageView;
private CheckBox mCheckBox;
private HostInterface mHostInterface;
@@ -70,7 +69,6 @@ public class GalleryGridItemView extends FrameLayout {
@Override
protected void onFinishInflate() {
super.onFinishInflate();
- mVideoButtonOverlayView = findViewById(R.id.video_button);
mImageView = (AsyncImageView) findViewById(R.id.image);
mCheckBox = (CheckBox) findViewById(R.id.checkbox);
mCheckBox.setOnClickListener(mOnClickListener);
@@ -138,28 +136,13 @@ public class GalleryGridItemView extends FrameLayout {
private void updateImageView() {
if (mData.isDocumentPickerItem()) {
- hideVideoPlayButtonOverlay();
mImageView.setScaleType(ScaleType.CENTER);
setBackgroundColor(ConversationDrawables.get().getConversationThemeColor());
mImageView.setImageResourceId(null);
mImageView.setImageResource(R.drawable.ic_photo_library_light);
mImageView.setContentDescription(getResources().getString(
R.string.pick_image_from_document_library_content_description));
- } else if (mData.isVideoItem()) {
- showVideoPlayButtonOverlay();
- mImageView.setScaleType(ScaleType.CENTER_CROP);
- setBackgroundColor(getResources().getColor(R.color.gallery_image_default_background));
- mImageView.setImageResourceId(mData.getImageRequestDescriptor());
- final long dateSeconds = mData.getDateSeconds();
- final boolean isValidDate = (dateSeconds > 0);
- final int templateId = isValidDate ?
- R.string.mediapicker_gallery_image_item_description :
- R.string.mediapicker_gallery_image_item_description_no_date;
- String contentDescription = String.format(getResources().getString(templateId),
- dateSeconds * TimeUnit.SECONDS.toMillis(1));
- mImageView.setContentDescription(contentDescription);
} else {
- hideVideoPlayButtonOverlay();
mImageView.setScaleType(ScaleType.CENTER_CROP);
setBackgroundColor(getResources().getColor(R.color.gallery_image_default_background));
mImageView.setImageResourceId(mData.getImageRequestDescriptor());
@@ -173,17 +156,4 @@ public class GalleryGridItemView extends FrameLayout {
mImageView.setContentDescription(contentDescription);
}
}
-
- private void showVideoPlayButtonOverlay() {
- if (mVideoButtonOverlayView != null) {
- mVideoButtonOverlayView.setVisibility(View.VISIBLE);
- }
- }
-
- private void hideVideoPlayButtonOverlay() {
- if (mVideoButtonOverlayView != null) {
- mVideoButtonOverlayView.setVisibility(View.INVISIBLE);
- }
- }
-
}