From e6995cbdd46c4d5511547da42021def6180fee08 Mon Sep 17 00:00:00 2001 From: Maxime Naturel Date: Wed, 23 Feb 2022 14:08:02 +0100 Subject: [PATCH] Draft --- .../AttachmentViewerViewModel.kt | 22 +++++++++++++++++++ .../action/MessageActionsViewModel.kt | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerViewModel.kt diff --git a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerViewModel.kt b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerViewModel.kt new file mode 100644 index 0000000000..fbb46d4348 --- /dev/null +++ b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerViewModel.kt @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 New Vector Ltd + * Copyright (C) 2018 stfalcon.com + * + * 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 im.vector.lib.attachmentviewer + +class AttachmentViewerViewModel { + +} diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt index 763720faa3..13ae8098c3 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt @@ -554,6 +554,7 @@ class MessageActionsViewModel @AssistedInject constructor(@Assisted } } + // TODO need to add this check into media viewer? private fun canShare(msgType: String?): Boolean { return when (msgType) { MessageType.MSGTYPE_TEXT, @@ -568,6 +569,7 @@ class MessageActionsViewModel @AssistedInject constructor(@Assisted } } + // TODO need to add this into Viewer screen to check if it is saveable? => create extension on MessageType? private fun canSave(msgType: String?): Boolean { return when (msgType) { MessageType.MSGTYPE_IMAGE,