From 26cc9dcbea89b5767c4c4c7dd3cfeb11a7ab168d Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 3 Oct 2018 22:31:55 +0200 Subject: [PATCH] rework MediaViewerActivity --- build.gradle | 4 +- src/main/AndroidManifest.xml | 4 +- .../messenger/persistance/FileBackend.java | 12 +- .../messenger/ui/ConversationFragment.java | 2 +- ...Activity.java => MediaViewerActivity.java} | 151 +++++++++++++----- .../de/pixart/messenger/ui/util/ViewUtil.java | 6 +- .../drawable-hdpi/ic_delete_black_24dp.png | Bin 0 -> 492 bytes .../res/drawable-hdpi/ic_menu_white_24dp.png | Bin 0 -> 417 bytes .../res/drawable-hdpi/ic_share_black_24dp.png | Bin 0 -> 753 bytes .../res/drawable-hdpi/ic_video_black_24dp.png | Bin 0 -> 237 bytes .../res/drawable-hdpi/ic_video_white_24dp.png | Bin 0 -> 239 bytes .../drawable-mdpi/ic_delete_black_24dp.png | Bin 0 -> 410 bytes .../res/drawable-mdpi/ic_menu_white_24dp.png | Bin 0 -> 366 bytes .../res/drawable-mdpi/ic_share_black_24dp.png | Bin 0 -> 573 bytes .../res/drawable-mdpi/ic_video_black_24dp.png | Bin 0 -> 146 bytes .../res/drawable-mdpi/ic_video_white_24dp.png | Bin 0 -> 150 bytes .../drawable-xhdpi/ic_delete_black_24dp.png | Bin 0 -> 479 bytes .../res/drawable-xhdpi/ic_menu_white_24dp.png | Bin 0 -> 386 bytes .../drawable-xhdpi/ic_share_black_24dp.png | Bin 0 -> 852 bytes .../drawable-xhdpi/ic_video_black_24dp.png | Bin 0 -> 212 bytes .../drawable-xhdpi/ic_video_white_24dp.png | Bin 0 -> 206 bytes .../drawable-xxhdpi/ic_delete_black_24dp.png | Bin 0 -> 575 bytes .../drawable-xxhdpi/ic_menu_white_24dp.png | Bin 0 -> 420 bytes .../drawable-xxhdpi/ic_share_black_24dp.png | Bin 0 -> 1190 bytes .../drawable-xxhdpi/ic_video_black_24dp.png | Bin 0 -> 325 bytes .../drawable-xxhdpi/ic_video_white_24dp.png | Bin 0 -> 332 bytes .../drawable-xxxhdpi/ic_delete_black_24dp.png | Bin 0 -> 668 bytes .../drawable-xxxhdpi/ic_menu_white_24dp.png | Bin 0 -> 450 bytes .../drawable-xxxhdpi/ic_share_black_24dp.png | Bin 0 -> 1556 bytes .../drawable-xxxhdpi/ic_video_black_24dp.png | Bin 0 -> 425 bytes .../drawable-xxxhdpi/ic_video_white_24dp.png | Bin 0 -> 419 bytes ..._message.xml => activity_media_viewer.xml} | 4 +- src/main/res/menu/contact_details.xml | 2 +- src/main/res/menu/editaccount.xml | 2 +- src/main/res/menu/media_viewer.xml | 17 ++ src/main/res/menu/muc_details.xml | 2 +- src/main/res/values/attrs.xml | 1 + src/main/res/values/defaults.xml | 2 +- src/main/res/values/strings.xml | 2 + src/main/res/values/themes.xml | 4 +- 40 files changed, 157 insertions(+), 58 deletions(-) rename src/main/java/de/pixart/messenger/ui/{ShowFullscreenMessageActivity.java => MediaViewerActivity.java} (67%) create mode 100644 src/main/res/drawable-hdpi/ic_delete_black_24dp.png create mode 100644 src/main/res/drawable-hdpi/ic_menu_white_24dp.png create mode 100644 src/main/res/drawable-hdpi/ic_share_black_24dp.png create mode 100644 src/main/res/drawable-hdpi/ic_video_black_24dp.png create mode 100644 src/main/res/drawable-hdpi/ic_video_white_24dp.png create mode 100644 src/main/res/drawable-mdpi/ic_delete_black_24dp.png create mode 100644 src/main/res/drawable-mdpi/ic_menu_white_24dp.png create mode 100644 src/main/res/drawable-mdpi/ic_share_black_24dp.png create mode 100644 src/main/res/drawable-mdpi/ic_video_black_24dp.png create mode 100644 src/main/res/drawable-mdpi/ic_video_white_24dp.png create mode 100644 src/main/res/drawable-xhdpi/ic_delete_black_24dp.png create mode 100644 src/main/res/drawable-xhdpi/ic_menu_white_24dp.png create mode 100644 src/main/res/drawable-xhdpi/ic_share_black_24dp.png create mode 100644 src/main/res/drawable-xhdpi/ic_video_black_24dp.png create mode 100644 src/main/res/drawable-xhdpi/ic_video_white_24dp.png create mode 100644 src/main/res/drawable-xxhdpi/ic_delete_black_24dp.png create mode 100644 src/main/res/drawable-xxhdpi/ic_menu_white_24dp.png create mode 100644 src/main/res/drawable-xxhdpi/ic_share_black_24dp.png create mode 100644 src/main/res/drawable-xxhdpi/ic_video_black_24dp.png create mode 100644 src/main/res/drawable-xxhdpi/ic_video_white_24dp.png create mode 100644 src/main/res/drawable-xxxhdpi/ic_delete_black_24dp.png create mode 100644 src/main/res/drawable-xxxhdpi/ic_menu_white_24dp.png create mode 100644 src/main/res/drawable-xxxhdpi/ic_share_black_24dp.png create mode 100644 src/main/res/drawable-xxxhdpi/ic_video_black_24dp.png create mode 100644 src/main/res/drawable-xxxhdpi/ic_video_white_24dp.png rename src/main/res/layout/{activity_fullscreen_message.xml => activity_media_viewer.xml} (90%) create mode 100644 src/main/res/menu/media_viewer.xml diff --git a/build.gradle b/build.gradle index 72e2088e9..52df95a1f 100644 --- a/build.gradle +++ b/build.gradle @@ -68,7 +68,7 @@ dependencies { implementation "com.android.support:design:$supportLibVersion" implementation "com.android.support:cardview-v7:$supportLibVersion" implementation 'com.github.bumptech.glide:glide:3.8.0' - implementation 'com.github.chrisbanes:PhotoView:2.0.0' + implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0' implementation 'com.github.rtoshiro.fullscreenvideoview:fullscreenvideoview:1.1.3' implementation 'pub.devrel:easypermissions:1.2.0' implementation 'com.wefika:flowlayout:0.4.1' @@ -156,7 +156,7 @@ android { } lintOptions { - disable 'ExtraTranslation', 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource' + disable 'ExtraTranslation', 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource', 'RestrictedApi' } subprojects { diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index bfdb2ec3d..ce3bfc406 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -104,8 +104,8 @@ android:name=".ui.ConversationsActivity" android:label="@string/app_name" android:launchMode="singleTask" - android:minHeight="300dp" android:minWidth="300dp" + android:minHeight="300dp" android:windowSoftInputMode="stateHidden"> { switch (attachmentItem.getItemId()) { diff --git a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java b/src/main/java/de/pixart/messenger/ui/MediaViewerActivity.java similarity index 67% rename from src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java rename to src/main/java/de/pixart/messenger/ui/MediaViewerActivity.java index b34e49653..a8285d594 100644 --- a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java +++ b/src/main/java/de/pixart/messenger/ui/MediaViewerActivity.java @@ -4,6 +4,8 @@ import android.content.ActivityNotFoundException; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.ActivityInfo; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.BitmapFactory; @@ -13,37 +15,40 @@ import android.os.Bundle; import android.preference.PreferenceManager; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.ActionBar; +import android.support.v7.view.menu.MenuBuilder; +import android.support.v7.view.menu.MenuPopupHelper; +import android.support.v7.widget.PopupMenu; import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.view.WindowManager; import android.webkit.MimeTypeMap; import android.widget.ImageView; import android.widget.Toast; -import com.bumptech.glide.Glide; -import com.bumptech.glide.load.resource.drawable.GlideDrawable; -import com.bumptech.glide.request.animation.GlideAnimation; -import com.bumptech.glide.request.target.GlideDrawableImageViewTarget; -import com.github.chrisbanes.photoview.PhotoView; -import com.github.chrisbanes.photoview.PhotoViewAttacher; +import com.davemorrissey.labs.subscaleview.ImageSource; +import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; import com.github.rtoshiro.view.video.FullscreenVideoLayout; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; +import java.util.List; import de.pixart.messenger.Config; import de.pixart.messenger.R; import de.pixart.messenger.persistance.FileBackend; import de.pixart.messenger.utils.ExifHelper; +import de.pixart.messenger.utils.MimeUtils; import static de.pixart.messenger.persistance.FileBackend.close; -public class ShowFullscreenMessageActivity extends XmppActivity { +public class MediaViewerActivity extends XmppActivity { Integer oldOrientation; - PhotoView mImage; + SubsamplingScaleImageView mImage; FullscreenVideoLayout mVideo; ImageView mFullscreenbutton; Uri mFileUri; @@ -52,6 +57,22 @@ public class ShowFullscreenMessageActivity extends XmppActivity { int height = 0; int width = 0; int rotation = 0; + boolean isImage = false; + boolean isVideo = false; + + public static String getMimeType(String path) { + try { + String type = null; + String extension = path.substring(path.lastIndexOf(".") + 1, path.length()); + if (extension != null) { + type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); + } + return type; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } @Override public void onCreate(Bundle savedInstanceState) { @@ -73,18 +94,59 @@ public class ShowFullscreenMessageActivity extends XmppActivity { getWindow().setAttributes(layout); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); - setContentView(R.layout.activity_fullscreen_message); + setContentView(R.layout.activity_media_viewer); mImage = findViewById(R.id.message_image_view); mVideo = findViewById(R.id.message_video_view); mFullscreenbutton = findViewById(R.id.vcv_img_fullscreen); fab = findViewById(R.id.fab); fab.setOnClickListener(v -> { - mVideo.reset(); - shareWith(mFile); + PopupMenu popup = new PopupMenu(MediaViewerActivity.this, v); + popup.inflate(R.menu.media_viewer); + final Menu menu = popup.getMenu(); + MenuItem delete = menu.findItem(R.id.action_delete); + MenuItem open = menu.findItem(R.id.action_open); + Log.d(Config.LOGTAG, "Path = " + mFile.toString()); + if (mFile == null || !mFile.toString().startsWith("/") || mFile.toString().contains(FileBackend.getConversationsDirectory("null"))) { + delete.setVisible(true); + } else { + delete.setVisible(false); + } + if (isVideo) { + if (isDarkTheme()) { + open.setIcon(R.drawable.ic_video_white_24dp); + } else { + open.setIcon(R.drawable.ic_video_black_24dp); + } + } else if (isImage) { + if (isDarkTheme()) { + open.setIcon(R.drawable.ic_image_white_24dp); + } else { + open.setIcon(R.drawable.ic_image_black_24dp); + } + } + popup.setOnMenuItemClickListener(item -> { + switch (item.getItemId()) { + case R.id.action_share: + share(); + break; + case R.id.action_open: + open(); + break; + case R.id.action_delete: + deleteFile(); + break; + default: + return false; + } + return true; + }); + MenuPopupHelper menuHelper = new MenuPopupHelper(MediaViewerActivity.this, (MenuBuilder) menu, v); + menuHelper.setForceShowIcon(true); + menuHelper.show(); }); } - private void shareWith(File mFile) { + private void share() { Intent share = new Intent(Intent.ACTION_SEND); share.setType(getMimeType(mFile.toString())); share.putExtra(Intent.EXTRA_STREAM, FileBackend.getUriForFile(this, mFile)); @@ -96,18 +158,35 @@ public class ShowFullscreenMessageActivity extends XmppActivity { } } - public static String getMimeType(String path) { + private void deleteFile() { + this.xmppConnectionService.getFileBackend().deleteFile(mFile); + finish(); + } + + private void open() { + Uri uri; try { - String type = null; - String extension = path.substring(path.lastIndexOf(".") + 1, path.length()); - if (extension != null) { - type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension); - } - return type; - } catch (Exception e) { - e.printStackTrace(); + uri = FileBackend.getUriForFile(this, mFile); + } catch (SecurityException e) { + Log.d(Config.LOGTAG, "No permission to access " + mFile.getAbsolutePath(), e); + Toast.makeText(this, this.getString(R.string.no_permission_to_access_x, mFile.getAbsolutePath()), Toast.LENGTH_SHORT).show(); + return; + } + String mime = MimeUtils.guessMimeTypeFromUri(this, uri); + Intent openIntent = new Intent(Intent.ACTION_VIEW); + openIntent.setDataAndType(uri, mime); + openIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + PackageManager manager = this.getPackageManager(); + List info = manager.queryIntentActivities(openIntent, 0); + if (info.size() == 0) { + openIntent.setDataAndType(uri, "*/*"); + } + try { + this.startActivity(openIntent); + finish(); + } catch (ActivityNotFoundException e) { + Toast.makeText(this, R.string.no_application_found_to_open_file, Toast.LENGTH_SHORT).show(); } - return null; } @Override @@ -125,34 +204,38 @@ public class ShowFullscreenMessageActivity extends XmppActivity { mFile = new File(mFileUri.getPath()); if (mFileUri != null && mFile.exists() && mFile.length() > 0) { try { - DisplayImage(mFile); + isImage = true; + DisplayImage(mFile, mFileUri); } catch (Exception e) { + isImage = false; Log.d(Config.LOGTAG, "Illegal exeption :" + e); - Toast.makeText(ShowFullscreenMessageActivity.this, getString(R.string.error_file_corrupt), Toast.LENGTH_SHORT).show(); + Toast.makeText(MediaViewerActivity.this, getString(R.string.error_file_corrupt), Toast.LENGTH_SHORT).show(); finish(); } } else { - Toast.makeText(ShowFullscreenMessageActivity.this, getString(R.string.file_deleted), Toast.LENGTH_SHORT).show(); + Toast.makeText(MediaViewerActivity.this, getString(R.string.file_deleted), Toast.LENGTH_SHORT).show(); } } else if (intent.hasExtra("video")) { mFileUri = intent.getParcelableExtra("video"); mFile = new File(mFileUri.getPath()); if (mFileUri != null && mFile.exists() && mFile.length() > 0) { try { + isVideo = true; DisplayVideo(mFileUri); } catch (Exception e) { + isVideo = false; Log.d(Config.LOGTAG, "Illegal exeption :" + e); - Toast.makeText(ShowFullscreenMessageActivity.this, getString(R.string.error_file_corrupt), Toast.LENGTH_SHORT).show(); + Toast.makeText(MediaViewerActivity.this, getString(R.string.error_file_corrupt), Toast.LENGTH_SHORT).show(); finish(); } } else { - Toast.makeText(ShowFullscreenMessageActivity.this, getString(R.string.file_deleted), Toast.LENGTH_SHORT).show(); + Toast.makeText(MediaViewerActivity.this, getString(R.string.file_deleted), Toast.LENGTH_SHORT).show(); } } } } - private void DisplayImage(final File file) { + private void DisplayImage(final File file, final Uri FileUri) { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFile(new File(file.getPath()).getAbsolutePath(), options); @@ -163,19 +246,9 @@ public class ShowFullscreenMessageActivity extends XmppActivity { if (useAutoRotateScreen()) { rotateScreen(width, height, rotation); } - final PhotoViewAttacher mAttacher = new PhotoViewAttacher(mImage); mImage.setVisibility(View.VISIBLE); try { - Glide.with(this) - .load(file) - .dontAnimate() - .into(new GlideDrawableImageViewTarget(mImage) { - @Override - public void onResourceReady(GlideDrawable resource, GlideAnimation animation) { - super.onResourceReady(resource, animation); - mAttacher.update(); - } - }); + mImage.setImage(ImageSource.uri(FileUri)); } catch (Exception e) { Toast.makeText(this, getString(R.string.error_file_corrupt), Toast.LENGTH_LONG).show(); e.printStackTrace(); diff --git a/src/main/java/de/pixart/messenger/ui/util/ViewUtil.java b/src/main/java/de/pixart/messenger/ui/util/ViewUtil.java index b1905479b..07e25e31d 100644 --- a/src/main/java/de/pixart/messenger/ui/util/ViewUtil.java +++ b/src/main/java/de/pixart/messenger/ui/util/ViewUtil.java @@ -15,7 +15,7 @@ import java.util.List; import de.pixart.messenger.Config; import de.pixart.messenger.R; import de.pixart.messenger.persistance.FileBackend; -import de.pixart.messenger.ui.ShowFullscreenMessageActivity; +import de.pixart.messenger.ui.MediaViewerActivity; public class ViewUtil { @@ -36,7 +36,7 @@ public class ViewUtil { } // use internal viewer for images and videos if (mime.startsWith("image/")) { - Intent intent = new Intent(context, ShowFullscreenMessageActivity.class); + Intent intent = new Intent(context, MediaViewerActivity.class); intent.putExtra("image", Uri.fromFile(file)); try { context.startActivity(intent); @@ -45,7 +45,7 @@ public class ViewUtil { //ignored } } else if (mime.startsWith("video/")) { - Intent intent = new Intent(context, ShowFullscreenMessageActivity.class); + Intent intent = new Intent(context, MediaViewerActivity.class); intent.putExtra("video", Uri.fromFile(file)); try { context.startActivity(intent); diff --git a/src/main/res/drawable-hdpi/ic_delete_black_24dp.png b/src/main/res/drawable-hdpi/ic_delete_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..789d96d422c7b6ef434b6ecd2ba4ea6c93419a1e GIT binary patch literal 492 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBSkfJR9T^xl_H+M9WCijWi-X*q z7}lMWc?skwB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|lZhf6zroh0Uur+z@6u!U+_a*VWhfkj=zesqu%d zSm7?~4oNAa{6dQ<@A#N3pV`fuuy}Q|(nP1U1F|Jt-N|fM9FM4d3uN!L;t;p9ydh+I z;?ahKQ{E=uz*Rw$8LRjtIFy$bEe-$7EK=Kf#Nxz^Q@kb|k1|%Oc%$NbBwt2cZhE&{2PLN<-oFLNE6xbmD z=l}ov0v+rBESKBCcH~&Zn?$yxyd;?r&Lj0JUnoq742^ih$@qu`DDr>)uLX=}`#cot zy7m0Z*&P>avb>t{zxkk}!tp!DMT<&G1%gce%JcA9wH`HOex0B3k@zYGGw!PN#1oz+6?pogQu&X%Q~loCII$YSndD- literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-mdpi/ic_delete_black_24dp.png b/src/main/res/drawable-mdpi/ic_delete_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..7981a3def4fb74bb946ed827a32b436275753917 GIT binary patch literal 410 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEa{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YPV z+ua371Hn({-St3dh64!{5l*E!$tK_0oAjM#0U}&LhXrOCg z9Aao`Wnyk+YN>5tU}az+Rb;mkMMG|WN@iLmZVlP`ZK6O88Xy~r%hIiq5{pxHON%lY v(lT>Wt@QQvOL7bJa}(1ule2YAElnZ!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YPV z+ua371Hn({-St3 z7N_c#7G*M|W#*(>>Fev4!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YPV z+ua371Hn({-St3Hqr# z^)4=Qlr26Qu=sYzE)~bw3Keg~-=vw$Ptc$E|D5WLgChD8>gU8QCxuk>1no)I%b2(K ziF3?jZLbXn4o+~Zy}h+?QRSR%-Iv2Hg_h)OFFF=-!JgZ9(a+@%W;mYM_)?*1x69dx z4Np8dJKYY+N$uDFSs`tH_xRMUzV8dS@Gj!wzsCQTDLvwtMR>yc)$5hMUM!usfkUmr zTfpXfchS1ff}Ca-rz$nfc6qmLic3rFnGYh5LmIb#+WvvLaZlj4?;odq0fvNXiEBhj zN@7W>RdP`(kYX@0FtpG$G|)9L4l%T}GBUI>Hq#kdoSCL*=I9;(X Q2dIa^)78&qol`;+0I)F76#xJL literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-mdpi/ic_video_black_24dp.png b/src/main/res/drawable-mdpi/ic_video_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..c4be08a5556bd2d79acc1eb4144d3771680ad5e5 GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gjk)AG&Ar-fh6C_v{H{5z4A@E;a zP~P3xnQ=br|C2{fwB27mmDS+z|I3G%QVwS(9jujcbTj4t$6v|)?&2+`N)zvlNj?*G u7e=}@M>Yw|s2~2Yc!`MU;slWid<+|=9tv)ld`bpr34^DrpUXO@geCw6-7?_- literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-mdpi/ic_video_white_24dp.png b/src/main/res/drawable-mdpi/ic_video_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..60cc35c425b6749dbbf41cb84fb113a370754f55 GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gjv7RoDAr-fh6C_v{H>`T_|NsBv z|0eVGEuOis;XKnOhD{G0YUZnn9pG`_HX%z)LE2B7`&}}(QC8H4`V-Lw{nx}!C`UW3 yPT|_#GEI^5oeQjt;In4S)_h{4m<&t;ucLK6UpGc_mx literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xhdpi/ic_delete_black_24dp.png b/src/main/res/drawable-xhdpi/ic_delete_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..16e6e70555da14a079c168acbd92647a4634329c GIT binary patch literal 479 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCmUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIA^$sR$z3=CCj3=9n|3=F@3LJcn%7)pVryh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6Mi^+1ZVz$3C4NPB>>+sSM@AY*~2i(^Q}y|*_F`I;OUST9~I&UkC8ySMA! zfkV=g!iN|)7~DE_>fOH;pM|WP{y8jQRCyWxrZMwbp+|qL(Y~xBs~+50`Pp~o*4(?5 zA*F0D?oX|0oflQ#+htb!*E+#r7Goyc63Gc^XpCAR1G78EUpRJ{@K~7d`F5IbN8mr_ z$9D@^&1{(%wjJm^t{iVw!_a4Y+&jp&T+PYt+oF^2!+>s8Epd$~Nl7e8wMs5Z1yT$~ z28I^8h6cI@#vz85Rwm|Frk2_U237_JQbl$vQ8eV{r(~v8;?|I@-zEywpaHU>xGdc& zDX}NS%G}U;vjb? zhIQv;UIIA^$sR$z3=CCj3=9n|3=F@3LJcn%7)pVryh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6Mi^+1ZVz$3C4NPB>>+sSM@Aj8?y#W5t~-rK8+LJWo+EC(n2|3C9Z$kQvG zq9xI1)+FgNH0*r!`oi70eY>4j&s%FP`)xWS!{(nyGT9i;JQH3n$-v-nj&bQ`9x<_( zT(^P7sg}4#l%ynzopr0Otj8#{d8T literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xhdpi/ic_share_black_24dp.png b/src/main/res/drawable-xhdpi/ic_share_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..5c058d4eb5a43cf4c64eaa008252b0484cbeb6bd GIT binary patch literal 852 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCmUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIA^$sR$z3=CCj3=9n|3=F@3LJcn%7)pVryh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6Mi^+1ZVz$3C4NPB>>+sSM@1_mZkPZ!6KjC*fy+GdLcN*w)oUn_;x(VI1U z>xF9#O|!z*=57_fqGERIx9A(+MQ_46>RM6`i$$$aF>7j#(h$1l6yg5#N~@@b$_LJRyX|!6plQ1 zB#HOqVKaH%Z9TngY}Xbaopv!lVL^Q9U@T=eCJQ%!1_9~a-j2rj*kacih%ss0GmpaHU>xGdc&DX}!VR4 literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xhdpi/ic_video_black_24dp.png b/src/main/res/drawable-xhdpi/ic_video_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..f695100bb57ca74b9833f4f38160d367634bb3e9 GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpUt*`6+rAr-gY-tgsWP!MoPTp#|R z^Uj&f)6p}!Z@E0>&oKTVcgF0G#^IvA4j`Bp_4!TZr3amre>e{G9F5;BdQHi;!K8AZ z*!(q2OPE%ODNHT*P<4=!Gc0AuyraB|;nK#FR~eRk)?Lar0caP)gK&opdoko@Ob!RDp)%qwP@ z-`o8!`+!-T(1iZ!%x{i+GoCwknql2BZ-zY|wHTOzwlw%N21;$PGxlP(X}NVeW(wOJ z#Sr_9MJ5XFdl-FQ$$!0D^jPZg<;))wU4fQ-*(2Gv&12*HAFC>XS{XcD{an^LB{Ts5 DXPQzt literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xxhdpi/ic_delete_black_24dp.png b/src/main/res/drawable-xxhdpi/ic_delete_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..d118ae77b6c1fbf5bea8d0457a635c54284d3e9f GIT binary patch literal 575 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!Ea{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YPV z+ua371Hn({-St3hql4kk$+0)Oa&GJ?8oV0{bXR^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LrW_oLn~uL zZ36=<0|Tze!@%s0q#-vyB{QuOw}xt#>W@GT8Xy~r%hIiq5{pxHON%lY(lT>Wt@QQv nOL7bJa}(1ule2Xrg44`Wb5e}=3A>jA^)Pt4`njxgN@xNA=QHR@ literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xxhdpi/ic_video_black_24dp.png b/src/main/res/drawable-xxhdpi/ic_video_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..2cb46bf1a31a9f6a7e6e52287f73fb053f8e8615 GIT binary patch literal 325 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@Zgyv2VC3<1aSW-r_4bw{*C7J|hl_I- ze37^`*U5ISHvjSqOJ6A7x_3bDkw{cQvRb1<@N@eabGyGhcF-*31DXH=MXOWvjGBA& zbKGXG_Su`d!1CPg0~W7+PD=)Fv1I0DJs!E-zvuHA$rJBWl1z+Z554zg&D#G+;KlK% zN~YH9T@I(B1U(|PnKZLq6;jupVZU_kRLKIhPxF(_0-k@`U->^&!C!$%u)~2xNuZG< z#pJ?VhliFY?r@0IJy?9E+2J9(o$I>UFZt69U#I<>yn0(+&6e->4bG-u0 z8~0^T{ncA6_@aC*N6H$}#-6Q86E=pi7+pJ6tB}1mhP^9N`+eiB`ufd#ScI4aI~-V) z1R6P96qYx>V~N^!d8c5;&-1SwpF1vi`nWIo%&tm%1LNzx%Hhd(Ew-3n>vcG`OYlU5 zIg{jTH-+T8MQl>$7u3K0I&GZ3prAQh%ffHRovBrgujUvBD9?{ht8FZ7`*|}<&l~Ec ai0je^=56_;zJPf%$cLV;elF{r5}E)Ci;0K; literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xxxhdpi/ic_delete_black_24dp.png b/src/main/res/drawable-xxxhdpi/ic_delete_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..c49da5b4e6775de179726b9f3e2a3a6078f5368e GIT binary patch literal 668 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoEa{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YPV z+ua371Hn({-St3Gkfv0;VT< z{eCF@&?op+TYihY&r11!1%hI%`zx35hpu^fChx`NKjmx4KGZ+(q42MZ79!Iw? zc(3>OcEHP?8tx{96kH807!myp?7t?|e~8=b*w2tJ`)$RiC=ly5Uv|wBDYnGl2;h;;JRC5hW>!C8<`)MX5lF z!N|bSLf6nh*T6W$(9+7p+{)Ba+rYrez(A_VZY7F_-29Zxv`X9>vh~|Uff_VGHWZho zTO}nHr|Om#Wiq5?=A>Hb>+6@~7U<_Dre`K+>sC5@W*g_GBxx>)I}Fsr;OXk;vd$@? F2>^JO;w1n8 literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xxxhdpi/ic_menu_white_24dp.png b/src/main/res/drawable-xxxhdpi/ic_menu_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..0966d1f16ae0d8bdd7eeb50342a807906225b29d GIT binary patch literal 450 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoEa{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YPV z+ua371Hn({-St3ABtGRJRZO;tf zAE|KB2B3q0U_+;Gh2iWEr#T>Mfue?tU5;nc@1ZvO# z*-%`TZk3c+oT^(|l*y2mnUiXzudiQ{TcDqtn4X!Ot?TdO=bxEs5IkYY>m5Kn44$rj JF6*2UngDd=fENG& literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xxxhdpi/ic_share_black_24dp.png b/src/main/res/drawable-xxxhdpi/ic_share_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..484b6d474b39cd216f323d6c42bf76538cb2742a GIT binary patch literal 1556 zcmZ{kcTm$w6vuxaMImq}8o+{uQz?ltzl0V-hk!&{XbKXM&;w~Cp%_pQK}3+~Aw_Az zpmIaeC>R35h#(3m3LKFGq7>oag7hvY_v8M!xqohF-hTG&+wZ=aoqaEr!q2~R#)T`)Mi8B6 z)?87uT<9GxzFSPvfh#6kL(spWE7B(Esg0Z%%y8&3nqQk)-8(aKU?V%Wq@gvA_EJGf z7WYs7HuL;KF_U~fBk*GcucLtXVM5W#y7BD(J(vt{HbtBucK5 zQ6C~wJ9(`p8I5|vA<>yKs_gPR z!}+ap!!v*6r%_6NrcVMRSl3+j;i~5I#59geW1fh_LI#*+p;;H9_tXo48JGwdW4?ps zcT&=KD9qHXzG!or0;4Ff=^oy0A6;556t$yVVH~{}V->41;c7a{HDaU=QCsS=^5k-= z1&ig`<0gk?t)3>`(-Bt=>e3S%kY3D@;y4oIahSR4TL9hi)N2R(LSHwC9^ z#zHL^?qX1>>dr)2n~f!qvY)t>!&JEeQF12>#)M8e?#HQX~C2V|uyf^1dVca9q zl6ds9^@VkjNDh}tlC(OSCT(wd^+Rk@VwKP*ZszAEmD=vM`L>IFD4crNdzD3m=Odkh z$?7FM&ES%s@il$~hcPT|VbA3(X29~k(KO}O-2yi$&yUI8l53(%4u7Ic_y=xXY<)I! z+v$7!m)f!h8wJ2+bYEQXeEO^%4@D##Iwq+dCh{bIc#m#vTRmXUiD&JSYn!3&W zWm$<+D)KccBNx;2=y+xVpAGAE8Z2FquhoQ#vsDTe=SMcI=f>L?LanL|CTJ!EC8rKG zo<6sBo_a3ybZ8UzIl|+-upIia6%-@9`%}j<9&Y;WbqlTAUQtuSHyOtri0^2F2>3?E z`cnLk)XhrkPojT23mmb4HVx%=)azWwL!Isz*Vc<0NZ|(I1K2?j04#{Xp)eo{)bqd? z=U*g|)bHV@s literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xxxhdpi/ic_video_black_24dp.png b/src/main/res/drawable-xxxhdpi/ic_video_black_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..bd76e9db6c6867c1960716fd892293be72658914 GIT binary patch literal 425 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>U@Y)-aSW-r_4ZD*ACsei!^OCc zy4^?qt$mx}abt#1BD00Cq2UpB1LIhq=W~{bImFI!R}TW22L=b0A5SzpEYoJWuIAYJ z4YJQNeNWfFPWbqIvvuvZ-P>Ol{EYu>RA_!t>A=Fr48J>1+i&A2cvG`XC%&PD!O+=( zF)t?J%olN$1H9ZllKP2EF*^^;_$jA!K$N?OHSZBq%#H&Zr)^w03l1_Z*7+`>eZZc( zXVaVN7KVBqgHxaMiTZ>#yO#8mR17; z6NdsC;cza5@zef;p$&h$Jwz4$OU1FC*xwn(_-TI9Du$o^6M^E-e`q=U>ka`*`flTz zP(LMr^@RQDl}u0MmxVHZ@;A;t&0za~@weYCdtFvD-0owx@xSA{g~Q|o^uGRnm literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xxxhdpi/ic_video_white_24dp.png b/src/main/res/drawable-xxxhdpi/ic_video_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..d8ab46d9fc071ba10c66a9599b3210b8c79c4c1b GIT binary patch literal 419 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7Ro>V9fG#aSW-r_4ZD5)*%OpwnXtu zal4P)OSA5JaO_sl-2){}=1Ou!GkzwwJ#W0j^)s&1aKUU|pl&d5m=^Tw%yC8e=UeLj zTFQLh7<>7L{Yu;Ye|N4`JfOHW+rD_Vp3;Gx4;hwQKK`yRAh;m2_?UP?Bg6H_+yXKW z%4!&ynD0o(H!NW2KPIlAaA5OC))g`juKr*O;W0?5Vbo%ku-eBU%G4tn-*AZWSf9Sb zL5ARC;tK*ARzBtqa0`DWq;|k--ZCzQ1_mY$G-AUHeMYf5_Vb+z4hy|cT;X66+0*6^ zRjY}C@qWsDR{@0=frl1zFtOO3 z-YM?b@Sr_&yC6%%gUn~8EgcNH{{w#KAJa>;zhY-5lVA?^qFL;}8;eZu|NL=djpMFA s$*1h(m$S9KKcBdL)<;HYP&I7-&Y#Ng>?_~=wsRmMPgg&ebxsLQ0Q(iB2mk;8 literal 0 HcmV?d00001 diff --git a/src/main/res/layout/activity_fullscreen_message.xml b/src/main/res/layout/activity_media_viewer.xml similarity index 90% rename from src/main/res/layout/activity_fullscreen_message.xml rename to src/main/res/layout/activity_media_viewer.xml index c1a1bc619..2eaad0d04 100644 --- a/src/main/res/layout/activity_fullscreen_message.xml +++ b/src/main/res/layout/activity_media_viewer.xml @@ -13,7 +13,7 @@ android:layout_alignParentRight="true" android:layout_alignParentTop="true"> - + android:src="@drawable/ic_menu_white_24dp" /> \ No newline at end of file diff --git a/src/main/res/menu/contact_details.xml b/src/main/res/menu/contact_details.xml index 50243150b..b9268e4f9 100644 --- a/src/main/res/menu/contact_details.xml +++ b/src/main/res/menu/contact_details.xml @@ -11,7 +11,7 @@ diff --git a/src/main/res/menu/editaccount.xml b/src/main/res/menu/editaccount.xml index fbc5841ea..cbdde1fce 100644 --- a/src/main/res/menu/editaccount.xml +++ b/src/main/res/menu/editaccount.xml @@ -9,7 +9,7 @@ + + + + + \ No newline at end of file diff --git a/src/main/res/menu/muc_details.xml b/src/main/res/menu/muc_details.xml index b5e74f271..9f12e7333 100644 --- a/src/main/res/menu/muc_details.xml +++ b/src/main/res/menu/muc_details.xml @@ -4,7 +4,7 @@ diff --git a/src/main/res/values/attrs.xml b/src/main/res/values/attrs.xml index 284e7d74b..c537fd248 100644 --- a/src/main/res/values/attrs.xml +++ b/src/main/res/values/attrs.xml @@ -75,6 +75,7 @@ + diff --git a/src/main/res/values/defaults.xml b/src/main/res/values/defaults.xml index e213ea773..51971bcfd 100644 --- a/src/main/res/values/defaults.xml +++ b/src/main/res/values/defaults.xml @@ -41,7 +41,7 @@ \n\nhttp://hc.apache.org/httpcomponents-client\n(Apache License, Version 2.0) \n\nhttp://hc.apache.org/httpcomponents-core\n(Apache License, Version 2.0) \n\nhttps://github.com/bumptech/glide\n(BSD, The MIT License (MIT) and Apache License, Version 2.0) - \n\nhttps://github.com/chrisbanes/PhotoView\n(Apache License, Version 2.0) + \n\nhttps://github.com/davemorrissey/subsampling-scale-image-view\n(Apache License, Version 2.0) \n\nhttps://github.com/rtoshiro/FullscreenVideoView\n(Apache License, Version 2.0) \n\nhttps://github.com/mangstadt/ez-vcard\n(FreeBSD) \n\nhttps://github.com/googlesamples/easypermissions\n(Apache License, Version 2.0) diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index d3f9eeb0c..28a0b3156 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -827,4 +827,6 @@ View media Media browser Stream opening error + Open + Delete diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index 8abbbd1e9..a8bdf3e1d 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -99,7 +99,8 @@ @drawable/ic_settings_black_24dp @drawable/ic_import_export_white_24dp - @drawable/ic_share_white_24dp + @drawable/ic_delete_black_24dp + @drawable/ic_share_black_24dp @drawable/ic_barcode_scan_white_24dp @drawable/ic_scroll_to_end_black @@ -271,6 +272,7 @@ @drawable/ic_settings_white_24dp @drawable/ic_import_export_white_24dp + @drawable/ic_delete_white_24dp @drawable/ic_share_white_24dp @drawable/ic_barcode_scan_white_24dp @drawable/ic_scroll_to_end_white