diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-09-26 21:48:57 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-09-26 21:48:57 +0200 |
commit | f4ac1f68feac3e3b19ab5932ede9d79dd14bff27 (patch) | |
tree | f45948ade6055a72a919685a3c6430969f02b761 /src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java | |
parent | 8cb243536bb1fbe7743ebc428d79b6f99c844444 (diff) |
do not show media overview in contact/conference details when missing storage permission
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index 72168ab89..070914bb8 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -57,6 +57,7 @@ import de.pixart.messenger.ui.util.GridManager; import de.pixart.messenger.ui.util.MucDetailsContextMenuHelper; import de.pixart.messenger.ui.util.MyLinkify; import de.pixart.messenger.ui.util.SoftKeyboardUtils; +import de.pixart.messenger.utils.Compatibility; import de.pixart.messenger.utils.EmojiWrapper; import de.pixart.messenger.utils.MenuDoubleTabUtil; import de.pixart.messenger.utils.StringUtils; @@ -337,6 +338,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers if (this.mTheme != theme) { recreate(); } + binding.mediaWrapper.setVisibility(Compatibility.hasStoragePermission(this) ? View.VISIBLE : View.GONE); } @Override @@ -521,9 +523,11 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers if (uuid != null) { this.mConversation = xmppConnectionService.findConversationByUuid(uuid); if (this.mConversation != null) { - final int limit = GridManager.getCurrentColumnCount(this.binding.media); - xmppConnectionService.getAttachments(this.mConversation, limit, this); - this.binding.showMedia.setOnClickListener((v) -> MediaBrowserActivity.launch(this, mConversation)); + if (Compatibility.hasStoragePermission(this)) { + final int limit = GridManager.getCurrentColumnCount(this.binding.media); + xmppConnectionService.getAttachments(this.mConversation, limit, this); + this.binding.showMedia.setOnClickListener((v) -> MediaBrowserActivity.launch(this, mConversation)); + } updateView(); } } |