diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml deleted file mode 100644 index a410ea0af9..0000000000 --- a/.buildkite/pipeline.yml +++ /dev/null @@ -1,95 +0,0 @@ -# Use Docker file from https://hub.docker.com/r/runmymind/docker-android-sdk -# Last docker plugin version can be found here: -# https://github.com/buildkite-plugins/docker-buildkite-plugin/releases -# We propagate the environment to the container (sse https://github.com/buildkite-plugins/docker-buildkite-plugin#propagate-environment-optional-boolean) - -steps: - - label: "Compile and run Unit tests" - agents: - # We use a medium sized instance instead of the normal small ones because - # gradle build can be memory hungry - queue: "medium" - commands: - - "./gradlew clean test --stacktrace" - plugins: - - docker#v3.1.0: - image: "runmymind/docker-android-sdk" - propagate-environment: true - - - label: "Compile Android tests" - agents: - # We use a medium sized instance instead of the normal small ones because - # gradle build can be memory hungry - queue: "medium" - commands: - - "./gradlew clean assembleAndroidTest --stacktrace" - plugins: - - docker#v3.1.0: - image: "runmymind/docker-android-sdk" - propagate-environment: true - - - label: "Assemble GPlay Debug version" - agents: - # We use a xlarge sized instance instead of the normal small ones because - # gradle build can be memory hungry - queue: "xlarge" - commands: - - "./gradlew clean lintGplayRelease assembleGplayDebug --stacktrace" - artifact_paths: - - "vector/build/outputs/apk/gplay/debug/*.apk" - branches: "!master" - plugins: - - docker#v3.1.0: - image: "runmymind/docker-android-sdk" - propagate-environment: true - - - label: "Assemble FDroid Debug version" - agents: - # We use a xlarge sized instance instead of the normal small ones because - # gradle build can be memory hungry - queue: "xlarge" - commands: - - "./gradlew clean lintFdroidRelease assembleFdroidDebug --stacktrace" - artifact_paths: - - "vector/build/outputs/apk/fdroid/debug/*.apk" - branches: "!master" - plugins: - - docker#v3.1.0: - image: "runmymind/docker-android-sdk" - propagate-environment: true - - - label: "Build Google Play unsigned APK" - agents: - # We use a xlarge sized instance instead of the normal small ones because - # gradle build can be memory hungry - queue: "xlarge" - commands: - - "./gradlew clean assembleGplayRelease --stacktrace" - artifact_paths: - - "vector/build/outputs/apk/gplay/release/*.apk" - branches: "master" - plugins: - - docker#v3.1.0: - image: "runmymind/docker-android-sdk" - propagate-environment: true - - # Code quality - - - label: "Code quality" - command: - - "./tools/check/check_code_quality.sh" - - - label: "ktlint" - command: - - "curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.34.2/ktlint && chmod a+x ktlint" - - "./ktlint --android --experimental -v" - plugins: - - docker#v3.1.0: - image: "openjdk" - - # Check that indonesians files are identical. - # Due to Android issue, the resource folder must be values-in/, and Weblate export data into values-id/. - # If this step fails, it means that Weblate has updated the file in value-id/ so to fix it, copy the file to values-in/ - - label: "Indonesian" - command: - - "diff ./vector/src/main/res/values-id/strings.xml ./vector/src/main/res/values-in/strings.xml" diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 40ee4ee5cf..b3719669fd 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,9 +1,6 @@ <component name="ProjectCodeStyleConfiguration"> <code_scheme name="Project" version="173"> <option name="RIGHT_MARGIN" value="160" /> - <AndroidXmlCodeStyleSettings> - <option name="ARRANGEMENT_SETTINGS_MIGRATED_TO_191" value="true" /> - </AndroidXmlCodeStyleSettings> <JetCodeStyleSettings> <option name="PACKAGES_TO_USE_STAR_IMPORTS"> <value> diff --git a/.travis.yml b/.travis.yml index 2ce6eec1c0..6b9e9f9946 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,12 +49,12 @@ script: # Build Android test (assembleAndroidTest) (disabled for now) # Code quality (lintGplayRelease lintFdroidRelease) # Split into two steps because if a task contain Fdroid, PlayService will be disabled - - ./gradlew clean assembleGplayRelease lintGplayRelease --stacktrace - - ./gradlew clean assembleFdroidRelease lintFdroidRelease --stacktrace + # Done by Buildkite now: - ./gradlew clean assembleGplayRelease lintGplayRelease --stacktrace + # Done by Buildkite now: - ./gradlew clean assembleFdroidRelease lintFdroidRelease --stacktrace # Run unitary test (Disable for now, see https://travis-ci.org/vector-im/riot-android/builds/502504370) # - ./gradlew testGplayReleaseUnitTest --stacktrace # Other code quality check - - ./tools/check/check_code_quality.sh + # Done by Buildkite now: - ./tools/check/check_code_quality.sh - ./tools/travis/check_pr.sh # Check that indonesians file are identical. Due to Android issue, the resource folder must be value-in/, and Weblate export data into value-id/. - - diff ./vector/src/main/res/values-id/strings.xml ./vector/src/main/res/values-in/strings.xml + # Done by Buildkite now: - diff ./vector/src/main/res/values-id/strings.xml ./vector/src/main/res/values-in/strings.xml diff --git a/CHANGES.md b/CHANGES.md index bff3421110..9efbbbf5e5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,10 +5,17 @@ Features ✨: - Improvements 🙌: + - Share image and other media from e2e rooms (#677) + - Add support for `/plain` command (#12) + - Detect spaces in password if user fail to login (#1038) + - FTUE: do not display a different color when encrypting message when not in developer mode. + - Open room member profile from avatar of the room member state event (#935) - Restore the push rules configuration in the settings Bugfix 🐛: - Fix crash on attachment preview screen (#1088) + - "Share" option is not appearing in encrypted rooms for images (#1031) + - Set "image/jpeg" as MIME type of images instead of "image/jpg" (#1075) Translations 🗣: - @@ -17,10 +24,12 @@ SDK API changes ⚠️: - PushRuleService.getPushRules() now returns a RuleSet. Use getAllRules() on this object to get all the rules. Build 🧱: - - + - Upgrade ktlint to version 0.36.0 + - Pipeline file for Buildkite is now hosted on another Github repository: https://github.com/matrix-org/pipelines/blob/master/riotx-android/pipeline.yml Other changes: - - + - Restore availability to Chromebooks (#932) + - Add a [documentation](./docs/integration_tests.md) to run integration tests Changes in RiotX 0.17.0 (2020-02-27) =================================================== diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e08a921fb..176a6ee9c1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,6 +82,8 @@ Make sure the following commands execute without any error: RiotX is currently supported on Android KitKat (API 19+): please test your change on an Android device (or Android emulator) running with API 19. Many issues can happen (including crashes) on older devices. Also, if possible, please test your change on a real device. Testing on Android emulator may not be sufficient. +You should consider adding Unit tests with your PR, and also integration tests (AndroidTest). Please refer to [this document](./docs/integration_tests.md) to install and run the integration test environment. + ### Internationalisation When adding new string resources, please only add new entries in file `value/strings.xml`. Translations will be added later by the community of translators with a specific tool named [Weblate](https://translate.riot.im/projects/riot-android/). diff --git a/docs/integration_tests.md b/docs/integration_tests.md new file mode 100644 index 0000000000..f7557a87a2 --- /dev/null +++ b/docs/integration_tests.md @@ -0,0 +1,97 @@ +# Integration tests + +Integration tests are useful to ensure that the code works well for any use cases. + +They can also be used as sample on how to use the Matrix SDK. + +In a ideal world, every API of the SDK should be covered by integration tests. For the moment, we have test mainly for the Crypto part, which is the tricky part. But it covers quite a lot of features: accounts creation, login to existing account, send encrypted messages, keys backup, verification, etc. + +The Matrix SDK is able to open multiple sessions, for the same user, of for different users. This way we can test communication between several sessions on a single device. + +## Pre requirements + +Integration tests need a homeserver running on localhost. + +The documentation describes what we do to have one, using [Synapse](https://github.com/matrix-org/synapse/), which is the Matrix reference homeserver. + +## Install and run Synapse + +Steps: + +- Install virtualenv + +```bash +python3 -m pip install virtualenv +``` + +- Clone Synapse repository + +```bash +git clone -b develop https://github.com/matrix-org/synapse.git +``` +or +```bash +git clone -b develop git@github.com:matrix-org/synapse.git +``` + +You should have the develop branch cloned by default. + +- Run synapse, from the Synapse folder you just cloned + +```bash +virtualenv -p python3 env +source env/bin/activate +pip install -e . +demo/start.sh --no-rate-limit +``` + +Alternatively, to install the latest Synapse release package (and not a cloned branch) you can run the following instead of `pip install -e .`: + +```bash +pip install matrix-synapse +``` + +You should now have 3 running federated Synapse instances 🎉, at http://127.0.0.1:8080/, http://127.0.0.1:8081/ and http://127.0.0.1:8082/, which should display a "It Works! Synapse is running" message. + +## Run the test + +It's recommended to run tests using an Android Emulator and not a real device. First reason for that is that the tests will use http://10.0.2.2:8080 to connect to Synapse, which run locally on your machine. + +You can run all the tests in the `androidTest` folders. + +## Stop Synapse + +To stop Synapse, you can run the following commands: + +```bash +./demo/stop.sh +``` + +And you can deactivate the virtualenv: + +```bash +deactivate +``` + +## Troubleshoot + +You'll need python3 to be able to run synapse + +### Android Emulator does cannot reach the homeserver + +Try on the Emulator browser to open "http://10.0.2.2:8080". You should see the "Synapse is running" message. + +### virtualenv command fails + +You can try using +```bash +python3 -m venv env +``` +or +```bash +python3 -m virtualenv env +``` +instead of +```bash +virtualenv -p python3 env +``` diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 062b590acf..f980279a8d 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -126,7 +126,7 @@ dependencies { kapt 'dk.ilios:realmfieldnameshelper:1.1.1' // Work - implementation "androidx.work:work-runtime-ktx:2.3.0" + implementation "androidx.work:work-runtime-ktx:2.3.3" // FP implementation "io.arrow-kt:arrow-core:$arrow_version" diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/content/ContentAttachmentData.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/content/ContentAttachmentData.kt index 48dff4e56d..e32bb9f21f 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/content/ContentAttachmentData.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/content/ContentAttachmentData.kt @@ -31,7 +31,7 @@ data class ContentAttachmentData( val name: String? = null, val queryUri: String, val path: String, - val mimeType: String?, + private val mimeType: String?, val type: Type ) : Parcelable { @@ -41,4 +41,6 @@ data class ContentAttachmentData( AUDIO, VIDEO } + + fun getSafeMimeType() = if (mimeType == "image/jpg") "image/jpeg" else mimeType } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/file/FileService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/file/FileService.kt index 4d9cff3e92..32fb1a6ab0 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/file/FileService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/file/FileService.kt @@ -34,7 +34,11 @@ interface FileService { /** * Download file in cache */ - FOR_INTERNAL_USE + FOR_INTERNAL_USE, + /** + * Download file in file provider path + */ + FOR_EXTERNAL_SHARE } /** diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageAudioContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageAudioContent.kt index e9c6c71882..248e782a74 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageAudioContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageAudioContent.kt @@ -51,4 +51,4 @@ data class MessageAudioContent( * Required if the file is encrypted. Information on the encrypted file, as specified in End-to-end encryption. */ @Json(name = "file") override val encryptedFileInfo: EncryptedFileInfo? = null -) : MessageEncryptedContent +) : MessageWithAttachmentContent diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageFileContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageFileContent.kt index 7c635a401d..f770a2ccea 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageFileContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageFileContent.kt @@ -57,7 +57,7 @@ data class MessageFileContent( * Required if the file is encrypted. Information on the encrypted file, as specified in End-to-end encryption. */ @Json(name = "file") override val encryptedFileInfo: EncryptedFileInfo? = null -) : MessageEncryptedContent { +) : MessageWithAttachmentContent { fun getMimeType(): String { // Mimetype default to plain text, should not be used diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageImageInfoContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageImageInfoContent.kt index 9087a45b4c..be0b5c4bb7 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageImageInfoContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageImageInfoContent.kt @@ -20,6 +20,6 @@ package im.vector.matrix.android.api.session.room.model.message /** * A content with image information */ -interface MessageImageInfoContent : MessageEncryptedContent { +interface MessageImageInfoContent : MessageWithAttachmentContent { val info: ImageInfo? } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVideoContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVideoContent.kt index 4cf03a5ffd..88d2d72d15 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVideoContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVideoContent.kt @@ -51,4 +51,4 @@ data class MessageVideoContent( * Required if the file is encrypted. Information on the encrypted file, as specified in End-to-end encryption. */ @Json(name = "file") override val encryptedFileInfo: EncryptedFileInfo? = null -) : MessageEncryptedContent +) : MessageWithAttachmentContent diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageEncryptedContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageWithAttachmentContent.kt similarity index 89% rename from matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageEncryptedContent.kt rename to matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageWithAttachmentContent.kt index 1d1d01c09c..9caf38013f 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageEncryptedContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageWithAttachmentContent.kt @@ -21,7 +21,7 @@ import im.vector.matrix.android.internal.crypto.model.rest.EncryptedFileInfo /** * Interface for message which can contains an encrypted file */ -interface MessageEncryptedContent : MessageContent { +interface MessageWithAttachmentContent : MessageContent { /** * Required if the file is unencrypted. The URL (typically MXC URI) to the image. */ @@ -36,4 +36,4 @@ interface MessageEncryptedContent : MessageContent { /** * Get the url of the encrypted file or of the file */ -fun MessageEncryptedContent.getFileUrl() = encryptedFileInfo?.url ?: url +fun MessageWithAttachmentContent.getFileUrl() = encryptedFileInfo?.url ?: url diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/FileQualifiers.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/FileQualifiers.kt index dc36b02809..acd6703c77 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/FileQualifiers.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/FileQualifiers.kt @@ -25,3 +25,7 @@ annotation class SessionFilesDirectory @Qualifier @Retention(AnnotationRetention.RUNTIME) annotation class SessionCacheDirectory + +@Qualifier +@Retention(AnnotationRetention.RUNTIME) +annotation class CacheDirectory diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/MatrixComponent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/MatrixComponent.kt index c5b07ff4e8..e929016d4f 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/MatrixComponent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/MatrixComponent.kt @@ -32,6 +32,7 @@ import im.vector.matrix.android.internal.util.BackgroundDetectionObserver import im.vector.matrix.android.internal.util.MatrixCoroutineDispatchers import okhttp3.OkHttpClient import org.matrix.olm.OlmManager +import java.io.File @Component(modules = [MatrixModule::class, NetworkModule::class, AuthModule::class]) @MatrixScope @@ -52,6 +53,9 @@ internal interface MatrixComponent { fun resources(): Resources + @CacheDirectory + fun cacheDir(): File + fun olmManager(): OlmManager fun taskExecutor(): TaskExecutor diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/MatrixModule.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/MatrixModule.kt index 284cbfff88..0af22dd65a 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/MatrixModule.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/di/MatrixModule.kt @@ -26,6 +26,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.android.asCoroutineDispatcher import kotlinx.coroutines.asCoroutineDispatcher import org.matrix.olm.OlmManager +import java.io.File import java.util.concurrent.Executors @Module @@ -49,6 +50,13 @@ internal object MatrixModule { return context.resources } + @JvmStatic + @Provides + @CacheDirectory + fun providesCacheDir(context: Context): File { + return context.cacheDir + } + @JvmStatic @Provides @MatrixScope diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/DefaultFileService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/DefaultFileService.kt index cf7e1b1d83..9eaea8cc34 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/DefaultFileService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/DefaultFileService.kt @@ -24,11 +24,11 @@ import im.vector.matrix.android.api.session.file.FileService import im.vector.matrix.android.api.util.Cancelable import im.vector.matrix.android.internal.crypto.attachments.ElementToDecrypt import im.vector.matrix.android.internal.crypto.attachments.MXEncryptedAttachments +import im.vector.matrix.android.internal.di.CacheDirectory import im.vector.matrix.android.internal.di.SessionCacheDirectory import im.vector.matrix.android.internal.di.Unauthenticated import im.vector.matrix.android.internal.extensions.foldToCallback import im.vector.matrix.android.internal.util.MatrixCoroutineDispatchers -import im.vector.matrix.android.internal.util.md5 import im.vector.matrix.android.internal.util.toCancelable import im.vector.matrix.android.internal.util.writeToFile import kotlinx.coroutines.GlobalScope @@ -42,8 +42,10 @@ import java.io.IOException import javax.inject.Inject internal class DefaultFileService @Inject constructor( - @SessionCacheDirectory + @CacheDirectory private val cacheDirectory: File, + @SessionCacheDirectory + private val sessionCacheDirectory: File, private val contentUrlResolver: ContentUrlResolver, @Unauthenticated private val okHttpClient: OkHttpClient, @@ -62,60 +64,50 @@ internal class DefaultFileService @Inject constructor( return GlobalScope.launch(coroutineDispatchers.main) { withContext(coroutineDispatchers.io) { Try { - val folder = getFolder(downloadMode, id) - + val folder = File(sessionCacheDirectory, "MF") + if (!folder.exists()) { + folder.mkdirs() + } File(folder, fileName) }.flatMap { destFile -> - if (!destFile.exists() || downloadMode == FileService.DownloadMode.TO_EXPORT) { - Try { - val resolvedUrl = contentUrlResolver.resolveFullSize(url) ?: throw IllegalArgumentException("url is null") + if (!destFile.exists()) { + val resolvedUrl = contentUrlResolver.resolveFullSize(url) ?: return@flatMap Try.Failure(IllegalArgumentException("url is null")) - val request = Request.Builder() - .url(resolvedUrl) - .build() + val request = Request.Builder() + .url(resolvedUrl) + .build() - val response = okHttpClient.newCall(request).execute() - var inputStream = response.body?.byteStream() - Timber.v("Response size ${response.body?.contentLength()} - Stream available: ${inputStream?.available()}") - if (!response.isSuccessful - || inputStream == null) { - throw IOException() - } - - if (elementToDecrypt != null) { - Timber.v("## decrypt file") - inputStream = MXEncryptedAttachments.decryptAttachment(inputStream, elementToDecrypt) - ?: throw IllegalStateException("Decryption error") - } - - writeToFile(inputStream, destFile) - destFile + val response = okHttpClient.newCall(request).execute() + var inputStream = response.body?.byteStream() + Timber.v("Response size ${response.body?.contentLength()} - Stream available: ${inputStream?.available()}") + if (!response.isSuccessful || inputStream == null) { + return@flatMap Try.Failure(IOException()) } - } else { - Try.just(destFile) + + if (elementToDecrypt != null) { + Timber.v("## decrypt file") + inputStream = MXEncryptedAttachments.decryptAttachment(inputStream, elementToDecrypt) + ?: return@flatMap Try.Failure(IllegalStateException("Decryption error")) + } + + writeToFile(inputStream, destFile) } + + Try.just(copyFile(destFile, downloadMode)) } } .foldToCallback(callback) }.toCancelable() } - private fun getFolder(downloadMode: FileService.DownloadMode, id: String): File { + private fun copyFile(file: File, downloadMode: FileService.DownloadMode): File { return when (downloadMode) { - FileService.DownloadMode.FOR_INTERNAL_USE -> { - // Create dir tree (MF stands for Matrix File): - // <cache>/<sessionId>/MF/<md5(id)>/ - val tmpFolderSession = File(cacheDirectory, "MF") - File(tmpFolderSession, id.md5()) - } - FileService.DownloadMode.TO_EXPORT -> { - Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) - } + FileService.DownloadMode.TO_EXPORT -> + file.copyTo(File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), file.name), true) + FileService.DownloadMode.FOR_EXTERNAL_SHARE -> + file.copyTo(File(File(cacheDirectory, "ext_share"), file.name), true) + FileService.DownloadMode.FOR_INTERNAL_USE -> + file } - .also { folder -> - if (!folder.exists()) { - folder.mkdirs() - } - } } } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/content/DefaultContentUploadStateTracker.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/content/DefaultContentUploadStateTracker.kt index 66a8341801..7a13d5f8a5 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/content/DefaultContentUploadStateTracker.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/content/DefaultContentUploadStateTracker.kt @@ -20,6 +20,7 @@ import android.os.Handler import android.os.Looper import im.vector.matrix.android.api.session.content.ContentUploadStateTracker import im.vector.matrix.android.internal.session.SessionScope +import timber.log.Timber import javax.inject.Inject @SessionScope @@ -33,7 +34,13 @@ internal class DefaultContentUploadStateTracker @Inject constructor() : ContentU val listeners = listeners.getOrPut(key) { ArrayList() } listeners.add(updateListener) val currentState = states[key] ?: ContentUploadStateTracker.State.Idle - mainHandler.post { updateListener.onUpdate(currentState) } + mainHandler.post { + try { + updateListener.onUpdate(currentState) + } catch (e: Exception) { + Timber.e(e, "## ContentUploadStateTracker.onUpdate() failed") + } + } } override fun untrack(key: String, updateListener: ContentUploadStateTracker.UpdateListener) { @@ -79,7 +86,13 @@ internal class DefaultContentUploadStateTracker @Inject constructor() : ContentU private fun updateState(key: String, state: ContentUploadStateTracker.State) { states[key] = state mainHandler.post { - listeners[key]?.forEach { it.onUpdate(state) } + listeners[key]?.forEach { + try { + it.onUpdate(state) + } catch (e: Exception) { + Timber.e(e, "## ContentUploadStateTracker.onUpdate() failed") + } + } } } } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/content/UploadContentWorker.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/content/UploadContentWorker.kt index 94bdb11edb..1dde25fd78 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/content/UploadContentWorker.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/content/UploadContentWorker.kt @@ -58,7 +58,7 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter override val sessionId: String, val events: List<Event>, val attachment: ContentAttachmentData, - val isRoomEncrypted: Boolean, + val isEncrypted: Boolean, val compressBeforeSending: Boolean, override val lastFailureMessage: String? = null ) : SessionWorkerParams @@ -90,9 +90,11 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter Timber.e(e) notifyTracker(params) { contentUploadStateTracker.setFailure(it, e) } return Result.success( - WorkerParamsFactory.toData(params.copy( - lastFailureMessage = e.localizedMessage - )) + WorkerParamsFactory.toData( + params.copy( + lastFailureMessage = e.localizedMessage + ) + ) ) } .let { originalFile -> @@ -136,7 +138,7 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter } try { - val contentUploadResponse = if (params.isRoomEncrypted) { + val contentUploadResponse = if (params.isEncrypted) { Timber.v("Encrypt thumbnail") notifyTracker(params) { contentUploadStateTracker.setEncryptingThumbnail(it) } val encryptionResult = MXEncryptedAttachments.encryptAttachment(ByteArrayInputStream(thumbnailData.bytes), thumbnailData.mimeType) @@ -174,18 +176,18 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter var uploadedFileEncryptedFileInfo: EncryptedFileInfo? = null return try { - val contentUploadResponse = if (params.isRoomEncrypted) { + val contentUploadResponse = if (params.isEncrypted) { Timber.v("Encrypt file") notifyTracker(params) { contentUploadStateTracker.setEncrypting(it) } - val encryptionResult = MXEncryptedAttachments.encryptAttachment(FileInputStream(attachmentFile), attachment.mimeType) + val encryptionResult = MXEncryptedAttachments.encryptAttachment(FileInputStream(attachmentFile), attachment.getSafeMimeType()) uploadedFileEncryptedFileInfo = encryptionResult.encryptedFileInfo fileUploader .uploadByteArray(encryptionResult.encryptedByteArray, attachment.name, "application/octet-stream", progressListener) } else { fileUploader - .uploadFile(attachmentFile, attachment.name, attachment.mimeType, progressListener) + .uploadFile(attachmentFile, attachment.name, attachment.getSafeMimeType(), progressListener) } handleSuccess(params, @@ -226,7 +228,7 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter updateEvent(it, attachmentUrl, encryptedFileInfo, thumbnailUrl, thumbnailEncryptedFileInfo, newImageAttributes) } - val sendParams = MultipleEventSendingDispatcherWorker.Params(params.sessionId, updatedEvents, params.isRoomEncrypted) + val sendParams = MultipleEventSendingDispatcherWorker.Params(params.sessionId, updatedEvents, params.isEncrypted) return Result.success(WorkerParamsFactory.toData(sendParams)) } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/send/LocalEchoEventFactory.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/send/LocalEchoEventFactory.kt index 51de36291d..198a65a2d3 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/send/LocalEchoEventFactory.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/send/LocalEchoEventFactory.kt @@ -261,7 +261,7 @@ internal class LocalEchoEventFactory @Inject constructor( msgType = MessageType.MSGTYPE_IMAGE, body = attachment.name ?: "image", info = ImageInfo( - mimeType = attachment.mimeType, + mimeType = attachment.getSafeMimeType(), width = width?.toInt() ?: 0, height = height?.toInt() ?: 0, size = attachment.size.toInt() @@ -293,7 +293,7 @@ internal class LocalEchoEventFactory @Inject constructor( msgType = MessageType.MSGTYPE_VIDEO, body = attachment.name ?: "video", videoInfo = VideoInfo( - mimeType = attachment.mimeType, + mimeType = attachment.getSafeMimeType(), width = width, height = height, size = attachment.size, @@ -312,7 +312,7 @@ internal class LocalEchoEventFactory @Inject constructor( msgType = MessageType.MSGTYPE_AUDIO, body = attachment.name ?: "audio", audioInfo = AudioInfo( - mimeType = attachment.mimeType?.takeIf { it.isNotBlank() } ?: "audio/mpeg", + mimeType = attachment.getSafeMimeType()?.takeIf { it.isNotBlank() } ?: "audio/mpeg", size = attachment.size ), url = attachment.path @@ -325,7 +325,7 @@ internal class LocalEchoEventFactory @Inject constructor( msgType = MessageType.MSGTYPE_FILE, body = attachment.name ?: "file", info = FileInfo( - mimeType = attachment.mimeType?.takeIf { it.isNotBlank() } + mimeType = attachment.getSafeMimeType()?.takeIf { it.isNotBlank() } ?: "application/octet-stream", size = attachment.size ), diff --git a/matrix-sdk-android/src/main/res/drawable-xxhdpi/matrix_user.png b/matrix-sdk-android/src/main/res/drawable-xxhdpi/matrix_user.png deleted file mode 100755 index 4a47aaf96d..0000000000 Binary files a/matrix-sdk-android/src/main/res/drawable-xxhdpi/matrix_user.png and /dev/null differ diff --git a/matrix-sdk-android/src/main/res/layout/adapter_item_icon_and_text.xml b/matrix-sdk-android/src/main/res/layout/adapter_item_icon_and_text.xml deleted file mode 100644 index 03de7154d8..0000000000 --- a/matrix-sdk-android/src/main/res/layout/adapter_item_icon_and_text.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:paddingTop="10dp" - android:paddingBottom="10dp"> - - <ImageView - android:id="@+id/imageView_icon_and_text" - android:layout_width="40dp" - android:layout_height="40dp" - android:layout_gravity="center_vertical" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" - android:src="@drawable/matrix_user" /> - - <TextView - android:id="@+id/textView_icon_and_text" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:paddingLeft="8dp" - android:paddingRight="8dp" - android:singleLine="true" - android:textColor="@android:color/white" - tools:text="A text here" /> - -</LinearLayout> \ No newline at end of file diff --git a/matrix-sdk-android/src/main/res/layout/fragment_dialog_icon_text_list.xml b/matrix-sdk-android/src/main/res/layout/fragment_dialog_icon_text_list.xml deleted file mode 100644 index bc246d8e67..0000000000 --- a/matrix-sdk-android/src/main/res/layout/fragment_dialog_icon_text_list.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <ListView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/listView_icon_and_text"/> - -</LinearLayout> \ No newline at end of file diff --git a/matrix-sdk-android/src/main/res/layout/fragment_matrix_message_list_fragment.xml b/matrix-sdk-android/src/main/res/layout/fragment_matrix_message_list_fragment.xml deleted file mode 100644 index 22ce4e9ae9..0000000000 --- a/matrix-sdk-android/src/main/res/layout/fragment_matrix_message_list_fragment.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:background="#248801"> - - <org.matrix.androidsdk.view.AutoScrollDownListView - android:id="@+id/listView_messages" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:background="#190986" - android:cacheColorHint="@android:color/transparent" - android:childDivider="@android:color/transparent" - android:divider="#ffffff" - android:dividerHeight="0dp" - android:listSelector="@android:color/transparent" - android:transcriptMode="normal" - tools:layout_height="120dp" /> - -</FrameLayout> \ No newline at end of file diff --git a/matrix-sdk-android/src/main/res/values/dimens.xml b/matrix-sdk-android/src/main/res/values/dimens.xml deleted file mode 100644 index f11f7450a8..0000000000 --- a/matrix-sdk-android/src/main/res/values/dimens.xml +++ /dev/null @@ -1,3 +0,0 @@ -<resources> - -</resources> diff --git a/vector/build.gradle b/vector/build.gradle index 988712d87e..6d24a26838 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -296,7 +296,7 @@ dependencies { implementation 'com.airbnb.android:mvrx:1.3.0' // Work - implementation "androidx.work:work-runtime-ktx:2.3.0-beta02" + implementation "androidx.work:work-runtime-ktx:2.3.3" // Paging implementation "androidx.paging:paging-runtime-ktx:2.1.1" diff --git a/vector/lint.xml b/vector/lint.xml index 6a9b0634a7..c083a79f57 100644 --- a/vector/lint.xml +++ b/vector/lint.xml @@ -6,9 +6,15 @@ <issue id="MissingTranslation" severity="warning" /> <issue id="TypographyEllipsis" severity="error" /> <issue id="ImpliedQuantity" severity="warning" /> + <issue id="IconXmlAndPng" severity="error" /> + <issue id="IconDipSize" severity="error" /> + <issue id="IconDuplicatesConfig" severity="error" /> + <issue id="IconDuplicates" severity="error" /> + <issue id="IconExpectedSize" severity="error" /> <!-- UX --> <issue id="ButtonOrder" severity="error" /> + <issue id="TextFields" severity="error" /> <!-- Layout --> <issue id="UnknownIdInLayout" severity="error" /> @@ -19,6 +25,7 @@ <issue id="InefficientWeight" severity="error" /> <issue id="DisableBaselineAlignment" severity="error" /> <issue id="ScrollViewSize" severity="error" /> + <issue id="NegativeMargin" severity="error" /> <!-- RTL --> <issue id="RtlEnabled" severity="error" /> @@ -30,9 +37,21 @@ <issue id="SetTextI18n" severity="error" /> <issue id="ViewConstructor" severity="error" /> <issue id="UseValueOf" severity="error" /> + <issue id="Recycle" severity="error" /> + <issue id="KotlinPropertyAccess" severity="error" /> <!-- Ignore error from HtmlCompressor lib --> <issue id="InvalidPackage"> - <ignore path="**/htmlcompressor-1.4.jar"/> + <ignore path="**/htmlcompressor-1.4.jar" /> </issue> + + <!-- Manifest --> + <issue id="PermissionImpliesUnsupportedChromeOsHardware" severity="error" /> + + <!-- Timber --> + <issue id="BinaryOperationInTimber" severity="error" /> + + <!-- Wording --> + <!-- TODO When strings are imported from Weblate, move this to error --> + <issue id="Typos" severity="warning" /> </lint> diff --git a/vector/src/debug/java/im/vector/riotx/features/debug/DebugMenuActivity.kt b/vector/src/debug/java/im/vector/riotx/features/debug/DebugMenuActivity.kt index c0040f3e42..a197a6f93e 100644 --- a/vector/src/debug/java/im/vector/riotx/features/debug/DebugMenuActivity.kt +++ b/vector/src/debug/java/im/vector/riotx/features/debug/DebugMenuActivity.kt @@ -114,7 +114,7 @@ class DebugMenuActivity : VectorBaseActivity() { .setContentText("Content") // No effect because it's a group summary notif .setNumber(33) - .setSmallIcon(R.drawable.logo_transparent) + .setSmallIcon(R.drawable.ic_status_bar) // This provocate the badge issue: no badge for group notification .setGroup("GroupKey") .setGroupSummary(true) @@ -147,7 +147,7 @@ class DebugMenuActivity : VectorBaseActivity() { // For shortcut on long press on launcher icon .setBadgeIconType(NotificationCompat.BADGE_ICON_NONE) .setStyle(messagingStyle1) - .setSmallIcon(R.drawable.logo_transparent) + .setSmallIcon(R.drawable.ic_status_bar) .setGroup("GroupKey") .build() ) @@ -159,7 +159,7 @@ class DebugMenuActivity : VectorBaseActivity() { .setContentTitle("Title 2") .setContentText("Content 2") .setStyle(messagingStyle2) - .setSmallIcon(R.drawable.logo_transparent) + .setSmallIcon(R.drawable.ic_status_bar) .setGroup("GroupKey") .build() ) diff --git a/vector/src/main/AndroidManifest.xml b/vector/src/main/AndroidManifest.xml index 488f357c4b..2e56e20ce7 100644 --- a/vector/src/main/AndroidManifest.xml +++ b/vector/src/main/AndroidManifest.xml @@ -9,6 +9,15 @@ <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.CAMERA" /> + <!-- Adding CAMERA permission prevents Chromebooks to see the application on the PlayStore --> + <!-- Tell that the Camera is not mandatory to install the application --> + <uses-feature + android:name="android.hardware.camera" + android:required="false" /> + <uses-feature + android:name="android.hardware.camera.autofocus" + android:required="false" /> + <application android:name=".VectorApplication" android:allowBackup="false" diff --git a/vector/src/main/java/im/vector/riotx/core/hardware/HardwareInfo.kt b/vector/src/main/java/im/vector/riotx/core/hardware/HardwareInfo.kt new file mode 100644 index 0000000000..1ce0dda025 --- /dev/null +++ b/vector/src/main/java/im/vector/riotx/core/hardware/HardwareInfo.kt @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020 New Vector Ltd + * + * 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. + */ + +@file:Suppress("DEPRECATION") + +package im.vector.riotx.core.hardware + +import android.content.Context +import android.hardware.Camera +import android.hardware.camera2.CameraCharacteristics +import android.hardware.camera2.CameraManager +import android.os.Build +import javax.inject.Inject + +class HardwareInfo @Inject constructor( + private val context: Context +) { + /** + * Tell if the device has a back (or external) camera + */ + fun hasBackCamera(): Boolean { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { + return Camera.getNumberOfCameras() > 0 + } + + val manager = context.getSystemService(Context.CAMERA_SERVICE) as CameraManager? ?: return Camera.getNumberOfCameras() > 0 + + return manager.cameraIdList.any { + val lensFacing = manager.getCameraCharacteristics(it).get(CameraCharacteristics.LENS_FACING) + lensFacing == CameraCharacteristics.LENS_FACING_BACK || lensFacing == CameraCharacteristics.LENS_FACING_EXTERNAL + } + } +} diff --git a/vector/src/main/java/im/vector/riotx/core/platform/BadgeFloatingActionButton.kt b/vector/src/main/java/im/vector/riotx/core/platform/BadgeFloatingActionButton.kt index ebf04e7097..49931e2b54 100644 --- a/vector/src/main/java/im/vector/riotx/core/platform/BadgeFloatingActionButton.kt +++ b/vector/src/main/java/im/vector/riotx/core/platform/BadgeFloatingActionButton.kt @@ -129,7 +129,7 @@ class BadgeFloatingActionButton @JvmOverloads constructor( attrs?.let { initAttrs(attrs) } } - @SuppressWarnings("ResourceType", "Recycle") + @SuppressWarnings("Recycle") private fun initAttrs(attrs: AttributeSet) { context.obtainStyledAttributes(attrs, R.styleable.BadgeFloatingActionButton).use { counterBackgroundColor = it.getColor(R.styleable.BadgeFloatingActionButton_badgeBackgroundColor, 0) diff --git a/vector/src/main/java/im/vector/riotx/core/utils/ExternalApplicationsUtil.kt b/vector/src/main/java/im/vector/riotx/core/utils/ExternalApplicationsUtil.kt index 78242d58de..37f6df1379 100644 --- a/vector/src/main/java/im/vector/riotx/core/utils/ExternalApplicationsUtil.kt +++ b/vector/src/main/java/im/vector/riotx/core/utils/ExternalApplicationsUtil.kt @@ -144,10 +144,10 @@ fun openCamera(activity: Activity, titlePrefix: String, requestCode: Int): Strin Timber.e("Cannot use the external storage media to save image") } } catch (uoe: UnsupportedOperationException) { - Timber.e(uoe, "Unable to insert camera URI into MediaStore.Images.Media.EXTERNAL_CONTENT_URI " + - "no SD card? Attempting to insert into device storage.") + Timber.e(uoe, "Unable to insert camera URI into MediaStore.Images.Media.EXTERNAL_CONTENT_URI.") + Timber.e("no SD card? Attempting to insert into device storage.") } catch (e: Exception) { - Timber.e(e, "Unable to insert camera URI into MediaStore.Images.Media.EXTERNAL_CONTENT_URI. $e") + Timber.e(e, "Unable to insert camera URI into MediaStore.Images.Media.EXTERNAL_CONTENT_URI.") } if (null == dummyUri) { @@ -157,13 +157,13 @@ fun openCamera(activity: Activity, titlePrefix: String, requestCode: Int): Strin Timber.e("Cannot use the internal storage to save media to save image") } } catch (e: Exception) { - Timber.e(e, "Unable to insert camera URI into internal storage. Giving up. $e") + Timber.e(e, "Unable to insert camera URI into internal storage. Giving up.") } } if (dummyUri != null) { captureIntent.putExtra(MediaStore.EXTRA_OUTPUT, dummyUri) - Timber.v("trying to take a photo on " + dummyUri.toString()) + Timber.v("trying to take a photo on $dummyUri") } else { Timber.v("trying to take a photo with no predefined uri") } diff --git a/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsHelper.kt b/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsHelper.kt index c9ee1cb6e5..ba1197b787 100644 --- a/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsHelper.kt +++ b/vector/src/main/java/im/vector/riotx/features/attachments/AttachmentsHelper.kt @@ -27,6 +27,7 @@ import com.kbeanie.multipicker.api.Picker.PICK_IMAGE_CAMERA import com.kbeanie.multipicker.api.Picker.PICK_IMAGE_DEVICE import com.kbeanie.multipicker.core.ImagePickerImpl import com.kbeanie.multipicker.core.PickerManager +import com.kbeanie.multipicker.utils.IntentUtils import im.vector.matrix.android.BuildConfig import im.vector.matrix.android.api.session.content.ContentAttachmentData import im.vector.riotx.core.platform.Restorable @@ -176,13 +177,13 @@ class AttachmentsHelper private constructor(private val context: Context, fun handleShareIntent(intent: Intent): Boolean { val type = intent.resolveType(context) ?: return false if (type.startsWith("image")) { - imagePicker.submit(intent) + imagePicker.submit(IntentUtils.getPickerIntentForSharing(intent)) } else if (type.startsWith("video")) { - videoPicker.submit(intent) + videoPicker.submit(IntentUtils.getPickerIntentForSharing(intent)) } else if (type.startsWith("audio")) { - videoPicker.submit(intent) + videoPicker.submit(IntentUtils.getPickerIntentForSharing(intent)) } else if (type.startsWith("application") || type.startsWith("file") || type.startsWith("*")) { - filePicker.submit(intent) + filePicker.submit(IntentUtils.getPickerIntentForSharing(intent)) } else { return false } diff --git a/vector/src/main/java/im/vector/riotx/features/attachments/preview/Extensions.kt b/vector/src/main/java/im/vector/riotx/features/attachments/preview/Extensions.kt index 3bd47baa89..40fcc0aa92 100644 --- a/vector/src/main/java/im/vector/riotx/features/attachments/preview/Extensions.kt +++ b/vector/src/main/java/im/vector/riotx/features/attachments/preview/Extensions.kt @@ -23,6 +23,6 @@ import im.vector.matrix.android.api.session.content.ContentAttachmentData */ fun ContentAttachmentData.isEditable(): Boolean { return type == ContentAttachmentData.Type.IMAGE - && mimeType?.startsWith("image/") == true - && mimeType != "image/gif" + && getSafeMimeType()?.startsWith("image/") == true + && getSafeMimeType() != "image/gif" } diff --git a/vector/src/main/java/im/vector/riotx/features/command/Command.kt b/vector/src/main/java/im/vector/riotx/features/command/Command.kt index f39f1cb7cd..72f686c2c8 100644 --- a/vector/src/main/java/im/vector/riotx/features/command/Command.kt +++ b/vector/src/main/java/im/vector/riotx/features/command/Command.kt @@ -43,6 +43,7 @@ enum class Command(val command: String, val parameters: String, @StringRes val d SPOILER("/spoiler", "<message>", R.string.command_description_spoiler), POLL("/poll", "Question | Option 1 | Option 2 ...", R.string.command_description_poll), SHRUG("/shrug", "<message>", R.string.command_description_shrug), + PLAIN("/plain", "<message>", R.string.command_description_plain), // TODO temporary command VERIFY_USER("/verify", "<user-id>", R.string.command_description_verify); diff --git a/vector/src/main/java/im/vector/riotx/features/command/CommandParser.kt b/vector/src/main/java/im/vector/riotx/features/command/CommandParser.kt index abc047e273..875fe92610 100644 --- a/vector/src/main/java/im/vector/riotx/features/command/CommandParser.kt +++ b/vector/src/main/java/im/vector/riotx/features/command/CommandParser.kt @@ -57,6 +57,15 @@ object CommandParser { } return when (val slashCommand = messageParts.first()) { + Command.PLAIN.command -> { + val text = textMessage.substring(Command.PLAIN.command.length).trim() + + if (text.isNotEmpty()) { + ParsedCommand.SendPlainText(text) + } else { + ParsedCommand.ErrorSyntax(Command.PLAIN) + } + } Command.CHANGE_DISPLAY_NAME.command -> { val newDisplayName = textMessage.substring(Command.CHANGE_DISPLAY_NAME.command.length).trim() diff --git a/vector/src/main/java/im/vector/riotx/features/command/ParsedCommand.kt b/vector/src/main/java/im/vector/riotx/features/command/ParsedCommand.kt index d823429ac9..e4fee27ee6 100644 --- a/vector/src/main/java/im/vector/riotx/features/command/ParsedCommand.kt +++ b/vector/src/main/java/im/vector/riotx/features/command/ParsedCommand.kt @@ -33,6 +33,7 @@ sealed class ParsedCommand { // Valid commands: + class SendPlainText(val message: CharSequence) : ParsedCommand() class SendEmote(val message: CharSequence) : ParsedCommand() class SendRainbow(val message: CharSequence) : ParsedCommand() class SendRainbowEmote(val message: CharSequence) : ParsedCommand() diff --git a/vector/src/main/java/im/vector/riotx/features/configuration/VectorConfiguration.kt b/vector/src/main/java/im/vector/riotx/features/configuration/VectorConfiguration.kt index adf8421842..a4b7ca263d 100644 --- a/vector/src/main/java/im/vector/riotx/features/configuration/VectorConfiguration.kt +++ b/vector/src/main/java/im/vector/riotx/features/configuration/VectorConfiguration.kt @@ -36,8 +36,8 @@ class VectorConfiguration @Inject constructor(private val context: Context) { // TODO Import mLanguageReceiver From Riot? fun onConfigurationChanged() { if (Locale.getDefault().toString() != VectorLocale.applicationLocale.toString()) { - Timber.v("## onConfigurationChanged() : the locale has been updated to " + Locale.getDefault().toString() - + ", restore the expected value " + VectorLocale.applicationLocale.toString()) + Timber.v("## onConfigurationChanged(): the locale has been updated to ${Locale.getDefault()}") + Timber.v("## onConfigurationChanged(): restore the expected value ${VectorLocale.applicationLocale}") updateApplicationSettings(VectorLocale.applicationLocale, FontScale.getFontScalePrefValue(context), ThemeUtils.getApplicationTheme(context)) diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseViewModel.kt b/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseViewModel.kt index c6ffd730ca..69c5e70740 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/keysbackup/restore/KeysBackupRestoreFromPassphraseViewModel.kt @@ -74,7 +74,7 @@ class KeysBackupRestoreFromPassphraseViewModel @Inject constructor() : ViewModel isIndeterminate = true)) } is StepProgressListener.Step.ImportingKey -> { - Timber.d("backupKeys.ImportingKey.progress: " + step.progress) + Timber.d("backupKeys.ImportingKey.progress: ${step.progress}") // Progress 0 can take a while, display an indeterminate progress in this case if (step.progress == 0) { sharedViewModel.loadingEvent.postValue(WaitingViewData(context.getString(R.string.keys_backup_restoring_waiting_message) diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/verification/Config.kt b/vector/src/main/java/im/vector/riotx/features/crypto/verification/Config.kt deleted file mode 100644 index 80f2b1153a..0000000000 --- a/vector/src/main/java/im/vector/riotx/features/crypto/verification/Config.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2020 New Vector Ltd - * - * 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.riotx.features.crypto.verification - -import im.vector.matrix.android.api.session.crypto.verification.VerificationMethod - -val supportedVerificationMethods = - listOf( - // RiotX supports SAS verification - VerificationMethod.SAS, - // RiotX is able to show QR codes - VerificationMethod.QR_CODE_SHOW, - // RiotX is able to scan QR codes - VerificationMethod.QR_CODE_SCAN - ) diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/verification/SupportedVerificationMethodsProvider.kt b/vector/src/main/java/im/vector/riotx/features/crypto/verification/SupportedVerificationMethodsProvider.kt new file mode 100644 index 0000000000..e7ed123de6 --- /dev/null +++ b/vector/src/main/java/im/vector/riotx/features/crypto/verification/SupportedVerificationMethodsProvider.kt @@ -0,0 +1,47 @@ +/* + * Copyright 2020 New Vector Ltd + * + * 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.riotx.features.crypto.verification + +import im.vector.matrix.android.api.session.crypto.verification.VerificationMethod +import im.vector.riotx.core.hardware.HardwareInfo +import timber.log.Timber +import javax.inject.Inject + +class SupportedVerificationMethodsProvider @Inject constructor( + private val hardwareInfo: HardwareInfo +) { + /** + * Provide the list of supported method by RiotX, with or without the QR_CODE_SCAN, depending if a back camera + * is available + */ + fun provide(): List<VerificationMethod> { + return mutableListOf( + // RiotX supports SAS verification + VerificationMethod.SAS, + // RiotX is able to show QR codes + VerificationMethod.QR_CODE_SHOW) + .apply { + if (hardwareInfo.hasBackCamera()) { + // RiotX is able to scan QR codes, and a Camera is available + add(VerificationMethod.QR_CODE_SCAN) + } else { + // This quite uncommon + Timber.w("No back Camera detected") + } + } + } +} diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheetViewModel.kt b/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheetViewModel.kt index f4670b90e1..d161f6d6fc 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheetViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheetViewModel.kt @@ -63,9 +63,11 @@ data class VerificationBottomSheetViewState( val isMe: Boolean = false ) : MvRxState -class VerificationBottomSheetViewModel @AssistedInject constructor(@Assisted initialState: VerificationBottomSheetViewState, - @Assisted args: VerificationBottomSheet.VerificationArgs, - private val session: Session) +class VerificationBottomSheetViewModel @AssistedInject constructor( + @Assisted initialState: VerificationBottomSheetViewState, + @Assisted args: VerificationBottomSheet.VerificationArgs, + private val session: Session, + private val supportedVerificationMethodsProvider: SupportedVerificationMethodsProvider) : VectorViewModel<VerificationBottomSheetViewState, VerificationAction, VerificationBottomSheetViewEvents>(initialState), VerificationService.Listener { @@ -116,9 +118,11 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(@Assisted ini if (autoReady) { // TODO, can I be here in DM mode? in this case should test if roomID is null? session.cryptoService().verificationService() - .readyPendingVerification(supportedVerificationMethods, + .readyPendingVerification( + supportedVerificationMethodsProvider.provide(), pr!!.otherUserId, - pr.transactionId ?: "") + pr.transactionId ?: "" + ) } } @@ -173,7 +177,12 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(@Assisted ini session .cryptoService() .verificationService() - .requestKeyVerificationInDMs(supportedVerificationMethods, otherUserId, data, pendingLocalId) + .requestKeyVerificationInDMs( + supportedVerificationMethodsProvider.provide(), + otherUserId, + data, + pendingLocalId + ) ) ) } @@ -191,7 +200,7 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(@Assisted ini pendingRequest = Success(session .cryptoService() .verificationService() - .requestKeyVerificationInDMs(supportedVerificationMethods, otherUserId, roomId) + .requestKeyVerificationInDMs(supportedVerificationMethodsProvider.provide(), otherUserId, roomId) ) ) } @@ -294,8 +303,6 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(@Assisted ini } catch (failure: Throwable) { _viewEvents.post(VerificationBottomSheetViewEvents.ModalError(failure.localizedMessage)) } - - Unit } }.exhaustive } @@ -362,9 +369,11 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(@Assisted ini // auto ready in this case, as we are waiting // TODO, can I be here in DM mode? in this case should test if roomID is null? session.cryptoService().verificationService() - .readyPendingVerification(supportedVerificationMethods, + .readyPendingVerification( + supportedVerificationMethodsProvider.provide(), pr.otherUserId, - pr.transactionId ?: "") + pr.transactionId ?: "" + ) } // Use this one! diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index c2eb61b3ca..ad4e9694db 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -37,6 +37,7 @@ import androidx.annotation.StringRes import androidx.appcompat.app.AlertDialog import androidx.core.app.ActivityOptionsCompat import androidx.core.content.ContextCompat +import androidx.core.net.toUri import androidx.core.text.buildSpannedString import androidx.core.util.Pair import androidx.core.view.ViewCompat @@ -57,17 +58,17 @@ import com.airbnb.mvrx.Success import com.airbnb.mvrx.args import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.withState -import com.github.piasy.biv.BigImageViewer -import com.github.piasy.biv.loader.ImageLoader import com.google.android.material.checkbox.MaterialCheckBox import com.google.android.material.snackbar.Snackbar import com.google.android.material.textfield.TextInputEditText import com.google.android.material.textfield.TextInputLayout import com.jakewharton.rxbinding3.widget.textChanges +import im.vector.matrix.android.api.MatrixCallback import im.vector.matrix.android.api.permalinks.PermalinkFactory import im.vector.matrix.android.api.session.Session import im.vector.matrix.android.api.session.content.ContentAttachmentData import im.vector.matrix.android.api.session.events.model.Event +import im.vector.matrix.android.api.session.file.FileService import im.vector.matrix.android.api.session.room.model.Membership import im.vector.matrix.android.api.session.room.model.message.MessageAudioContent import im.vector.matrix.android.api.session.room.model.message.MessageContent @@ -77,12 +78,14 @@ import im.vector.matrix.android.api.session.room.model.message.MessageImageInfoC import im.vector.matrix.android.api.session.room.model.message.MessageTextContent import im.vector.matrix.android.api.session.room.model.message.MessageVerificationRequestContent import im.vector.matrix.android.api.session.room.model.message.MessageVideoContent +import im.vector.matrix.android.api.session.room.model.message.getFileUrl import im.vector.matrix.android.api.session.room.send.SendState import im.vector.matrix.android.api.session.room.timeline.Timeline import im.vector.matrix.android.api.session.room.timeline.TimelineEvent import im.vector.matrix.android.api.session.room.timeline.getLastMessageContent import im.vector.matrix.android.api.util.MatrixItem import im.vector.matrix.android.api.util.toMatrixItem +import im.vector.matrix.android.internal.crypto.attachments.toElementToDecrypt import im.vector.riotx.R import im.vector.riotx.core.dialogs.withColoredButton import im.vector.riotx.core.epoxy.LayoutManagerStateRestorer @@ -93,6 +96,7 @@ import im.vector.riotx.core.extensions.setTextOrHide import im.vector.riotx.core.extensions.showKeyboard import im.vector.riotx.core.files.addEntryToDownloadManager import im.vector.riotx.core.glide.GlideApp +import im.vector.riotx.core.intent.getMimeTypeFromUri import im.vector.riotx.core.platform.VectorBaseFragment import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.core.ui.views.JumpToReadMarkerView @@ -1124,6 +1128,23 @@ class RoomDetailFragment @Inject constructor( roomDetailViewModel.handle(RoomDetailAction.EnterTrackingUnreadMessagesState) } + private fun onShareActionClicked(action: EventSharedAction.Share) { + session.downloadFile( + FileService.DownloadMode.FOR_EXTERNAL_SHARE, + action.eventId, + action.messageContent.body, + action.messageContent.getFileUrl(), + action.messageContent.encryptedFileInfo?.toElementToDecrypt(), + object : MatrixCallback<File> { + override fun onSuccess(data: File) { + if (isAdded) { + shareMedia(requireContext(), data, getMimeTypeFromUri(requireContext(), data.toUri())) + } + } + } + ) + } + private fun handleActions(action: EventSharedAction) { when (action) { is EventSharedAction.OpenUserProfile -> { @@ -1145,32 +1166,7 @@ class RoomDetailFragment @Inject constructor( promptConfirmationToRedactEvent(action) } is EventSharedAction.Share -> { - // TODO current data communication is too limited - // Need to now the media type - // TODO bad, just POC - BigImageViewer.imageLoader().loadImage( - action.hashCode(), - Uri.parse(action.imageUrl), - object : ImageLoader.Callback { - override fun onFinish() {} - - override fun onSuccess(image: File?) { - if (image != null) { - shareMedia(requireContext(), image, "image/*") - } - } - - override fun onFail(error: Exception?) {} - - override fun onCacheHit(imageType: Int, image: File?) {} - - override fun onCacheMiss(imageType: Int, image: File?) {} - - override fun onProgress(progress: Int) {} - - override fun onStart() {} - } - ) + onShareActionClicked(action) } is EventSharedAction.ViewEditHistory -> { onEditedDecorationClicked(action.messageInformationData) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt index 8a231fb25d..4ab9125c4f 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt @@ -65,7 +65,7 @@ import im.vector.riotx.core.resources.UserPreferencesProvider import im.vector.riotx.core.utils.subscribeLogError import im.vector.riotx.features.command.CommandParser import im.vector.riotx.features.command.ParsedCommand -import im.vector.riotx.features.crypto.verification.supportedVerificationMethods +import im.vector.riotx.features.crypto.verification.SupportedVerificationMethodsProvider import im.vector.riotx.features.home.room.detail.composer.rainbow.RainbowGenerator import im.vector.riotx.features.home.room.detail.timeline.helper.TimelineDisplayableEvents import im.vector.riotx.features.home.room.typing.TypingHelper @@ -81,13 +81,15 @@ import java.io.File import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicBoolean -class RoomDetailViewModel @AssistedInject constructor(@Assisted initialState: RoomDetailViewState, - userPreferencesProvider: UserPreferencesProvider, - private val vectorPreferences: VectorPreferences, - private val stringProvider: StringProvider, - private val typingHelper: TypingHelper, - private val rainbowGenerator: RainbowGenerator, - private val session: Session +class RoomDetailViewModel @AssistedInject constructor( + @Assisted initialState: RoomDetailViewState, + userPreferencesProvider: UserPreferencesProvider, + private val vectorPreferences: VectorPreferences, + private val stringProvider: StringProvider, + private val typingHelper: TypingHelper, + private val rainbowGenerator: RainbowGenerator, + private val session: Session, + private val supportedVerificationMethodsProvider: SupportedVerificationMethodsProvider ) : VectorViewModel<RoomDetailViewState, RoomDetailAction, RoomDetailViewEvents>(initialState), Timeline.Listener { private val room = session.getRoom(initialState.roomId)!! @@ -340,6 +342,12 @@ class RoomDetailViewModel @AssistedInject constructor(@Assisted initialState: Ro is ParsedCommand.ErrorUnknownSlashCommand -> { _viewEvents.post(RoomDetailViewEvents.SlashCommandUnknown(slashCommandResult.slashCommand)) } + is ParsedCommand.SendPlainText -> { + // Send the text message to the room, without markdown + room.sendTextMessage(slashCommandResult.message, autoMarkdown = false) + _viewEvents.post(RoomDetailViewEvents.MessageSent) + popDraft() + } is ParsedCommand.Invite -> { handleInviteSlashCommand(slashCommandResult) popDraft() @@ -421,7 +429,7 @@ class RoomDetailViewModel @AssistedInject constructor(@Assisted initialState: Ro session .cryptoService() .verificationService() - .requestKeyVerificationInDMs(supportedVerificationMethods, slashCommandResult.userId, room.roomId) + .requestKeyVerificationInDMs(supportedVerificationMethodsProvider.provide(), slashCommandResult.userId, room.roomId) _viewEvents.post(RoomDetailViewEvents.SlashCommandHandled()) popDraft() } @@ -828,7 +836,7 @@ class RoomDetailViewModel @AssistedInject constructor(@Assisted initialState: Ro private fun handleAcceptVerification(action: RoomDetailAction.AcceptVerificationRequest) { Timber.v("## SAS handleAcceptVerification ${action.otherUserId}, roomId:${room.roomId}, txId:${action.transactionId}") if (session.cryptoService().verificationService().readyPendingVerificationInDMs( - supportedVerificationMethods, + supportedVerificationMethodsProvider.provide(), action.otherUserId, room.roomId, action.transactionId)) { diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/MessageColorProvider.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/MessageColorProvider.kt new file mode 100644 index 0000000000..c6ab5b024f --- /dev/null +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/MessageColorProvider.kt @@ -0,0 +1,58 @@ +/* + * Copyright 2019 New Vector Ltd + * + * 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.riotx.features.home.room.detail.timeline + +import androidx.annotation.ColorInt +import im.vector.matrix.android.api.session.room.send.SendState +import im.vector.riotx.R +import im.vector.riotx.core.resources.ColorProvider +import im.vector.riotx.features.settings.VectorPreferences +import javax.inject.Inject + +class MessageColorProvider @Inject constructor( + private val colorProvider: ColorProvider, + private val vectorPreferences: VectorPreferences) { + + @ColorInt + fun getMessageTextColor(sendState: SendState): Int { + return if (vectorPreferences.developerMode()) { + when (sendState) { + // SendStates, in the classical order they will occur + SendState.UNKNOWN, + SendState.UNSENT -> colorProvider.getColorFromAttribute(R.attr.vctr_sending_message_text_color) + SendState.ENCRYPTING -> colorProvider.getColorFromAttribute(R.attr.vctr_encrypting_message_text_color) + SendState.SENDING -> colorProvider.getColorFromAttribute(R.attr.vctr_sending_message_text_color) + SendState.SENT, + SendState.SYNCED -> colorProvider.getColorFromAttribute(R.attr.vctr_message_text_color) + SendState.UNDELIVERED, + SendState.FAILED_UNKNOWN_DEVICES -> colorProvider.getColorFromAttribute(R.attr.vctr_unsent_message_text_color) + } + } else { + // When not in developer mode, we do not use special color for the encrypting state + when (sendState) { + SendState.UNKNOWN, + SendState.UNSENT, + SendState.ENCRYPTING, + SendState.SENDING -> colorProvider.getColorFromAttribute(R.attr.vctr_sending_message_text_color) + SendState.SENT, + SendState.SYNCED -> colorProvider.getColorFromAttribute(R.attr.vctr_message_text_color) + SendState.UNDELIVERED, + SendState.FAILED_UNKNOWN_DEVICES -> colorProvider.getColorFromAttribute(R.attr.vctr_unsent_message_text_color) + } + } + } +} diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/EventSharedAction.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/EventSharedAction.kt index cba89d8481..b9e2ab2093 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/EventSharedAction.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/EventSharedAction.kt @@ -18,6 +18,7 @@ package im.vector.riotx.features.home.room.detail.timeline.action import androidx.annotation.DrawableRes import androidx.annotation.StringRes +import im.vector.matrix.android.api.session.room.model.message.MessageWithAttachmentContent import im.vector.riotx.R import im.vector.riotx.core.platform.VectorSharedAction import im.vector.riotx.features.home.room.detail.timeline.item.MessageInformationData @@ -46,7 +47,7 @@ sealed class EventSharedAction(@StringRes val titleRes: Int, data class Reply(val eventId: String) : EventSharedAction(R.string.reply, R.drawable.ic_reply) - data class Share(val imageUrl: String) : + data class Share(val eventId: String, val messageContent: MessageWithAttachmentContent) : EventSharedAction(R.string.share, R.drawable.ic_share) data class Resend(val eventId: String) : diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageActionsViewModel.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageActionsViewModel.kt index fa9bdbc29c..1fe1db27d7 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageActionsViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageActionsViewModel.kt @@ -29,8 +29,8 @@ import im.vector.matrix.android.api.session.events.model.EventType import im.vector.matrix.android.api.session.events.model.isTextMessage import im.vector.matrix.android.api.session.events.model.toModel import im.vector.matrix.android.api.session.room.model.message.MessageContent +import im.vector.matrix.android.api.session.room.model.message.MessageWithAttachmentContent import im.vector.matrix.android.api.session.room.model.message.MessageFormat -import im.vector.matrix.android.api.session.room.model.message.MessageImageContent import im.vector.matrix.android.api.session.room.model.message.MessageTextContent import im.vector.matrix.android.api.session.room.model.message.MessageType import im.vector.matrix.android.api.session.room.model.message.MessageVerificationRequestContent @@ -260,13 +260,8 @@ class MessageActionsViewModel @AssistedInject constructor(@Assisted add(EventSharedAction.ViewEditHistory(informationData)) } - if (canShare(msgType)) { - if (messageContent is MessageImageContent) { - session.contentUrlResolver().resolveFullSize(messageContent.url)?.let { url -> - add(EventSharedAction.Share(url)) - } - } - // TODO + if (canShare(msgType) && messageContent is MessageWithAttachmentContent) { + add(EventSharedAction.Share(timelineEvent.eventId, messageContent)) } if (timelineEvent.root.sendState == SendState.SENT) { @@ -374,8 +369,9 @@ class MessageActionsViewModel @AssistedInject constructor(@Assisted return when (msgType) { MessageType.MSGTYPE_IMAGE, MessageType.MSGTYPE_AUDIO, - MessageType.MSGTYPE_VIDEO -> true - else -> false + MessageType.MSGTYPE_VIDEO, + MessageType.MSGTYPE_FILE -> true + else -> false } } } diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt index 83f0c63147..2b221b9fef 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt @@ -222,7 +222,7 @@ class MessageItemFactory @Inject constructor( referenceId = informationData.eventId, informationData = informationData, avatarRenderer = attributes.avatarRenderer, - colorProvider = attributes.colorProvider, + messageColorProvider = attributes.messageColorProvider, itemLongClickListener = attributes.itemLongClickListener, itemClickListener = attributes.itemClickListener, reactionPillCallback = attributes.reactionPillCallback, diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/NoticeItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/NoticeItemFactory.kt index 4ee90f82a9..85118e6a91 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/NoticeItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/NoticeItemFactory.kt @@ -44,7 +44,8 @@ class NoticeItemFactory @Inject constructor(private val eventFormatter: NoticeEv itemLongClickListener = View.OnLongClickListener { view -> callback?.onEventLongClicked(informationData, null, view) ?: false }, - readReceiptsCallback = callback + readReceiptsCallback = callback, + avatarClickListener = { callback?.onAvatarClicked(informationData) } ) return NoticeItem_() .leftGuideline(avatarSizeProvider.leftGuideline) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/VerificationItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/VerificationItemFactory.kt index 87a0d2af75..890612c04c 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/VerificationItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/VerificationItemFactory.kt @@ -27,8 +27,8 @@ import im.vector.matrix.android.api.session.room.model.message.MessageVerificati import im.vector.matrix.android.api.session.room.timeline.TimelineEvent import im.vector.matrix.android.internal.session.room.VerificationState import im.vector.riotx.core.epoxy.VectorEpoxyModel -import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.core.resources.UserPreferencesProvider +import im.vector.riotx.features.home.room.detail.timeline.MessageColorProvider import im.vector.riotx.features.home.room.detail.timeline.TimelineEventController import im.vector.riotx.features.home.room.detail.timeline.helper.AvatarSizeProvider import im.vector.riotx.features.home.room.detail.timeline.helper.MessageInformationDataFactory @@ -43,7 +43,7 @@ import javax.inject.Inject * several checks are made to see if this conclusion is attached to a known request */ class VerificationItemFactory @Inject constructor( - private val colorProvider: ColorProvider, + private val messageColorProvider: MessageColorProvider, private val messageInformationDataFactory: MessageInformationDataFactory, private val messageItemAttributesFactory: MessageItemAttributesFactory, private val avatarSizeProvider: AvatarSizeProvider, @@ -97,7 +97,7 @@ class VerificationItemFactory @Inject constructor( isPositive = false, informationData = informationData, avatarRenderer = attributes.avatarRenderer, - colorProvider = colorProvider, + messageColorProvider = messageColorProvider, emojiTypeFace = attributes.emojiTypeFace, itemClickListener = attributes.itemClickListener, itemLongClickListener = attributes.itemLongClickListener, @@ -130,7 +130,7 @@ class VerificationItemFactory @Inject constructor( isPositive = true, informationData = informationData, avatarRenderer = attributes.avatarRenderer, - colorProvider = colorProvider, + messageColorProvider = messageColorProvider, emojiTypeFace = attributes.emojiTypeFace, itemClickListener = attributes.itemClickListener, itemLongClickListener = attributes.itemLongClickListener, diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/ContentUploadStateTrackerBinder.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/ContentUploadStateTrackerBinder.kt index d80c625e8f..4cf14fa83b 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/ContentUploadStateTrackerBinder.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/ContentUploadStateTrackerBinder.kt @@ -27,14 +27,13 @@ import im.vector.riotx.R import im.vector.riotx.core.di.ActiveSessionHolder import im.vector.riotx.core.di.ScreenScope import im.vector.riotx.core.error.ErrorFormatter -import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.core.utils.TextUtils -import im.vector.riotx.features.ui.getMessageTextColor +import im.vector.riotx.features.home.room.detail.timeline.MessageColorProvider import javax.inject.Inject @ScreenScope class ContentUploadStateTrackerBinder @Inject constructor(private val activeSessionHolder: ActiveSessionHolder, - private val colorProvider: ColorProvider, + private val messageColorProvider: MessageColorProvider, private val errorFormatter: ErrorFormatter) { private val updateListeners = mutableMapOf<String, ContentUploadStateTracker.UpdateListener>() @@ -44,7 +43,7 @@ class ContentUploadStateTrackerBinder @Inject constructor(private val activeSess progressLayout: ViewGroup) { activeSessionHolder.getSafeActiveSession()?.also { session -> val uploadStateTracker = session.contentUploadProgressTracker() - val updateListener = ContentMediaProgressUpdater(progressLayout, isLocalFile, colorProvider, errorFormatter) + val updateListener = ContentMediaProgressUpdater(progressLayout, isLocalFile, messageColorProvider, errorFormatter) updateListeners[eventId] = updateListener uploadStateTracker.track(eventId, updateListener) } @@ -68,7 +67,7 @@ class ContentUploadStateTrackerBinder @Inject constructor(private val activeSess private class ContentMediaProgressUpdater(private val progressLayout: ViewGroup, private val isLocalFile: Boolean, - private val colorProvider: ColorProvider, + private val messageColorProvider: MessageColorProvider, private val errorFormatter: ErrorFormatter) : ContentUploadStateTracker.UpdateListener { override fun onUpdate(state: ContentUploadStateTracker.State) { @@ -92,7 +91,7 @@ private class ContentMediaProgressUpdater(private val progressLayout: ViewGroup, progressBar?.isIndeterminate = true progressBar?.progress = 0 progressTextView?.text = progressLayout.context.getString(R.string.send_file_step_idle) - progressTextView?.setTextColor(colorProvider.getMessageTextColor(SendState.UNSENT)) + progressTextView?.setTextColor(messageColorProvider.getMessageTextColor(SendState.UNSENT)) } else { progressLayout.isVisible = false } @@ -120,7 +119,7 @@ private class ContentMediaProgressUpdater(private val progressLayout: ViewGroup, val progressTextView = progressLayout.findViewById<TextView>(R.id.mediaProgressTextView) progressBar?.isIndeterminate = true progressTextView?.text = progressLayout.context.getString(resId) - progressTextView?.setTextColor(colorProvider.getMessageTextColor(SendState.ENCRYPTING)) + progressTextView?.setTextColor(messageColorProvider.getMessageTextColor(SendState.ENCRYPTING)) } private fun doHandleProgress(resId: Int, current: Long, total: Long) { @@ -134,7 +133,7 @@ private class ContentMediaProgressUpdater(private val progressLayout: ViewGroup, progressTextView?.text = progressLayout.context.getString(resId, TextUtils.formatFileSize(progressLayout.context, current, true), TextUtils.formatFileSize(progressLayout.context, total, true)) - progressTextView?.setTextColor(colorProvider.getMessageTextColor(SendState.SENDING)) + progressTextView?.setTextColor(messageColorProvider.getMessageTextColor(SendState.SENDING)) } private fun handleFailure(state: ContentUploadStateTracker.State.Failure) { @@ -143,7 +142,7 @@ private class ContentMediaProgressUpdater(private val progressLayout: ViewGroup, val progressTextView = progressLayout.findViewById<TextView>(R.id.mediaProgressTextView) progressBar?.isVisible = false progressTextView?.text = errorFormatter.toHumanReadable(state.throwable) - progressTextView?.setTextColor(colorProvider.getMessageTextColor(SendState.UNDELIVERED)) + progressTextView?.setTextColor(messageColorProvider.getMessageTextColor(SendState.UNDELIVERED)) } private fun handleSuccess() { diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/MessageItemAttributesFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/MessageItemAttributesFactory.kt index 0e1229eeca..7433b03408 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/MessageItemAttributesFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/MessageItemAttributesFactory.kt @@ -20,9 +20,9 @@ package im.vector.riotx.features.home.room.detail.timeline.helper import android.view.View import im.vector.matrix.android.api.session.room.model.message.MessageContent import im.vector.riotx.EmojiCompatFontProvider -import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.core.utils.DebouncedClickListener import im.vector.riotx.features.home.AvatarRenderer +import im.vector.riotx.features.home.room.detail.timeline.MessageColorProvider import im.vector.riotx.features.home.room.detail.timeline.TimelineEventController import im.vector.riotx.features.home.room.detail.timeline.item.AbsMessageItem import im.vector.riotx.features.home.room.detail.timeline.item.MessageInformationData @@ -30,7 +30,7 @@ import javax.inject.Inject class MessageItemAttributesFactory @Inject constructor( private val avatarRenderer: AvatarRenderer, - private val colorProvider: ColorProvider, + private val messageColorProvider: MessageColorProvider, private val avatarSizeProvider: AvatarSizeProvider, private val emojiCompatFontProvider: EmojiCompatFontProvider) { @@ -41,7 +41,7 @@ class MessageItemAttributesFactory @Inject constructor( avatarSize = avatarSizeProvider.avatarSize, informationData = informationData, avatarRenderer = avatarRenderer, - colorProvider = colorProvider, + messageColorProvider = messageColorProvider, itemLongClickListener = View.OnLongClickListener { view -> callback?.onEventLongClicked(informationData, messageContent, view) ?: false }, diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/AbsBaseMessageItem.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/AbsBaseMessageItem.kt index 6d99bb2650..149b5e74ad 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/AbsBaseMessageItem.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/AbsBaseMessageItem.kt @@ -24,12 +24,11 @@ import androidx.annotation.IdRes import androidx.core.view.isVisible import im.vector.matrix.android.api.session.room.send.SendState import im.vector.riotx.R -import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.core.utils.DebouncedClickListener import im.vector.riotx.features.home.AvatarRenderer +import im.vector.riotx.features.home.room.detail.timeline.MessageColorProvider import im.vector.riotx.features.home.room.detail.timeline.TimelineEventController import im.vector.riotx.features.reactions.widget.ReactionButton -import im.vector.riotx.features.ui.getMessageTextColor /** * Base timeline item with reactions and read receipts. @@ -105,7 +104,7 @@ abstract class AbsBaseMessageItem<H : AbsBaseMessageItem.Holder> : BaseEventItem protected open fun renderSendState(root: View, textView: TextView?, failureIndicator: ImageView? = null) { root.isClickable = baseAttributes.informationData.sendState.isSent() val state = if (baseAttributes.informationData.hasPendingEdits) SendState.UNSENT else baseAttributes.informationData.sendState - textView?.setTextColor(baseAttributes.colorProvider.getMessageTextColor(state)) + textView?.setTextColor(baseAttributes.messageColorProvider.getMessageTextColor(state)) failureIndicator?.isVisible = baseAttributes.informationData.sendState.hasFailed() } @@ -120,7 +119,7 @@ abstract class AbsBaseMessageItem<H : AbsBaseMessageItem.Holder> : BaseEventItem // val avatarSize: Int, val informationData: MessageInformationData val avatarRenderer: AvatarRenderer - val colorProvider: ColorProvider + val messageColorProvider: MessageColorProvider val itemLongClickListener: View.OnLongClickListener? val itemClickListener: View.OnClickListener? // val memberClickListener: View.OnClickListener? diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/AbsMessageItem.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/AbsMessageItem.kt index ae69164951..2b01e915df 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/AbsMessageItem.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/AbsMessageItem.kt @@ -23,9 +23,9 @@ import android.widget.TextView import androidx.annotation.IdRes import com.airbnb.epoxy.EpoxyAttribute import im.vector.riotx.R -import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.core.utils.DebouncedClickListener import im.vector.riotx.features.home.AvatarRenderer +import im.vector.riotx.features.home.room.detail.timeline.MessageColorProvider import im.vector.riotx.features.home.room.detail.timeline.TimelineEventController /** @@ -88,7 +88,7 @@ abstract class AbsMessageItem<H : AbsMessageItem.Holder> : AbsBaseMessageItem<H> val avatarSize: Int, override val informationData: MessageInformationData, override val avatarRenderer: AvatarRenderer, - override val colorProvider: ColorProvider, + override val messageColorProvider: MessageColorProvider, override val itemLongClickListener: View.OnLongClickListener? = null, override val itemClickListener: View.OnClickListener? = null, val memberClickListener: View.OnClickListener? = null, diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/NoticeItem.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/NoticeItem.kt index 189c358b48..ec98ea10ed 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/NoticeItem.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/NoticeItem.kt @@ -22,6 +22,8 @@ import android.widget.TextView import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.riotx.R +import im.vector.riotx.core.epoxy.ClickListener +import im.vector.riotx.core.epoxy.onClick import im.vector.riotx.core.utils.DebouncedClickListener import im.vector.riotx.features.home.AvatarRenderer import im.vector.riotx.features.home.room.detail.timeline.TimelineEventController @@ -42,6 +44,7 @@ abstract class NoticeItem : BaseEventItem<NoticeItem.Holder>() { attributes.avatarRenderer.render(attributes.informationData.matrixItem, holder.avatarImageView) holder.view.setOnLongClickListener(attributes.itemLongClickListener) holder.readReceiptsView.render(attributes.informationData.readReceipts, attributes.avatarRenderer, _readReceiptsClickListener) + holder.avatarImageView.onClick(attributes.avatarClickListener) } override fun getEventIds(): List<String> { @@ -60,7 +63,8 @@ abstract class NoticeItem : BaseEventItem<NoticeItem.Holder>() { val informationData: MessageInformationData, val noticeText: CharSequence, val itemLongClickListener: View.OnLongClickListener? = null, - val readReceiptsCallback: TimelineEventController.ReadReceiptsCallback? = null + val readReceiptsCallback: TimelineEventController.ReadReceiptsCallback? = null, + val avatarClickListener: ClickListener? = null ) companion object { diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt index f1e1753b17..a0ad3466f7 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt @@ -73,11 +73,11 @@ class PollResultLineView @JvmOverloads constructor( orientation = HORIZONTAL ButterKnife.bind(this) - val typedArray = context.obtainStyledAttributes(attrs, - R.styleable.PollResultLineView, 0, 0) + val typedArray = context.obtainStyledAttributes(attrs, R.styleable.PollResultLineView, 0, 0) label = typedArray.getString(R.styleable.PollResultLineView_optionName) ?: "" percent = typedArray.getString(R.styleable.PollResultLineView_optionCount) ?: "" optionSelected = typedArray.getBoolean(R.styleable.PollResultLineView_optionSelected, false) isWinner = typedArray.getBoolean(R.styleable.PollResultLineView_optionIsWinner, false) + typedArray.recycle() } } diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/VerificationRequestConclusionItem.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/VerificationRequestConclusionItem.kt index 036bf2b036..2b28e15cab 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/VerificationRequestConclusionItem.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/VerificationRequestConclusionItem.kt @@ -26,8 +26,8 @@ import androidx.core.view.updateLayoutParams import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.riotx.R -import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.features.home.AvatarRenderer +import im.vector.riotx.features.home.room.detail.timeline.MessageColorProvider import im.vector.riotx.features.home.room.detail.timeline.TimelineEventController @EpoxyModelClass(layout = R.layout.item_timeline_event_base_state) @@ -80,7 +80,7 @@ abstract class VerificationRequestConclusionItem : AbsBaseMessageItem<Verificati val isPositive: Boolean, override val informationData: MessageInformationData, override val avatarRenderer: AvatarRenderer, - override val colorProvider: ColorProvider, + override val messageColorProvider: MessageColorProvider, override val itemLongClickListener: View.OnLongClickListener? = null, override val itemClickListener: View.OnClickListener? = null, override val reactionPillCallback: TimelineEventController.ReactionPillCallback? = null, diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/VerificationRequestItem.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/VerificationRequestItem.kt index 309a4a436f..ef43605b04 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/VerificationRequestItem.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/VerificationRequestItem.kt @@ -32,10 +32,10 @@ import im.vector.matrix.android.api.session.crypto.verification.VerificationServ import im.vector.matrix.android.internal.session.room.VerificationState import im.vector.riotx.R import im.vector.riotx.core.extensions.exhaustive -import im.vector.riotx.core.resources.ColorProvider import im.vector.riotx.core.utils.DebouncedClickListener import im.vector.riotx.features.home.AvatarRenderer import im.vector.riotx.features.home.room.detail.RoomDetailAction +import im.vector.riotx.features.home.room.detail.timeline.MessageColorProvider import im.vector.riotx.features.home.room.detail.timeline.TimelineEventController @EpoxyModelClass(layout = R.layout.item_timeline_event_base_state) @@ -166,7 +166,7 @@ abstract class VerificationRequestItem : AbsBaseMessageItem<VerificationRequestI // val avatarSize: Int, override val informationData: MessageInformationData, override val avatarRenderer: AvatarRenderer, - override val colorProvider: ColorProvider, + override val messageColorProvider: MessageColorProvider, override val itemLongClickListener: View.OnLongClickListener? = null, override val itemClickListener: View.OnClickListener? = null, // val memberClickListener: View.OnClickListener? = null, diff --git a/vector/src/main/java/im/vector/riotx/features/login/LoginCaptchaFragment.kt b/vector/src/main/java/im/vector/riotx/features/login/LoginCaptchaFragment.kt index b11cd57329..9bd709d1bd 100644 --- a/vector/src/main/java/im/vector/riotx/features/login/LoginCaptchaFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/LoginCaptchaFragment.kt @@ -89,7 +89,7 @@ class LoginCaptchaFragment @Inject constructor( } override fun onReceivedSslError(view: WebView, handler: SslErrorHandler, error: SslError) { - Timber.d("## onReceivedSslError() : " + error.certificate) + Timber.d("## onReceivedSslError() : ${error.certificate}") if (!isAdded) { return diff --git a/vector/src/main/java/im/vector/riotx/features/login/LoginFragment.kt b/vector/src/main/java/im/vector/riotx/features/login/LoginFragment.kt index 3e45eeb406..01cc19fa5b 100644 --- a/vector/src/main/java/im/vector/riotx/features/login/LoginFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/LoginFragment.kt @@ -209,7 +209,14 @@ class LoginFragment @Inject constructor() : AbstractLoginFragment() { } else { // Trick to display the error without text. loginFieldTil.error = " " - passwordFieldTil.error = errorFormatter.toHumanReadable(state.asyncLoginAction.error) + if (error is Failure.ServerError + && error.error.code == MatrixError.M_FORBIDDEN + && error.error.message == "Invalid password" + && spaceInPassword()) { + passwordFieldTil.error = getString(R.string.auth_invalid_login_param_space_in_password) + } else { + passwordFieldTil.error = errorFormatter.toHumanReadable(error) + } } } // Success is handled by the LoginActivity @@ -226,4 +233,9 @@ class LoginFragment @Inject constructor() : AbstractLoginFragment() { is Success -> Unit } } + + /** + * Detect if password ends or starts with spaces + */ + private fun spaceInPassword() = passwordField.text.toString().let { it.trim() != it } } diff --git a/vector/src/main/java/im/vector/riotx/features/media/ImageContentRenderer.kt b/vector/src/main/java/im/vector/riotx/features/media/ImageContentRenderer.kt index e497d9ce04..737549d5b8 100644 --- a/vector/src/main/java/im/vector/riotx/features/media/ImageContentRenderer.kt +++ b/vector/src/main/java/im/vector/riotx/features/media/ImageContentRenderer.kt @@ -127,6 +127,15 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder: GlideApp .with(imageView) .load(resolvedUrl) + .apply { + if (mode == Mode.THUMBNAIL) { + error( + GlideApp + .with(imageView) + .load(contentUrlResolver.resolveFullSize(data.url)) + ) + } + } } } diff --git a/vector/src/main/java/im/vector/riotx/features/navigation/DefaultNavigator.kt b/vector/src/main/java/im/vector/riotx/features/navigation/DefaultNavigator.kt index 63fab290be..a080cabf1b 100644 --- a/vector/src/main/java/im/vector/riotx/features/navigation/DefaultNavigator.kt +++ b/vector/src/main/java/im/vector/riotx/features/navigation/DefaultNavigator.kt @@ -24,7 +24,6 @@ import androidx.core.app.ActivityOptionsCompat import androidx.core.app.TaskStackBuilder import androidx.core.view.ViewCompat import im.vector.matrix.android.api.session.crypto.verification.IncomingSasVerificationTransaction -import im.vector.matrix.android.api.session.crypto.verification.VerificationMethod import im.vector.matrix.android.api.session.room.model.roomdirectory.PublicRoom import im.vector.matrix.android.api.util.MatrixItem import im.vector.riotx.R @@ -35,6 +34,7 @@ import im.vector.riotx.core.utils.toast import im.vector.riotx.features.createdirect.CreateDirectRoomActivity import im.vector.riotx.features.crypto.keysbackup.settings.KeysBackupManageActivity import im.vector.riotx.features.crypto.keysbackup.setup.KeysBackupSetupActivity +import im.vector.riotx.features.crypto.verification.SupportedVerificationMethodsProvider import im.vector.riotx.features.crypto.verification.VerificationBottomSheet import im.vector.riotx.features.debug.DebugMenuActivity import im.vector.riotx.features.home.room.detail.RoomDetailActivity @@ -56,7 +56,8 @@ import javax.inject.Singleton @Singleton class DefaultNavigator @Inject constructor( private val sessionHolder: ActiveSessionHolder, - private val vectorPreferences: VectorPreferences + private val vectorPreferences: VectorPreferences, + private val supportedVerificationMethodsProvider: SupportedVerificationMethodsProvider ) : Navigator { override fun openRoom(context: Context, roomId: String, eventId: String?, buildTask: Boolean) { @@ -85,9 +86,10 @@ class DefaultNavigator @Inject constructor( override fun requestSessionVerification(context: Context) { val session = sessionHolder.getSafeActiveSession() ?: return val pr = session.cryptoService().verificationService().requestKeyVerification( - listOf(VerificationMethod.SAS, VerificationMethod.QR_CODE_SCAN, VerificationMethod.QR_CODE_SHOW), + supportedVerificationMethodsProvider.provide(), session.myUserId, - session.cryptoService().getUserDevices(session.myUserId).map { it.deviceId }) + session.cryptoService().getUserDevices(session.myUserId).map { it.deviceId } + ) if (context is VectorBaseActivity) { VerificationBottomSheet.withArgs( roomId = null, diff --git a/vector/src/main/java/im/vector/riotx/features/rageshake/VectorUncaughtExceptionHandler.kt b/vector/src/main/java/im/vector/riotx/features/rageshake/VectorUncaughtExceptionHandler.kt index 0b5c3d2d26..e93a113439 100644 --- a/vector/src/main/java/im/vector/riotx/features/rageshake/VectorUncaughtExceptionHandler.kt +++ b/vector/src/main/java/im/vector/riotx/features/rageshake/VectorUncaughtExceptionHandler.kt @@ -99,9 +99,9 @@ class VectorUncaughtExceptionHandler @Inject constructor(private val bugReporter val pw = PrintWriter(sw, true) throwable.printStackTrace(pw) b.append(sw.buffer.toString()) - Timber.e("FATAL EXCEPTION " + b.toString()) val bugDescription = b.toString() + Timber.e("FATAL EXCEPTION $bugDescription") bugReporter.saveCrashReport(context, bugDescription) diff --git a/vector/src/main/java/im/vector/riotx/features/settings/VectorPreferences.kt b/vector/src/main/java/im/vector/riotx/features/settings/VectorPreferences.kt index acc3c72253..68f92ff15e 100755 --- a/vector/src/main/java/im/vector/riotx/features/settings/VectorPreferences.kt +++ b/vector/src/main/java/im/vector/riotx/features/settings/VectorPreferences.kt @@ -414,7 +414,7 @@ class VectorPreferences @Inject constructor(private val context: Context) { uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION) } - Timber.v("## getNotificationRingTone() returns " + uri!!) + Timber.v("## getNotificationRingTone() returns $uri") return uri } diff --git a/vector/src/main/java/im/vector/riotx/features/settings/devices/DevicesViewModel.kt b/vector/src/main/java/im/vector/riotx/features/settings/devices/DevicesViewModel.kt index ce6e388af6..79a5fe84aa 100644 --- a/vector/src/main/java/im/vector/riotx/features/settings/devices/DevicesViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/settings/devices/DevicesViewModel.kt @@ -40,7 +40,7 @@ import im.vector.matrix.android.internal.crypto.model.rest.DeviceInfo import im.vector.matrix.android.internal.crypto.model.rest.DevicesListResponse import im.vector.matrix.rx.rx import im.vector.riotx.core.platform.VectorViewModel -import im.vector.riotx.features.crypto.verification.supportedVerificationMethods +import im.vector.riotx.features.crypto.verification.SupportedVerificationMethodsProvider data class DevicesViewState( val myDeviceId: String = "", @@ -50,8 +50,10 @@ data class DevicesViewState( val request: Async<Unit> = Uninitialized ) : MvRxState -class DevicesViewModel @AssistedInject constructor(@Assisted initialState: DevicesViewState, - private val session: Session) +class DevicesViewModel @AssistedInject constructor( + @Assisted initialState: DevicesViewState, + private val session: Session, + private val supportedVerificationMethodsProvider: SupportedVerificationMethodsProvider) : VectorViewModel<DevicesViewState, DevicesAction, DevicesViewEvents>(initialState), VerificationService.Listener { @AssistedInject.Factory @@ -172,7 +174,9 @@ class DevicesViewModel @AssistedInject constructor(@Assisted initialState: Devic } private fun handleVerify(action: DevicesAction.VerifyMyDevice) { - val txID = session.cryptoService().verificationService().requestKeyVerification(supportedVerificationMethods, session.myUserId, listOf(action.deviceId)) + val txID = session.cryptoService() + .verificationService() + .requestKeyVerification(supportedVerificationMethodsProvider.provide(), session.myUserId, listOf(action.deviceId)) _viewEvents.post(DevicesViewEvents.ShowVerifyDevice( session.myUserId, txID.transactionId diff --git a/vector/src/main/java/im/vector/riotx/features/share/IncomingShareFragment.kt b/vector/src/main/java/im/vector/riotx/features/share/IncomingShareFragment.kt index eb0f5128ba..74821ab2fe 100644 --- a/vector/src/main/java/im/vector/riotx/features/share/IncomingShareFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/share/IncomingShareFragment.kt @@ -28,7 +28,6 @@ import androidx.appcompat.widget.SearchView import androidx.core.view.isVisible import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.withState -import com.kbeanie.multipicker.utils.IntentUtils import im.vector.matrix.android.api.session.content.ContentAttachmentData import im.vector.matrix.android.api.session.room.model.RoomSummary import im.vector.riotx.R @@ -78,7 +77,7 @@ class IncomingShareFragment @Inject constructor( val intent = vectorBaseActivity.intent val isShareManaged = when (intent?.action) { Intent.ACTION_SEND -> { - var isShareManaged = attachmentsHelper.handleShareIntent(IntentUtils.getPickerIntentForSharing(intent)) + var isShareManaged = attachmentsHelper.handleShareIntent(intent) if (!isShareManaged) { isShareManaged = handleTextShare(intent) } diff --git a/vector/src/main/java/im/vector/riotx/features/ui/ColorProviderExt.kt b/vector/src/main/java/im/vector/riotx/features/ui/ColorProviderExt.kt deleted file mode 100644 index a53ed921cb..0000000000 --- a/vector/src/main/java/im/vector/riotx/features/ui/ColorProviderExt.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019 New Vector Ltd - * - * 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.riotx.features.ui - -import androidx.annotation.ColorInt -import im.vector.matrix.android.api.session.room.send.SendState -import im.vector.riotx.R -import im.vector.riotx.core.resources.ColorProvider - -@ColorInt -fun ColorProvider.getMessageTextColor(sendState: SendState): Int { - return when (sendState) { - // SendStates, in the classical order they will occur - SendState.UNKNOWN, - SendState.UNSENT -> getColorFromAttribute(R.attr.vctr_sending_message_text_color) - SendState.ENCRYPTING -> getColorFromAttribute(R.attr.vctr_encrypting_message_text_color) - SendState.SENDING -> getColorFromAttribute(R.attr.vctr_sending_message_text_color) - SendState.SENT, - SendState.SYNCED -> getColorFromAttribute(R.attr.vctr_message_text_color) - SendState.UNDELIVERED, - SendState.FAILED_UNKNOWN_DEVICES -> getColorFromAttribute(R.attr.vctr_unsent_message_text_color) - } -} diff --git a/vector/src/main/res/drawable-hdpi/alert_triangle.png b/vector/src/main/res/drawable-hdpi/alert_triangle.png deleted file mode 100644 index fb89badcac..0000000000 Binary files a/vector/src/main/res/drawable-hdpi/alert_triangle.png and /dev/null differ diff --git a/vector/src/main/res/drawable-hdpi/ic_add_circle_white.png b/vector/src/main/res/drawable-hdpi/ic_add_circle_white.png deleted file mode 100644 index 97e105bc68..0000000000 Binary files a/vector/src/main/res/drawable-hdpi/ic_add_circle_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-hdpi/ic_home_black_24dp.png b/vector/src/main/res/drawable-hdpi/ic_home_black_24dp.png deleted file mode 100644 index 9f61d7bf25..0000000000 Binary files a/vector/src/main/res/drawable-hdpi/ic_home_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-hdpi/ic_notification_privacy_warning.png b/vector/src/main/res/drawable-hdpi/ic_notification_privacy_warning.png deleted file mode 100644 index 65fa1ae40e..0000000000 Binary files a/vector/src/main/res/drawable-hdpi/ic_notification_privacy_warning.png and /dev/null differ diff --git a/vector/src/main/res/drawable-hdpi/ic_person_black_24dp.png b/vector/src/main/res/drawable-hdpi/ic_person_black_24dp.png deleted file mode 100644 index 6fbcc6d425..0000000000 Binary files a/vector/src/main/res/drawable-hdpi/ic_person_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-hdpi/ic_remove_circle_outline_red.png b/vector/src/main/res/drawable-hdpi/ic_remove_circle_outline_red.png deleted file mode 100644 index efca00ff8b..0000000000 Binary files a/vector/src/main/res/drawable-hdpi/ic_remove_circle_outline_red.png and /dev/null differ diff --git a/vector/src/main/res/drawable-hdpi/ic_star_black_24dp.png b/vector/src/main/res/drawable-hdpi/ic_star_black_24dp.png deleted file mode 100644 index 92a0f58622..0000000000 Binary files a/vector/src/main/res/drawable-hdpi/ic_star_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-hdpi/logo_transparent.png b/vector/src/main/res/drawable-hdpi/logo_transparent.png deleted file mode 100755 index 06ffbaca64..0000000000 Binary files a/vector/src/main/res/drawable-hdpi/logo_transparent.png and /dev/null differ diff --git a/vector/src/main/res/drawable-hdpi/sticker_placeholder.png b/vector/src/main/res/drawable-hdpi/sticker_placeholder.png deleted file mode 100644 index 57f185c76c..0000000000 Binary files a/vector/src/main/res/drawable-hdpi/sticker_placeholder.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/alert_triangle.png b/vector/src/main/res/drawable-mdpi/alert_triangle.png deleted file mode 100644 index 8e05fa5a34..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/alert_triangle.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/ic_add_circle_white.png b/vector/src/main/res/drawable-mdpi/ic_add_circle_white.png deleted file mode 100644 index e7959eb502..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/ic_add_circle_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/ic_home_black_24dp.png b/vector/src/main/res/drawable-mdpi/ic_home_black_24dp.png deleted file mode 100644 index 9f2c3d2f75..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/ic_home_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/ic_material_camera.png b/vector/src/main/res/drawable-mdpi/ic_material_camera.png deleted file mode 100755 index 78e5bb23ff..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/ic_material_camera.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/ic_material_file.png b/vector/src/main/res/drawable-mdpi/ic_material_file.png deleted file mode 100755 index 64561dd4a4..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/ic_material_file.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/ic_material_videocam.png b/vector/src/main/res/drawable-mdpi/ic_material_videocam.png deleted file mode 100755 index 3153a9b6d4..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/ic_material_videocam.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/ic_notification_privacy_warning.png b/vector/src/main/res/drawable-mdpi/ic_notification_privacy_warning.png deleted file mode 100644 index 1e579b812b..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/ic_notification_privacy_warning.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/ic_person_black_24dp.png b/vector/src/main/res/drawable-mdpi/ic_person_black_24dp.png deleted file mode 100644 index 57da32af18..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/ic_person_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/ic_remove_circle_outline_red.png b/vector/src/main/res/drawable-mdpi/ic_remove_circle_outline_red.png deleted file mode 100644 index d266bf6d92..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/ic_remove_circle_outline_red.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/ic_send_sticker.png b/vector/src/main/res/drawable-mdpi/ic_send_sticker.png deleted file mode 100644 index a369cbee49..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/ic_send_sticker.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/ic_star_black_24dp.png b/vector/src/main/res/drawable-mdpi/ic_star_black_24dp.png deleted file mode 100644 index a728afe600..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/ic_star_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/logo_transparent.png b/vector/src/main/res/drawable-mdpi/logo_transparent.png deleted file mode 100755 index d0e3a998a8..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/logo_transparent.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/sticker_placeholder.png b/vector/src/main/res/drawable-mdpi/sticker_placeholder.png deleted file mode 100644 index 1fb5a99dde..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/sticker_placeholder.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/vector_cancel_upload_download.png b/vector/src/main/res/drawable-mdpi/vector_cancel_upload_download.png deleted file mode 100755 index 51b4401ca0..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/vector_cancel_upload_download.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/vector_micro_green.png b/vector/src/main/res/drawable-mdpi/vector_micro_green.png deleted file mode 100755 index 15114b7e71..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/vector_micro_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/video_call_black.png b/vector/src/main/res/drawable-mdpi/video_call_black.png deleted file mode 100755 index 0039e804eb..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/video_call_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/video_call_green.png b/vector/src/main/res/drawable-mdpi/video_call_green.png deleted file mode 100755 index 028ec1e3e3..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/video_call_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/voice_call_black.png b/vector/src/main/res/drawable-mdpi/voice_call_black.png deleted file mode 100755 index 7c9d1b09c5..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/voice_call_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/voice_call_end_fushia.png b/vector/src/main/res/drawable-mdpi/voice_call_end_fushia.png deleted file mode 100755 index 814aa0017e..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/voice_call_end_fushia.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/voice_call_green.png b/vector/src/main/res/drawable-mdpi/voice_call_green.png deleted file mode 100755 index 7afa5cd118..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/voice_call_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-mdpi/voice_call_start_green.png b/vector/src/main/res/drawable-mdpi/voice_call_start_green.png deleted file mode 100755 index b11532ef5a..0000000000 Binary files a/vector/src/main/res/drawable-mdpi/voice_call_start_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xhdpi/alert_triangle.png b/vector/src/main/res/drawable-xhdpi/alert_triangle.png deleted file mode 100644 index 08a9898b6a..0000000000 Binary files a/vector/src/main/res/drawable-xhdpi/alert_triangle.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xhdpi/ic_add_circle_white.png b/vector/src/main/res/drawable-xhdpi/ic_add_circle_white.png deleted file mode 100644 index 08f5e12811..0000000000 Binary files a/vector/src/main/res/drawable-xhdpi/ic_add_circle_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xhdpi/ic_home_black_24dp.png b/vector/src/main/res/drawable-xhdpi/ic_home_black_24dp.png deleted file mode 100644 index dcdcfc0a80..0000000000 Binary files a/vector/src/main/res/drawable-xhdpi/ic_home_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xhdpi/ic_notification_privacy_warning.png b/vector/src/main/res/drawable-xhdpi/ic_notification_privacy_warning.png deleted file mode 100644 index 99193f5f72..0000000000 Binary files a/vector/src/main/res/drawable-xhdpi/ic_notification_privacy_warning.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xhdpi/ic_person_black_24dp.png b/vector/src/main/res/drawable-xhdpi/ic_person_black_24dp.png deleted file mode 100644 index 360a32f27c..0000000000 Binary files a/vector/src/main/res/drawable-xhdpi/ic_person_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xhdpi/ic_remove_circle_outline_red.png b/vector/src/main/res/drawable-xhdpi/ic_remove_circle_outline_red.png deleted file mode 100644 index e4e24bca05..0000000000 Binary files a/vector/src/main/res/drawable-xhdpi/ic_remove_circle_outline_red.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xhdpi/ic_send_sticker.png b/vector/src/main/res/drawable-xhdpi/ic_send_sticker.png deleted file mode 100644 index c17d04e498..0000000000 Binary files a/vector/src/main/res/drawable-xhdpi/ic_send_sticker.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xhdpi/ic_star_black_24dp.png b/vector/src/main/res/drawable-xhdpi/ic_star_black_24dp.png deleted file mode 100644 index f649a5d56b..0000000000 Binary files a/vector/src/main/res/drawable-xhdpi/ic_star_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xhdpi/logo_transparent.png b/vector/src/main/res/drawable-xhdpi/logo_transparent.png deleted file mode 100755 index f1126bd419..0000000000 Binary files a/vector/src/main/res/drawable-xhdpi/logo_transparent.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xhdpi/sticker_placeholder.png b/vector/src/main/res/drawable-xhdpi/sticker_placeholder.png deleted file mode 100644 index 3309d3a0bd..0000000000 Binary files a/vector/src/main/res/drawable-xhdpi/sticker_placeholder.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/admin_icon.png b/vector/src/main/res/drawable-xxhdpi/admin_icon.png deleted file mode 100644 index ce9e1f09d7..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/admin_icon.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/alert_triangle.png b/vector/src/main/res/drawable-xxhdpi/alert_triangle.png deleted file mode 100644 index 976810233c..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/alert_triangle.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/apps_icon.png b/vector/src/main/res/drawable-xxhdpi/apps_icon.png deleted file mode 100644 index cbad4c960a..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/apps_icon.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/bubbles_bg_portrait.png b/vector/src/main/res/drawable-xxhdpi/bubbles_bg_portrait.png deleted file mode 100644 index 9ad62ae49c..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/bubbles_bg_portrait.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/camera_play.png b/vector/src/main/res/drawable-xxhdpi/camera_play.png deleted file mode 100755 index 50e34bc240..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/camera_play.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/camera_stop.png b/vector/src/main/res/drawable-xxhdpi/camera_stop.png deleted file mode 100755 index 36585c7d42..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/camera_stop.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/camera_video_capture.png b/vector/src/main/res/drawable-xxhdpi/camera_video_capture.png deleted file mode 100644 index 0ef45d6e8f..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/camera_video_capture.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/file_upload_failed.png b/vector/src/main/res/drawable-xxhdpi/file_upload_failed.png deleted file mode 100755 index 6c0f2e17d9..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/file_upload_failed.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/filetype_gif.png b/vector/src/main/res/drawable-xxhdpi/filetype_gif.png deleted file mode 100755 index 4157690837..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/filetype_gif.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/filetype_image.png b/vector/src/main/res/drawable-xxhdpi/filetype_image.png deleted file mode 100755 index aa65b8a0d6..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/filetype_image.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/filetype_video.png b/vector/src/main/res/drawable-xxhdpi/filetype_video.png deleted file mode 100755 index 34a9d8c943..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/filetype_video.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_add_circle_outline_white_24dp.png b/vector/src/main/res/drawable-xxhdpi/ic_add_circle_outline_white_24dp.png deleted file mode 100644 index 6318241623..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_add_circle_outline_white_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_add_circle_white.png b/vector/src/main/res/drawable-xxhdpi/ic_add_circle_white.png deleted file mode 100644 index 0fdbc572a7..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_add_circle_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_add_white.png b/vector/src/main/res/drawable-xxhdpi/ic_add_white.png deleted file mode 100755 index 94789119f8..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_add_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_arrow_drop_down_white.png b/vector/src/main/res/drawable-xxhdpi/ic_arrow_drop_down_white.png deleted file mode 100644 index 452e502169..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_arrow_drop_down_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_arrow_drop_up_white.png b/vector/src/main/res/drawable-xxhdpi/ic_arrow_drop_up_white.png deleted file mode 100644 index 3d1b812c1e..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_arrow_drop_up_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_block_black.png b/vector/src/main/res/drawable-xxhdpi/ic_block_black.png deleted file mode 100644 index 03204492ff..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_block_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_comment_black.png b/vector/src/main/res/drawable-xxhdpi/ic_comment_black.png deleted file mode 100755 index e96ccd21ab..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_comment_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_devices_info.png b/vector/src/main/res/drawable-xxhdpi/ic_devices_info.png deleted file mode 100755 index 0ac10c8f33..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_devices_info.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_exit_media_picker_vector_green.png b/vector/src/main/res/drawable-xxhdpi/ic_exit_media_picker_vector_green.png deleted file mode 100644 index 90d97382f0..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_exit_media_picker_vector_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_guest_access_black.png b/vector/src/main/res/drawable-xxhdpi/ic_guest_access_black.png deleted file mode 100755 index f37f432f16..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_guest_access_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_home_black_24dp.png b/vector/src/main/res/drawable-xxhdpi/ic_home_black_24dp.png deleted file mode 100644 index 2e86cc2557..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_home_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_list_white_24dp.png b/vector/src/main/res/drawable-xxhdpi/ic_list_white_24dp.png deleted file mode 100644 index 99cb1691c1..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_list_white_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_add_circle.png b/vector/src/main/res/drawable-xxhdpi/ic_material_add_circle.png deleted file mode 100755 index af8720ec5e..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_add_circle.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_arrow_back_white.png b/vector/src/main/res/drawable-xxhdpi/ic_material_arrow_back_white.png deleted file mode 100644 index 5329a6a892..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_arrow_back_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_camera.png b/vector/src/main/res/drawable-xxhdpi/ic_material_camera.png deleted file mode 100755 index 78e5bb23ff..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_camera.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_eject_white.png b/vector/src/main/res/drawable-xxhdpi/ic_material_eject_white.png deleted file mode 100755 index 1e64f495d2..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_eject_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_file.png b/vector/src/main/res/drawable-xxhdpi/ic_material_file.png deleted file mode 100755 index 64561dd4a4..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_file.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_forward.png b/vector/src/main/res/drawable-xxhdpi/ic_material_forward.png deleted file mode 100755 index 43dcf608e7..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_forward.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_history_white.png b/vector/src/main/res/drawable-xxhdpi/ic_material_history_white.png deleted file mode 100644 index 1358a129cf..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_history_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_link_black.png b/vector/src/main/res/drawable-xxhdpi/ic_material_link_black.png deleted file mode 100755 index af03b8558f..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_link_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_menu_white.png b/vector/src/main/res/drawable-xxhdpi/ic_material_menu_white.png deleted file mode 100755 index 9cb0348236..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_menu_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_message_black.png b/vector/src/main/res/drawable-xxhdpi/ic_material_message_black.png deleted file mode 100644 index 0d989b2bcd..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_message_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_message_grey.png b/vector/src/main/res/drawable-xxhdpi/ic_material_message_grey.png deleted file mode 100644 index 92a1da89f6..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_message_grey.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_mic_off_grey.png b/vector/src/main/res/drawable-xxhdpi/ic_material_mic_off_grey.png deleted file mode 100644 index e2c2522c5f..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_mic_off_grey.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_mic_off_pink_red.png b/vector/src/main/res/drawable-xxhdpi/ic_material_mic_off_pink_red.png deleted file mode 100644 index 1154e06d87..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_mic_off_pink_red.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_movie.png b/vector/src/main/res/drawable-xxhdpi/ic_material_movie.png deleted file mode 100755 index 95d1624d10..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_movie.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_photo.png b/vector/src/main/res/drawable-xxhdpi/ic_material_photo.png deleted file mode 100755 index ebe206ff7b..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_photo.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_quote.png b/vector/src/main/res/drawable-xxhdpi/ic_material_quote.png deleted file mode 100755 index 0e03539810..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_quote.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_search_black.png b/vector/src/main/res/drawable-xxhdpi/ic_material_search_black.png deleted file mode 100644 index f0c8c572bb..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_search_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_search_white.png b/vector/src/main/res/drawable-xxhdpi/ic_material_search_white.png deleted file mode 100755 index abbb989510..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_search_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_send_green.png b/vector/src/main/res/drawable-xxhdpi/ic_material_send_green.png deleted file mode 100755 index 605769a27b..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_send_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_send_white.png b/vector/src/main/res/drawable-xxhdpi/ic_material_send_white.png deleted file mode 100644 index b6c4e0369d..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_send_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_settings_small.png b/vector/src/main/res/drawable-xxhdpi/ic_material_settings_small.png deleted file mode 100755 index 47f0e0d820..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_settings_small.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_share.png b/vector/src/main/res/drawable-xxhdpi/ic_material_share.png deleted file mode 100755 index 0fe15fc056..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_share.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_speaker_phone_grey.png b/vector/src/main/res/drawable-xxhdpi/ic_material_speaker_phone_grey.png deleted file mode 100644 index 485cbaaa54..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_speaker_phone_grey.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_speaker_phone_pink_red.png b/vector/src/main/res/drawable-xxhdpi/ic_material_speaker_phone_pink_red.png deleted file mode 100644 index fa80bace73..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_speaker_phone_pink_red.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_star_black.png b/vector/src/main/res/drawable-xxhdpi/ic_material_star_black.png deleted file mode 100755 index 7be22806f0..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_star_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_star_border_black.png b/vector/src/main/res/drawable-xxhdpi/ic_material_star_border_black.png deleted file mode 100755 index 041aa6b035..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_star_border_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_switch_video_grey.png b/vector/src/main/res/drawable-xxhdpi/ic_material_switch_video_grey.png deleted file mode 100644 index 2b6b07a51a..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_switch_video_grey.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_switch_video_pink_red.png b/vector/src/main/res/drawable-xxhdpi/ic_material_switch_video_pink_red.png deleted file mode 100644 index 8a6ef16f46..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_switch_video_pink_red.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_transparent.png b/vector/src/main/res/drawable-xxhdpi/ic_material_transparent.png deleted file mode 100644 index c22b23a87c..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_transparent.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_videocam.png b/vector/src/main/res/drawable-xxhdpi/ic_material_videocam.png deleted file mode 100755 index 3153a9b6d4..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_videocam.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_videocam_grey.png b/vector/src/main/res/drawable-xxhdpi/ic_material_videocam_grey.png deleted file mode 100644 index 616bc926c6..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_videocam_grey.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_videocam_off_grey.png b/vector/src/main/res/drawable-xxhdpi/ic_material_videocam_off_grey.png deleted file mode 100644 index 903d3e7d63..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_videocam_off_grey.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_material_videocam_off_pink_red.png b/vector/src/main/res/drawable-xxhdpi/ic_material_videocam_off_pink_red.png deleted file mode 100644 index cbe4953675..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_material_videocam_off_pink_red.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_notification_privacy_warning.png b/vector/src/main/res/drawable-xxhdpi/ic_notification_privacy_warning.png deleted file mode 100644 index fb07c14b8a..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_notification_privacy_warning.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_perm_device_information_black.png b/vector/src/main/res/drawable-xxhdpi/ic_perm_device_information_black.png deleted file mode 100755 index 0ac10c8f33..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_perm_device_information_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_person_add_black.png b/vector/src/main/res/drawable-xxhdpi/ic_person_add_black.png deleted file mode 100644 index 48236bc8f3..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_person_add_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_person_black.png b/vector/src/main/res/drawable-xxhdpi/ic_person_black.png deleted file mode 100755 index f1e148490b..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_person_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_person_black_24dp.png b/vector/src/main/res/drawable-xxhdpi/ic_person_black_24dp.png deleted file mode 100644 index f1e148490b..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_person_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_person_outline_black.png b/vector/src/main/res/drawable-xxhdpi/ic_person_outline_black.png deleted file mode 100755 index d54de22cae..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_person_outline_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_power_settings.png b/vector/src/main/res/drawable-xxhdpi/ic_power_settings.png deleted file mode 100644 index d206fa435a..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_power_settings.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_send_sticker.png b/vector/src/main/res/drawable-xxhdpi/ic_send_sticker.png deleted file mode 100644 index a369cbee49..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_send_sticker.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_share_white.png b/vector/src/main/res/drawable-xxhdpi/ic_share_white.png deleted file mode 100755 index a35b3cd14a..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_share_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_star_black_24dp.png b/vector/src/main/res/drawable-xxhdpi/ic_star_black_24dp.png deleted file mode 100644 index 54d306599a..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_star_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_switch_camera.png b/vector/src/main/res/drawable-xxhdpi/ic_switch_camera.png deleted file mode 100644 index 10eba70c61..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_switch_camera.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_take_picture_vector_green.png b/vector/src/main/res/drawable-xxhdpi/ic_take_picture_vector_green.png deleted file mode 100644 index 3b79d259db..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_take_picture_vector_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_verified_user_black.png b/vector/src/main/res/drawable-xxhdpi/ic_verified_user_black.png deleted file mode 100644 index 70a9fc1bf2..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_verified_user_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/ic_word_readable_black.png b/vector/src/main/res/drawable-xxhdpi/ic_word_readable_black.png deleted file mode 100755 index c816ab49dc..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/ic_word_readable_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/icon_person.png b/vector/src/main/res/drawable-xxhdpi/icon_person.png deleted file mode 100755 index 3d27bd4c3f..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/icon_person.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/jump_to_unread.png b/vector/src/main/res/drawable-xxhdpi/jump_to_unread.png deleted file mode 100644 index 8c14ae536c..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/jump_to_unread.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/logo_transparent.png b/vector/src/main/res/drawable-xxhdpi/logo_transparent.png deleted file mode 100755 index bfee5bc1b9..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/logo_transparent.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/mod_icon.png b/vector/src/main/res/drawable-xxhdpi/mod_icon.png deleted file mode 100644 index a1a3b3d2b7..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/mod_icon.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/riot_tab_groups.png b/vector/src/main/res/drawable-xxhdpi/riot_tab_groups.png deleted file mode 100644 index 7dc4232ae3..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/riot_tab_groups.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/riot_tab_rooms.png b/vector/src/main/res/drawable-xxhdpi/riot_tab_rooms.png deleted file mode 100644 index 4f3b8cfb41..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/riot_tab_rooms.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/sticker_placeholder.png b/vector/src/main/res/drawable-xxhdpi/sticker_placeholder.png deleted file mode 100644 index bbb7a0c156..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/sticker_placeholder.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/vector_actions_9b.png b/vector/src/main/res/drawable-xxhdpi/vector_actions_9b.png deleted file mode 100755 index efc3986011..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/vector_actions_9b.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/vector_cancel_upload_download.png b/vector/src/main/res/drawable-xxhdpi/vector_cancel_upload_download.png deleted file mode 100755 index 51b4401ca0..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/vector_cancel_upload_download.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/vector_clear_edittext_green.png b/vector/src/main/res/drawable-xxhdpi/vector_clear_edittext_green.png deleted file mode 100755 index fa9468e362..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/vector_clear_edittext_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/vector_close_widget.png b/vector/src/main/res/drawable-xxhdpi/vector_close_widget.png deleted file mode 100755 index 51b4401ca0..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/vector_close_widget.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/vector_create_direct_room.png b/vector/src/main/res/drawable-xxhdpi/vector_create_direct_room.png deleted file mode 100755 index a5b2b57497..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/vector_create_direct_room.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/vector_creation_remove_user.png b/vector/src/main/res/drawable-xxhdpi/vector_creation_remove_user.png deleted file mode 100755 index 51b4401ca0..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/vector_creation_remove_user.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/vector_leave_room_black.png b/vector/src/main/res/drawable-xxhdpi/vector_leave_room_black.png deleted file mode 100755 index 51b4401ca0..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/vector_leave_room_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/vector_micro_green.png b/vector/src/main/res/drawable-xxhdpi/vector_micro_green.png deleted file mode 100755 index 15114b7e71..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/vector_micro_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/vector_notification_open.png b/vector/src/main/res/drawable-xxhdpi/vector_notification_open.png deleted file mode 100644 index 0d989b2bcd..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/vector_notification_open.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/vector_search_bg.png b/vector/src/main/res/drawable-xxhdpi/vector_search_bg.png deleted file mode 100644 index 4525d4f5a5..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/vector_search_bg.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/video_call_black.png b/vector/src/main/res/drawable-xxhdpi/video_call_black.png deleted file mode 100755 index 0039e804eb..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/video_call_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/video_call_green.png b/vector/src/main/res/drawable-xxhdpi/video_call_green.png deleted file mode 100755 index 028ec1e3e3..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/video_call_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/voice_call_black.png b/vector/src/main/res/drawable-xxhdpi/voice_call_black.png deleted file mode 100755 index 7c9d1b09c5..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/voice_call_black.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/voice_call_end_fushia.png b/vector/src/main/res/drawable-xxhdpi/voice_call_end_fushia.png deleted file mode 100755 index 814aa0017e..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/voice_call_end_fushia.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/voice_call_green.png b/vector/src/main/res/drawable-xxhdpi/voice_call_green.png deleted file mode 100755 index 7afa5cd118..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/voice_call_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxhdpi/voice_call_start_green.png b/vector/src/main/res/drawable-xxhdpi/voice_call_start_green.png deleted file mode 100755 index b11532ef5a..0000000000 Binary files a/vector/src/main/res/drawable-xxhdpi/voice_call_start_green.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxxhdpi/alert_triangle.png b/vector/src/main/res/drawable-xxxhdpi/alert_triangle.png deleted file mode 100644 index 3560b98136..0000000000 Binary files a/vector/src/main/res/drawable-xxxhdpi/alert_triangle.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxxhdpi/ic_add_circle_white.png b/vector/src/main/res/drawable-xxxhdpi/ic_add_circle_white.png deleted file mode 100644 index 91967dbf08..0000000000 Binary files a/vector/src/main/res/drawable-xxxhdpi/ic_add_circle_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxxhdpi/ic_home_black_24dp.png b/vector/src/main/res/drawable-xxxhdpi/ic_home_black_24dp.png deleted file mode 100644 index 04e2b26ff1..0000000000 Binary files a/vector/src/main/res/drawable-xxxhdpi/ic_home_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxxhdpi/ic_material_call_white.png b/vector/src/main/res/drawable-xxxhdpi/ic_material_call_white.png deleted file mode 100755 index e4564e064d..0000000000 Binary files a/vector/src/main/res/drawable-xxxhdpi/ic_material_call_white.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxxhdpi/ic_person_black_24dp.png b/vector/src/main/res/drawable-xxxhdpi/ic_person_black_24dp.png deleted file mode 100644 index 1ebc37be17..0000000000 Binary files a/vector/src/main/res/drawable-xxxhdpi/ic_person_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxxhdpi/ic_remove_circle_outline_red.png b/vector/src/main/res/drawable-xxxhdpi/ic_remove_circle_outline_red.png deleted file mode 100644 index 1928d604de..0000000000 Binary files a/vector/src/main/res/drawable-xxxhdpi/ic_remove_circle_outline_red.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxxhdpi/ic_star_black_24dp.png b/vector/src/main/res/drawable-xxxhdpi/ic_star_black_24dp.png deleted file mode 100644 index edc662a359..0000000000 Binary files a/vector/src/main/res/drawable-xxxhdpi/ic_star_black_24dp.png and /dev/null differ diff --git a/vector/src/main/res/drawable-xxxhdpi/logo_transparent.png b/vector/src/main/res/drawable-xxxhdpi/logo_transparent.png deleted file mode 100755 index ccbe9bdef2..0000000000 Binary files a/vector/src/main/res/drawable-xxxhdpi/logo_transparent.png and /dev/null differ diff --git a/vector/src/main/res/layout/dialog_base_edit_text.xml b/vector/src/main/res/layout/dialog_base_edit_text.xml index e094ccd753..45c55f4451 100644 --- a/vector/src/main/res/layout/dialog_base_edit_text.xml +++ b/vector/src/main/res/layout/dialog_base_edit_text.xml @@ -13,7 +13,8 @@ <EditText android:id="@+id/edit_text" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:inputType="text"> <requestFocus /> </EditText> diff --git a/vector/src/main/res/layout/dialog_preference_edit_text.xml b/vector/src/main/res/layout/dialog_preference_edit_text.xml index 19825a67f1..a6c570f751 100644 --- a/vector/src/main/res/layout/dialog_preference_edit_text.xml +++ b/vector/src/main/res/layout/dialog_preference_edit_text.xml @@ -2,6 +2,7 @@ <!-- This file is here to fix Google issue https://code.google.com/p/android/issues/detail?id=231576 --> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="48dp" @@ -20,7 +21,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="4dp" - android:paddingEnd="4dp" /> + android:paddingEnd="4dp" + tools:ignore="TextFields" /> </LinearLayout> diff --git a/vector/src/main/res/layout/fragment_create_direct_room.xml b/vector/src/main/res/layout/fragment_create_direct_room.xml index 2ca5c81e7a..a6e477220b 100644 --- a/vector/src/main/res/layout/fragment_create_direct_room.xml +++ b/vector/src/main/res/layout/fragment_create_direct_room.xml @@ -89,6 +89,7 @@ android:gravity="center_vertical" android:hint="@string/direct_room_filter_hint" android:importantForAutofill="no" + android:inputType="text" android:maxHeight="80dp" android:paddingTop="16dp" android:paddingBottom="16dp" diff --git a/vector/src/main/res/layout/item_timeline_event_file_stub.xml b/vector/src/main/res/layout/item_timeline_event_file_stub.xml index 259e22b466..1c185ca973 100644 --- a/vector/src/main/res/layout/item_timeline_event_file_stub.xml +++ b/vector/src/main/res/layout/item_timeline_event_file_stub.xml @@ -27,7 +27,7 @@ android:layout_marginLeft="4dp" app:layout_constraintStart_toEndOf="@+id/messageFilee2eIcon" app:layout_constraintTop_toTopOf="parent" - tools:src="@drawable/filetype_image" /> + tools:src="@drawable/filetype_attachment" /> <!-- the media --> <TextView diff --git a/vector/src/main/res/layout/vector_message_merge_avatar_list.xml b/vector/src/main/res/layout/vector_message_merge_avatar_list.xml index 853dfc80d7..58f38ada0e 100644 --- a/vector/src/main/res/layout/vector_message_merge_avatar_list.xml +++ b/vector/src/main/res/layout/vector_message_merge_avatar_list.xml @@ -21,6 +21,7 @@ android:layout_marginLeft="-5dp" android:adjustViewBounds="true" android:scaleType="centerCrop" + tools:ignore="NegativeMargin" tools:src="@tools:sample/avatars" /> <ImageView @@ -31,6 +32,7 @@ android:layout_marginLeft="-5dp" android:adjustViewBounds="true" android:scaleType="centerCrop" + tools:ignore="NegativeMargin" tools:src="@tools:sample/avatars" /> <ImageView @@ -41,6 +43,7 @@ android:layout_marginLeft="-5dp" android:adjustViewBounds="true" android:scaleType="centerCrop" + tools:ignore="NegativeMargin" tools:src="@tools:sample/avatars" /> <ImageView @@ -51,6 +54,7 @@ android:layout_marginLeft="-5dp" android:adjustViewBounds="true" android:scaleType="centerCrop" + tools:ignore="NegativeMargin" tools:src="@tools:sample/avatars" /> </LinearLayout> \ No newline at end of file diff --git a/vector/src/main/res/menu/menu_country_picker.xml b/vector/src/main/res/menu/menu_country_picker.xml deleted file mode 100644 index 6214515f01..0000000000 --- a/vector/src/main/res/menu/menu_country_picker.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto"> - - <item - android:id="@+id/action_search" - android:title="@string/search_hint" - app:actionViewClass="android.support.v7.widget.SearchView" - app:showAsAction="always" /> - -</menu> \ No newline at end of file diff --git a/vector/src/main/res/menu/menu_languages_picker.xml b/vector/src/main/res/menu/menu_languages_picker.xml deleted file mode 100644 index 6214515f01..0000000000 --- a/vector/src/main/res/menu/menu_languages_picker.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto"> - - <item - android:id="@+id/action_search" - android:title="@string/search_hint" - app:actionViewClass="android.support.v7.widget.SearchView" - app:showAsAction="always" /> - -</menu> \ No newline at end of file diff --git a/vector/src/main/res/menu/menu_phone_number_addition.xml b/vector/src/main/res/menu/menu_phone_number_addition.xml deleted file mode 100644 index 2a9f2e7cd7..0000000000 --- a/vector/src/main/res/menu/menu_phone_number_addition.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto"> - - <item - android:id="@+id/action_add_phone_number" - android:icon="@drawable/ic_material_done_white" - android:title="@string/settings_add_phone_number" - app:showAsAction="always" /> - -</menu> \ No newline at end of file diff --git a/vector/src/main/res/menu/menu_phone_number_verification.xml b/vector/src/main/res/menu/menu_phone_number_verification.xml deleted file mode 100644 index f69c939179..0000000000 --- a/vector/src/main/res/menu/menu_phone_number_verification.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto"> - - <item - android:id="@+id/action_verify_phone_number" - android:icon="@drawable/ic_material_done_white" - android:title="@string/settings_phone_number_verification" - app:showAsAction="always" /> - -</menu> \ No newline at end of file diff --git a/vector/src/main/res/menu/vector_choose_sticker.xml b/vector/src/main/res/menu/vector_choose_sticker.xml deleted file mode 100644 index f22096caea..0000000000 --- a/vector/src/main/res/menu/vector_choose_sticker.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto"> - - <item - android:id="@+id/menu_settings" - android:icon="@drawable/ic_settings_x" - android:title="@string/room_sliding_menu_settings" - app:showAsAction="always" /> - -</menu> \ No newline at end of file diff --git a/vector/src/main/res/menu/vector_home_group_settings.xml b/vector/src/main/res/menu/vector_home_group_settings.xml deleted file mode 100755 index e40c4b487f..0000000000 --- a/vector/src/main/res/menu/vector_home_group_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android"> - <item - android:id="@+id/ic_action_select_remove_group" - android:icon="@drawable/vector_leave_room_black" - android:title="@string/leave" /> -</menu> \ No newline at end of file diff --git a/vector/src/main/res/menu/vector_home_room_settings.xml b/vector/src/main/res/menu/vector_home_room_settings.xml deleted file mode 100755 index 83a7173f53..0000000000 --- a/vector/src/main/res/menu/vector_home_room_settings.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android"> - - <group android:id="@+id/active_room_actions"> - <item - android:id="@+id/ic_action_notifications_noisy" - android:icon="@drawable/ic_material_done" - android:title="@string/room_settings_all_messages_noisy" /> - - <item - android:id="@+id/ic_action_notifications_all_message" - android:icon="@drawable/ic_material_done" - android:title="@string/room_settings_all_messages" /> - - <item - android:id="@+id/ic_action_notifications_mention_only" - android:icon="@drawable/ic_material_done" - android:title="@string/room_settings_mention_only" /> - - <item - android:id="@+id/ic_action_notifications_mute" - android:icon="@drawable/ic_material_done" - android:title="@string/room_settings_mute" /> - - - <item - android:id="@+id/ic_action_select_fav" - android:icon="@drawable/ic_material_done" - android:title="@string/room_settings_favourite" /> - - <item - android:id="@+id/ic_action_select_deprioritize" - android:icon="@drawable/ic_material_done" - android:title="@string/room_settings_de_prioritize" /> - - <item - android:id="@+id/ic_action_select_direct_chat" - android:icon="@drawable/ic_material_done" - android:title="@string/room_settings_direct_chat" /> - - <item - android:id="@+id/ic_action_select_remove" - android:icon="@drawable/ic_material_leave" - android:title="@string/room_settings_leave_conversation" /> - - </group> - - <group android:id="@+id/add_shortcut_actions"> - <item - android:id="@+id/ic_action_add_homescreen_shortcut" - android:icon="@drawable/ic_material_transparent" - android:title="@string/room_settings_add_homescreen_shortcut" /> - </group> - - <group android:id="@+id/historical_room_actions"> - <item - android:id="@+id/action_forget_room" - android:icon="@drawable/ic_material_leave" - android:title="@string/room_settings_forget" /> - </group> -</menu> \ No newline at end of file diff --git a/vector/src/main/res/menu/vector_medias_viewer.xml b/vector/src/main/res/menu/vector_medias_viewer.xml deleted file mode 100755 index c101946aae..0000000000 --- a/vector/src/main/res/menu/vector_medias_viewer.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - tools:context="org.matrix.vector.activity.RoomActivity"> - - <item - android:id="@+id/ic_action_share" - android:icon="@drawable/ic_share_white" - android:title="@string/share" - app:showAsAction="always" /> - - <item - android:id="@+id/ic_action_download" - android:icon="@drawable/ic_file_download_white" - android:title="@string/download" - app:showAsAction="always" /> -</menu> diff --git a/vector/src/main/res/menu/vector_room.xml b/vector/src/main/res/menu/vector_room.xml deleted file mode 100755 index bb84a3ff29..0000000000 --- a/vector/src/main/res/menu/vector_room.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - tools:context="org.matrix.vector.activity.RoomActivity"> - - <item - android:id="@+id/ic_action_search_in_room" - android:icon="@drawable/ic_material_search_white" - android:title="@string/room_menu_search" - app:showAsAction="always" /> - - <item - android:id="@+id/ic_action_matrix_apps" - android:icon="@drawable/apps_icon" - android:title="@string/room_add_matrix_apps" - app:showAsAction="collapseActionView" /> - - <item - android:id="@+id/ic_action_room_resend_unsent" - android:icon="@drawable/ic_material_send_black" - android:title="@string/room_resend_unsent_messages" - app:showAsAction="collapseActionView" /> - - <item - android:id="@+id/ic_action_room_delete_unsent" - android:icon="@drawable/ic_material_delete" - android:title="@string/room_delete_unsent_messages" - app:showAsAction="collapseActionView" /> - - <item - android:id="@+id/ic_action_room_settings" - android:icon="@drawable/ic_material_settings_small" - android:title="@string/room_details_title" - app:showAsAction="collapseActionView" /> - - <item - android:id="@+id/ic_action_room_leave" - android:icon="@drawable/vector_leave_room_black" - android:title="@string/leave" - app:showAsAction="collapseActionView" /> - -</menu> diff --git a/vector/src/main/res/menu/vector_room_details_add_people.xml b/vector/src/main/res/menu/vector_room_details_add_people.xml deleted file mode 100755 index 66414049e0..0000000000 --- a/vector/src/main/res/menu/vector_room_details_add_people.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - tools:context="org.matrix.vector.activity.RoomActivity"> - - <item - android:id="@+id/ic_action_room_details_delete" - android:icon="@drawable/ic_material_delete_white" - android:title="@string/delete" - app:showAsAction="always" /> - - <item - android:id="@+id/ic_action_room_details_edition_mode" - android:icon="@drawable/ic_material_create_white" - android:title="@string/delete" - app:showAsAction="always" /> -</menu> diff --git a/vector/src/main/res/menu/vector_room_settings_addresses.xml b/vector/src/main/res/menu/vector_room_settings_addresses.xml deleted file mode 100755 index bfa3b384da..0000000000 --- a/vector/src/main/res/menu/vector_room_settings_addresses.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto"> - - <item - android:id="@+id/ic_action_vector_set_as_main_address" - android:icon="@drawable/ic_material_star_black" - android:title="@string/room_settings_set_main_address" - app:showAsAction="never" /> - - <item - android:id="@+id/ic_action_vector_unset_main_address" - android:icon="@drawable/ic_material_star_border_black" - android:title="@string/room_settings_unset_main_address" - app:showAsAction="never" /> - - <item - android:id="@+id/ic_action_vector_copy_alias" - android:icon="@drawable/ic_material_copy" - android:title="@string/room_settings_copy_room_id" - app:showAsAction="never" /> - - <item - android:id="@+id/ic_action_vector_room_url" - android:icon="@drawable/ic_material_link_black" - android:title="@string/room_settings_copy_room_address" - app:showAsAction="never" /> - - <item - android:id="@+id/ic_action_vector_delete_alias" - android:icon="@drawable/ic_material_delete" - android:title="@string/delete" - app:showAsAction="never" /> -</menu> \ No newline at end of file diff --git a/vector/src/main/res/menu/vector_searches.xml b/vector/src/main/res/menu/vector_searches.xml deleted file mode 100755 index 542c433272..0000000000 --- a/vector/src/main/res/menu/vector_searches.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - tools:context="org.matrix.vector.activity.RoomActivity"> - - <item - android:id="@+id/ic_action_speak_to_search" - android:icon="@drawable/vector_micro_green" - android:title="@string/speak" - app:showAsAction="always" /> - - <item - android:id="@+id/ic_action_clear_search" - android:icon="@drawable/vector_clear_edittext_green" - android:title="@string/clear" - app:showAsAction="always" /> -</menu> diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index a3d449611b..6c56211e57 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -645,7 +645,7 @@ <string name="settings_troubleshoot_diagnostic">Troubleshooting diagnostics</string> <string name="settings_troubleshoot_diagnostic_run_button_title">Run Tests</string> <string name="settings_troubleshoot_diagnostic_running_status">Running… (%1$d of %2$d)</string> - <string name="settings_troubleshoot_diagnostic_success_status">Basic diagnostic is ok. If you still do not receive notifications, please submit a bug report to help us investigate.</string> + <string name="settings_troubleshoot_diagnostic_success_status">Basic diagnostic is OK. If you still do not receive notifications, please submit a bug report to help us investigate.</string> <string name="settings_troubleshoot_diagnostic_failure_status_with_quickfix">One or more tests have failed, try suggested fix(es).</string> <string name="settings_troubleshoot_diagnostic_failure_status_no_quickfix">One or more tests have failed, please submit a bug report to help us investigate.</string> diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index 620b2d866b..e842550dd1 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -33,7 +33,8 @@ <!-- BEGIN Strings added by Others --> - + <string name="command_description_plain">Sends a message as plain text, without interpreting it as markdown</string> <!-- END Strings added by Others --> + <string name="auth_invalid_login_param_space_in_password">Incorrect username and/or password. The entered password starts or ends with spaces, please check it.</string> </resources>