mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-23 06:08:52 +01:00
Merge branch 'master' into values-syntax
This commit is contained in:
@@ -143,6 +143,11 @@ public class RetryScheduler implements Observer {
|
|||||||
case PduHeaders.RESPONSE_STATUS_ERROR_PERMANENT_MESSAGE_NOT_FOUND:
|
case PduHeaders.RESPONSE_STATUS_ERROR_PERMANENT_MESSAGE_NOT_FOUND:
|
||||||
errorString = R.string.service_message_not_found;
|
errorString = R.string.service_message_not_found;
|
||||||
break;
|
break;
|
||||||
|
case PduHeaders.RESPONSE_STATUS_ERROR_CONTENT_NOT_ACCEPTED:
|
||||||
|
case PduHeaders.RESPONSE_STATUS_ERROR_PERMANENT_CONTENT_NOT_ACCEPTED:
|
||||||
|
errorString = R.string.service_message_content_not_accepted;
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (errorString != 0) {
|
if (errorString != 0) {
|
||||||
DownloadManager.init(mContext.getApplicationContext());
|
DownloadManager.init(mContext.getApplicationContext());
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ limitations under the License.
|
|||||||
<string name="invalid_destination">Invalid destination address.</string>
|
<string name="invalid_destination">Invalid destination address.</string>
|
||||||
<string name="service_not_activated">Service not activated on network.</string>
|
<string name="service_not_activated">Service not activated on network.</string>
|
||||||
<string name="service_message_not_found">Message expired or not available.</string>
|
<string name="service_message_not_found">Message expired or not available.</string>
|
||||||
|
<string name="service_message_content_not_accepted">Message content is not accepted.</string>
|
||||||
<string name="service_network_problem">Couldn\'t send due to network problem.</string>
|
<string name="service_network_problem">Couldn\'t send due to network problem.</string>
|
||||||
<string name="message_queued">Currently can\'t send your message. It will be sent when the service becomes available.</string>
|
<string name="message_queued">Currently can\'t send your message. It will be sent when the service becomes available.</string>
|
||||||
<string name="download_later">Can\'t download right now. Try again later.</string>
|
<string name="download_later">Can\'t download right now. Try again later.</string>
|
||||||
|
|||||||
@@ -19,4 +19,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -1,5 +1,36 @@
|
|||||||
|
|
||||||
[ {
|
[
|
||||||
|
{
|
||||||
|
"versionCode": 2226,
|
||||||
|
"versionName": "4.0.9",
|
||||||
|
"added": [
|
||||||
|
"Basic speech to text for compose (and qkreply)",
|
||||||
|
"Text to speech",
|
||||||
|
"Add 'super' font size setting",
|
||||||
|
"Basic speech to text for compose (and qkreply) take 2",
|
||||||
|
"Make unread conversations float at the top of conversation lists",
|
||||||
|
"Select and copy a text part",
|
||||||
|
"Add 'super' font size setting - take 2",
|
||||||
|
"Main widget launch appropriate app activities",
|
||||||
|
"Change convo name from main convo activity",
|
||||||
|
"Play audio attachments",
|
||||||
|
"Select all on conversations and compose screens. New compose 'show status' option",
|
||||||
|
"Build on pull request",
|
||||||
|
"Update French translation",
|
||||||
|
"Changes to allow attaching *any* type of file",
|
||||||
|
"Update French translation"
|
||||||
|
],
|
||||||
|
"fixed": [
|
||||||
|
"Bug fix for motion events being used after recycled",
|
||||||
|
"Disable reply ability to non-replyable messages/conversations",
|
||||||
|
"Sort blocked messages by lastmessage.date desc",
|
||||||
|
"Fix fr strings from pr 226. Fixes build",
|
||||||
|
"Fix pr 225 render issue",
|
||||||
|
"Fix unblock number bug",
|
||||||
|
"Silent notifications if no recipients are a contact"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
"versionCode": 2225,
|
"versionCode": 2225,
|
||||||
"versionName": "4.0.8",
|
"versionName": "4.0.8",
|
||||||
"fixed": [
|
"fixed": [
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
|
||||||
|
*
|
||||||
|
* This file is part of QKSMS.
|
||||||
|
*
|
||||||
|
* QKSMS is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* QKSMS is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package dev.octoshrimpy.quik.extensions
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.net.Uri
|
||||||
|
|
||||||
|
fun Uri.resourceExists(context: Context): Boolean {
|
||||||
|
// check if resource at uri still exists
|
||||||
|
try {
|
||||||
|
return context.contentResolver.query(
|
||||||
|
this, null, null, null, null
|
||||||
|
)?.use {
|
||||||
|
it.moveToFirst()
|
||||||
|
} ?: false
|
||||||
|
}
|
||||||
|
catch (e: Exception) { /* nothing */ }
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
@@ -82,6 +82,15 @@ class ContactRepositoryImpl @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun getUnmanagedAllContacts(): List<Contact> {
|
||||||
|
val realm = Realm.getDefaultInstance()
|
||||||
|
|
||||||
|
return realm
|
||||||
|
.where(Contact::class.java)
|
||||||
|
.findAll()
|
||||||
|
.map { realm.copyFromRealm(it) }
|
||||||
|
}
|
||||||
|
|
||||||
override fun getUnmanagedContacts(starred: Boolean): Observable<List<Contact>> {
|
override fun getUnmanagedContacts(starred: Boolean): Observable<List<Contact>> {
|
||||||
val realm = Realm.getDefaultInstance()
|
val realm = Realm.getDefaultInstance()
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import android.content.ContentValues
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.BitmapFactory
|
import android.graphics.BitmapFactory
|
||||||
import android.media.MediaScannerConnection
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Environment
|
import android.os.Environment
|
||||||
@@ -65,14 +64,7 @@ import io.realm.Case
|
|||||||
import io.realm.Realm
|
import io.realm.Realm
|
||||||
import io.realm.RealmResults
|
import io.realm.RealmResults
|
||||||
import io.realm.Sort
|
import io.realm.Sort
|
||||||
import okio.buffer
|
|
||||||
import okio.source
|
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.io.File
|
|
||||||
import java.io.FileNotFoundException
|
|
||||||
import java.io.FileOutputStream
|
|
||||||
import java.io.IOException
|
|
||||||
import java.util.*
|
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
@@ -189,9 +181,9 @@ class MessageRepositoryImpl @Inject constructor(
|
|||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
values.put(MediaStore.MediaColumns.IS_PENDING, 1)
|
values.put(MediaStore.MediaColumns.IS_PENDING, 1)
|
||||||
values.put(MediaStore.MediaColumns.RELATIVE_PATH, when {
|
values.put(MediaStore.MediaColumns.RELATIVE_PATH, when {
|
||||||
part.isImage() -> "${Environment.DIRECTORY_PICTURES}/QKSMS"
|
part.isImage() -> "${Environment.DIRECTORY_PICTURES}/QUIK"
|
||||||
part.isVideo() -> "${Environment.DIRECTORY_MOVIES}/QKSMS"
|
part.isVideo() -> "${Environment.DIRECTORY_MOVIES}/QUIK"
|
||||||
else -> "${Environment.DIRECTORY_DOWNLOADS}/QKSMS"
|
else -> "${Environment.DIRECTORY_DOWNLOADS}/QUIK"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,27 +368,37 @@ class MessageRepositoryImpl @Inject constructor(
|
|||||||
parts += MMSPart("text", ContentType.TEXT_PLAIN, bytes)
|
parts += MMSPart("text", ContentType.TEXT_PLAIN, bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attach contacts
|
// Attach those that can't be compressed (ie. everything but not images)
|
||||||
parts += attachments
|
parts += attachments
|
||||||
.mapNotNull { attachment -> attachment as? Attachment.Contact }
|
// filter out images
|
||||||
.map { attachment -> attachment.vCard.toByteArray() }
|
.filter { !it.isImage(context) }
|
||||||
.map { vCard ->
|
// filter out items that have no data available (ie user may have deleted
|
||||||
remainingBytes -= vCard.size
|
// the file from storage)
|
||||||
MMSPart("contact", ContentType.TEXT_VCARD, vCard)
|
.filter { it.getResourceBytes(context).isNotEmpty() }
|
||||||
}
|
.map {
|
||||||
|
remainingBytes -= it.getResourceBytes(context).size
|
||||||
|
MMSPart(
|
||||||
|
it.getName(context),
|
||||||
|
it.getType(context),
|
||||||
|
it.getResourceBytes(context)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
val imageBytesByAttachment = attachments
|
val imageBytesByAttachment = attachments
|
||||||
.mapNotNull { attachment -> attachment as? Attachment.Image }
|
// filter out non-images
|
||||||
.associateWith { attachment ->
|
.filter { it.isImage(context) }
|
||||||
val uri = attachment.getUri() ?: return@associateWith byteArrayOf()
|
// filter out items that have no data available (ie user may have deleted
|
||||||
when (attachment.isGif(context)) {
|
// the file from storage)
|
||||||
true -> ImageUtils.getScaledGif(context, uri, maxWidth, maxHeight)
|
.filter { it.getResourceBytes(context).isNotEmpty() }
|
||||||
false -> ImageUtils.getScaledImage(context, uri, maxWidth, maxHeight)
|
.associateWith {
|
||||||
}
|
when (it.getType(context) == "image/gif") {
|
||||||
|
true -> ImageUtils.getScaledGif(context, it.getUri(), maxWidth, maxHeight)
|
||||||
|
false -> ImageUtils.getScaledImage(context, it.getUri(), maxWidth, maxHeight)
|
||||||
}
|
}
|
||||||
.toMutableMap()
|
}
|
||||||
|
.toMutableMap()
|
||||||
|
|
||||||
val imageByteCount = imageBytesByAttachment.values.sumBy { byteArray -> byteArray.size }
|
val imageByteCount = imageBytesByAttachment.values.sumOf { it.size }
|
||||||
if (imageByteCount > remainingBytes) {
|
if (imageByteCount > remainingBytes) {
|
||||||
imageBytesByAttachment.forEach { (attachment, originalBytes) ->
|
imageBytesByAttachment.forEach { (attachment, originalBytes) ->
|
||||||
val uri = attachment.getUri() ?: return@forEach
|
val uri = attachment.getUri() ?: return@forEach
|
||||||
@@ -426,9 +428,9 @@ class MessageRepositoryImpl @Inject constructor(
|
|||||||
val newHeight = (newWidth / aspectRatio).toInt()
|
val newHeight = (newWidth / aspectRatio).toInt()
|
||||||
|
|
||||||
attempts++
|
attempts++
|
||||||
scaledBytes = when (attachment.isGif(context)) {
|
scaledBytes = when (attachment.getType(context) == "image/gif") {
|
||||||
true -> ImageUtils.getScaledGif(context, uri, newWidth, newHeight, 80)
|
true -> ImageUtils.getScaledGif(context, attachment.getUri(), newWidth, newHeight)
|
||||||
false -> ImageUtils.getScaledImage(context, uri, newWidth, newHeight, 80)
|
false -> ImageUtils.getScaledImage(context, attachment.getUri(), newWidth, newHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("Compression attempt $attempts: ${scaledBytes.size / 1024}/${maxBytes.toInt() / 1024}Kb ($width*$height -> $newWidth*$newHeight)")
|
Timber.d("Compression attempt $attempts: ${scaledBytes.size / 1024}/${maxBytes.toInt() / 1024}Kb ($width*$height -> $newWidth*$newHeight)")
|
||||||
@@ -440,7 +442,7 @@ class MessageRepositoryImpl @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
imageBytesByAttachment.forEach { (attachment, bytes) ->
|
imageBytesByAttachment.forEach { (attachment, bytes) ->
|
||||||
parts += when (attachment.isGif(context)) {
|
parts += when (attachment.getType(context) == "image/gif") {
|
||||||
true -> MMSPart("image", ContentType.IMAGE_GIF, bytes)
|
true -> MMSPart("image", ContentType.IMAGE_GIF, bytes)
|
||||||
false -> MMSPart("image", ContentType.IMAGE_JPEG, bytes)
|
false -> MMSPart("image", ContentType.IMAGE_JPEG, bytes)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class SendScheduledMessage @Inject constructor(
|
|||||||
}
|
}
|
||||||
.map { message ->
|
.map { message ->
|
||||||
val threadId = TelephonyCompat.getOrCreateThreadId(context, message.recipients)
|
val threadId = TelephonyCompat.getOrCreateThreadId(context, message.recipients)
|
||||||
val attachments = message.attachments.mapNotNull(Uri::parse).map { Attachment.Image(it) }
|
val attachments = message.attachments.mapNotNull(Uri::parse).map { Attachment(it) }
|
||||||
SendMessage.Params(message.subId, threadId, message.recipients, message.body, attachments)
|
SendMessage.Params(message.subId, threadId, message.recipients, message.body, attachments)
|
||||||
}
|
}
|
||||||
.flatMap(sendMessage::buildObservable)
|
.flatMap(sendMessage::buildObservable)
|
||||||
|
|||||||
@@ -21,33 +21,106 @@ package dev.octoshrimpy.quik.model
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
import android.provider.OpenableColumns
|
||||||
import androidx.core.view.inputmethod.InputContentInfoCompat
|
import androidx.core.view.inputmethod.InputContentInfoCompat
|
||||||
|
|
||||||
sealed class Attachment {
|
|
||||||
|
|
||||||
data class Image(
|
class Attachment(
|
||||||
private val uri: Uri? = null,
|
private val uri: Uri? = null,
|
||||||
private val inputContent: InputContentInfoCompat? = null
|
private val inputContent: InputContentInfoCompat? = null
|
||||||
) : Attachment() {
|
) {
|
||||||
|
private var resourceBytes: ByteArray? = null
|
||||||
|
|
||||||
fun getUri(): Uri? {
|
fun getUri(): Uri {
|
||||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
return (
|
||||||
inputContent?.contentUri ?: uri
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1)
|
||||||
} else {
|
inputContent?.contentUri ?: uri ?: Uri.EMPTY
|
||||||
uri
|
else uri ?: Uri.EMPTY
|
||||||
}
|
)
|
||||||
}
|
|
||||||
|
|
||||||
fun isGif(context: Context): Boolean {
|
|
||||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1 && inputContent != null) {
|
|
||||||
inputContent.description.hasMimeType("image/gif")
|
|
||||||
} else {
|
|
||||||
uri?.let(context.contentResolver::getType) == "image/gif"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data class Contact(val vCard: String) : Attachment()
|
fun getType(context: Context): String {
|
||||||
|
return context.contentResolver.getType(getUri()) ?: "application/octect-stream"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getName(context: Context): String {
|
||||||
|
try {
|
||||||
|
context.contentResolver.query(
|
||||||
|
getUri(),
|
||||||
|
arrayOf(OpenableColumns.DISPLAY_NAME),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
)
|
||||||
|
?.use { cursor ->
|
||||||
|
val nameIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)
|
||||||
|
if (nameIndex == -1)
|
||||||
|
return "unknown"
|
||||||
|
cursor.moveToFirst()
|
||||||
|
return cursor.getString(nameIndex) ?: "unknown"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e: Exception) { /* nothing*/ }
|
||||||
|
|
||||||
|
return "unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun isVCard(context: Context): Boolean {
|
||||||
|
return (getType(context) == "text/x-vcard")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun hasDisplayableImage(context: Context): Boolean {
|
||||||
|
val mimeType = getType(context)
|
||||||
|
return (mimeType.startsWith("image/") || mimeType.startsWith("video/"))
|
||||||
|
}
|
||||||
|
|
||||||
|
fun isAudio(context: Context): Boolean {
|
||||||
|
val mimeType = getType(context)
|
||||||
|
return (mimeType.startsWith("audio/"))
|
||||||
|
}
|
||||||
|
|
||||||
|
fun isImage(context: Context): Boolean {
|
||||||
|
val mimeType = getType(context)
|
||||||
|
return (mimeType.startsWith("image/"))
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getSize(context: Context): Long {
|
||||||
|
try {
|
||||||
|
context.contentResolver.query(
|
||||||
|
getUri(),
|
||||||
|
arrayOf(OpenableColumns.SIZE),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
)
|
||||||
|
?.use {
|
||||||
|
val sizeIndex = it.getColumnIndex(OpenableColumns.SIZE)
|
||||||
|
if (sizeIndex == -1)
|
||||||
|
return -1
|
||||||
|
it.moveToFirst()
|
||||||
|
return it.getLong(sizeIndex)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e: Exception) { /* nothing */ }
|
||||||
|
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getResourceBytes(context: Context): ByteArray {
|
||||||
|
if (resourceBytes != null)
|
||||||
|
return resourceBytes!!
|
||||||
|
|
||||||
|
resourceBytes = ByteArray(0)
|
||||||
|
|
||||||
|
try {
|
||||||
|
context.contentResolver.openInputStream(getUri())?.use {
|
||||||
|
resourceBytes = it.readBytes()
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return resourceBytes!!
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,11 +40,13 @@ open class MmsPart : RealmObject() {
|
|||||||
fun getUri() = "content://mms/part/$id".toUri()
|
fun getUri() = "content://mms/part/$id".toUri()
|
||||||
|
|
||||||
fun getSummary(): String? = when {
|
fun getSummary(): String? = when {
|
||||||
|
type == "application/smil" -> null
|
||||||
type == "text/plain" -> text
|
type == "text/plain" -> text
|
||||||
type == "text/x-vCard" -> "Contact card"
|
type == "text/x-vcard" -> "Contact card"
|
||||||
type.startsWith("image") -> "Photo"
|
type.startsWith("image") -> "Photo"
|
||||||
type.startsWith("video") -> "Video"
|
type.startsWith("video") -> "Video"
|
||||||
else -> null
|
type.startsWith("audio") -> "Audio"
|
||||||
|
else -> type.substring(type.indexOf('/') + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,8 @@ interface ContactRepository {
|
|||||||
|
|
||||||
fun getUnmanagedContact(lookupKey: String): Contact?
|
fun getUnmanagedContact(lookupKey: String): Contact?
|
||||||
|
|
||||||
|
fun getUnmanagedAllContacts(): List<Contact>
|
||||||
|
|
||||||
fun getUnmanagedContacts(starred: Boolean = false): Observable<List<Contact>>
|
fun getUnmanagedContacts(starred: Boolean = false): Observable<List<Contact>>
|
||||||
|
|
||||||
fun getUnmanagedContactGroups(): Observable<List<ContactGroup>>
|
fun getUnmanagedContactGroups(): Observable<List<ContactGroup>>
|
||||||
|
|||||||
@@ -80,6 +80,10 @@ class Preferences @Inject constructor(
|
|||||||
const val BLOCKING_MANAGER_CC = 1
|
const val BLOCKING_MANAGER_CC = 1
|
||||||
const val BLOCKING_MANAGER_SIA = 2
|
const val BLOCKING_MANAGER_SIA = 2
|
||||||
const val BLOCKING_MANAGER_CB = 3
|
const val BLOCKING_MANAGER_CB = 3
|
||||||
|
|
||||||
|
const val MESSAGE_LINK_HANDLING_BLOCK = 0
|
||||||
|
const val MESSAGE_LINK_HANDLING_ALLOW = 1
|
||||||
|
const val MESSAGE_LINK_HANDLING_ASK = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
// Internal
|
// Internal
|
||||||
@@ -107,6 +111,7 @@ class Preferences @Inject constructor(
|
|||||||
val textSize = rxPrefs.getInteger("textSize", TEXT_SIZE_NORMAL)
|
val textSize = rxPrefs.getInteger("textSize", TEXT_SIZE_NORMAL)
|
||||||
val blockingManager = rxPrefs.getInteger("blockingManager", BLOCKING_MANAGER_QKSMS)
|
val blockingManager = rxPrefs.getInteger("blockingManager", BLOCKING_MANAGER_QKSMS)
|
||||||
val drop = rxPrefs.getBoolean("drop", false)
|
val drop = rxPrefs.getBoolean("drop", false)
|
||||||
|
val silentNotContact = rxPrefs.getBoolean("silentNotContact", false)
|
||||||
val notifAction1 = rxPrefs.getInteger("notifAction1", NOTIFICATION_ACTION_READ)
|
val notifAction1 = rxPrefs.getInteger("notifAction1", NOTIFICATION_ACTION_READ)
|
||||||
val notifAction2 = rxPrefs.getInteger("notifAction2", NOTIFICATION_ACTION_REPLY)
|
val notifAction2 = rxPrefs.getInteger("notifAction2", NOTIFICATION_ACTION_REPLY)
|
||||||
val notifAction3 = rxPrefs.getInteger("notifAction3", NOTIFICATION_ACTION_NONE)
|
val notifAction3 = rxPrefs.getInteger("notifAction3", NOTIFICATION_ACTION_NONE)
|
||||||
@@ -123,6 +128,7 @@ class Preferences @Inject constructor(
|
|||||||
val autoDelete = rxPrefs.getInteger("autoDelete", 0)
|
val autoDelete = rxPrefs.getInteger("autoDelete", 0)
|
||||||
val longAsMms = rxPrefs.getBoolean("longAsMms", false)
|
val longAsMms = rxPrefs.getBoolean("longAsMms", false)
|
||||||
val mmsSize = rxPrefs.getInteger("mmsSize", 300)
|
val mmsSize = rxPrefs.getInteger("mmsSize", 300)
|
||||||
|
val messageLinkHandling = rxPrefs.getInteger("messageLinkHandling", MESSAGE_LINK_HANDLING_ASK)
|
||||||
val logging = rxPrefs.getBoolean("logging", false)
|
val logging = rxPrefs.getBoolean("logging", false)
|
||||||
val unreadAtTop = rxPrefs.getBoolean("unreadAtTop", false)
|
val unreadAtTop = rxPrefs.getBoolean("unreadAtTop", false)
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Remplacement open source de l'application SMS d'origine d'Android. Renaissance de QKSMS.
|
Remplacement open source de l'appli SMS Android. Renaissance de QKSMS.
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ android {
|
|||||||
applicationId 'dev.octoshrimpy.quik'
|
applicationId 'dev.octoshrimpy.quik'
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode 2225
|
versionCode 2226
|
||||||
versionName '4.0.8'
|
versionName '4.0.9'
|
||||||
setProperty("archivesBaseName", "QUIK-v${versionName}")
|
setProperty("archivesBaseName", "QUIK-v${versionName}")
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
setProperty("archivesBaseName", "QUIK-v${versionName}")
|
setProperty("archivesBaseName", "QUIK-v${versionName}")
|
||||||
versionNameSuffix '-alpha'
|
versionNameSuffix '-beta'
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".common.QKApplication"
|
android:name=".common.QKApplication"
|
||||||
@@ -88,22 +89,12 @@
|
|||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.SEND" />
|
<action android:name="android.intent.action.SEND" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<data android:mimeType="text/plain" />
|
<data android:mimeType="*/*" />
|
||||||
</intent-filter>
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.SEND" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<data android:mimeType="image/*" />
|
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
<action android:name="android.intent.action.SEND_MULTIPLE" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<data android:mimeType="image/*" />
|
<data android:mimeType="*/*" />
|
||||||
</intent-filter>
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.SEND" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<data android:mimeType="text/x-vcard" />
|
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
|
|||||||
@@ -95,12 +95,13 @@ class Navigator @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun showCompose(body: String? = null, images: List<Uri>? = null) {
|
fun showCompose(body: String? = null, attachments: List<Uri>? = null, mode: String? = null) {
|
||||||
val intent = Intent(context, ComposeActivity::class.java)
|
val intent = Intent(context, ComposeActivity::class.java)
|
||||||
intent.putExtra(Intent.EXTRA_TEXT, body)
|
intent.putExtra(Intent.EXTRA_TEXT, body)
|
||||||
|
intent.putExtra("mode", mode)
|
||||||
|
|
||||||
images?.takeIf { it.isNotEmpty() }?.let {
|
attachments?.takeIf { it.isNotEmpty() }?.let {
|
||||||
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, ArrayList(images))
|
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, ArrayList(attachments))
|
||||||
}
|
}
|
||||||
|
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ object QkMediaPlayer : MediaPlayer() {
|
|||||||
private var onCompletionListener: OnCompletionListener? = null
|
private var onCompletionListener: OnCompletionListener? = null
|
||||||
|
|
||||||
enum class PlayingState {
|
enum class PlayingState {
|
||||||
|
None,
|
||||||
Stopped,
|
Stopped,
|
||||||
Playing,
|
Playing,
|
||||||
Paused
|
Paused
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ import dev.octoshrimpy.quik.receiver.MarkReadReceiver
|
|||||||
import dev.octoshrimpy.quik.receiver.MarkSeenReceiver
|
import dev.octoshrimpy.quik.receiver.MarkSeenReceiver
|
||||||
import dev.octoshrimpy.quik.receiver.RemoteMessagingReceiver
|
import dev.octoshrimpy.quik.receiver.RemoteMessagingReceiver
|
||||||
import dev.octoshrimpy.quik.receiver.SpeakThreadsReceiver
|
import dev.octoshrimpy.quik.receiver.SpeakThreadsReceiver
|
||||||
|
import dev.octoshrimpy.quik.repository.ContactRepository
|
||||||
import dev.octoshrimpy.quik.repository.ConversationRepository
|
import dev.octoshrimpy.quik.repository.ConversationRepository
|
||||||
import dev.octoshrimpy.quik.repository.MessageRepository
|
import dev.octoshrimpy.quik.repository.MessageRepository
|
||||||
import dev.octoshrimpy.quik.util.GlideApp
|
import dev.octoshrimpy.quik.util.GlideApp
|
||||||
@@ -70,7 +71,8 @@ class NotificationManagerImpl @Inject constructor(
|
|||||||
private val prefs: Preferences,
|
private val prefs: Preferences,
|
||||||
private val messageRepo: MessageRepository,
|
private val messageRepo: MessageRepository,
|
||||||
private val permissions: PermissionManager,
|
private val permissions: PermissionManager,
|
||||||
private val phoneNumberUtils: PhoneNumberUtils
|
private val phoneNumberUtils: PhoneNumberUtils,
|
||||||
|
private val contactRepo: ContactRepository,
|
||||||
) : dev.octoshrimpy.quik.manager.NotificationManager {
|
) : dev.octoshrimpy.quik.manager.NotificationManager {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@@ -145,12 +147,28 @@ class NotificationManagerImpl @Inject constructor(
|
|||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
.setContentIntent(contentPI)
|
.setContentIntent(contentPI)
|
||||||
.setDeleteIntent(seenPI)
|
.setDeleteIntent(seenPI)
|
||||||
.setSound(ringtone)
|
|
||||||
.setLights(Color.WHITE, 500, 2000)
|
.setLights(Color.WHITE, 500, 2000)
|
||||||
.setWhen(conversation.lastMessage?.date ?: System.currentTimeMillis())
|
.setWhen(conversation.lastMessage?.date ?: System.currentTimeMillis())
|
||||||
.setVibrate(if (prefs.vibration(threadId).get()) VIBRATE_PATTERN else longArrayOf(0))
|
.setVibrate(if (prefs.vibration(threadId).get()) VIBRATE_PATTERN else longArrayOf(0))
|
||||||
|
|
||||||
// Tell the notification if it's a group message
|
// if preference set to silence notifications if no recipients in contacts
|
||||||
|
if (prefs.silentNotContact.get() && run {
|
||||||
|
val msgRecipientNumbers = conversation.recipients.map { it.address }
|
||||||
|
|
||||||
|
// true if any message recipients are in device's contacts
|
||||||
|
!contactRepo
|
||||||
|
.getUnmanagedAllContacts()
|
||||||
|
.flatMap { it.numbers }
|
||||||
|
.map { it.address }
|
||||||
|
.any { contactNumber ->
|
||||||
|
msgRecipientNumbers.any { phoneNumberUtils.compare(contactNumber, it) }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
notification.setSilent(true)
|
||||||
|
else
|
||||||
|
notification.setSound(ringtone)
|
||||||
|
|
||||||
|
// Tell the notification if it's a group message
|
||||||
val messagingStyle = NotificationCompat.MessagingStyle("Me")
|
val messagingStyle = NotificationCompat.MessagingStyle("Me")
|
||||||
if (conversation.recipients.size >= 2) {
|
if (conversation.recipients.size >= 2) {
|
||||||
messagingStyle.isGroupConversation = true
|
messagingStyle.isGroupConversation = true
|
||||||
@@ -188,6 +206,12 @@ class NotificationManagerImpl @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove system generated contextual actions (they're generated from message links) unless
|
||||||
|
// the user has explicitly set to allow message links
|
||||||
|
notification.setAllowSystemGeneratedContextualActions(
|
||||||
|
(prefs.messageLinkHandling.get() == Preferences.MESSAGE_LINK_HANDLING_ALLOW)
|
||||||
|
)
|
||||||
|
|
||||||
// Set the large icon
|
// Set the large icon
|
||||||
val avatar = conversation.recipients.takeIf { it.size == 1 }
|
val avatar = conversation.recipients.takeIf { it.size == 1 }
|
||||||
?.first()?.contact?.photoUri
|
?.first()?.contact?.photoUri
|
||||||
|
|||||||
+70
-49
@@ -53,20 +53,29 @@ fun EditText.hideKeyboard() {
|
|||||||
imm.hideSoftInputFromWindow(windowToken, 0)
|
imm.hideSoftInputFromWindow(windowToken, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ImageView.setTint(color: Int) {
|
fun ImageView.setTint(color: Int?) {
|
||||||
imageTintList = ColorStateList.valueOf(color)
|
imageTintList =
|
||||||
|
if (color == null) null
|
||||||
|
else ColorStateList.valueOf(color)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ProgressBar.setTint(color: Int) {
|
fun ProgressBar.setTint(color: Int?) {
|
||||||
indeterminateTintList = ColorStateList.valueOf(color)
|
indeterminateTintList =
|
||||||
progressTintList = ColorStateList.valueOf(color)
|
if (color == null) null
|
||||||
|
else ColorStateList.valueOf(color)
|
||||||
|
progressTintList =
|
||||||
|
if (color == null) null
|
||||||
|
else ColorStateList.valueOf(color)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun View.setBackgroundTint(color: Int) {
|
fun View.setBackgroundTint(color: Int?) {
|
||||||
|
|
||||||
// API 21 doesn't support this
|
// API 21 doesn't support this
|
||||||
|
|
||||||
backgroundTintList = ColorStateList.valueOf(color)
|
backgroundTintList =
|
||||||
|
if (color == null) null
|
||||||
|
else ColorStateList.valueOf(color)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun View.setPadding(left: Int? = null, top: Int? = null, right: Int? = null, bottom: Int? = null) {
|
fun View.setPadding(left: Int? = null, top: Int? = null, right: Int? = null, bottom: Int? = null) {
|
||||||
@@ -83,55 +92,67 @@ fun View.setVisible(visible: Boolean, invisible: Int = View.GONE) {
|
|||||||
* the view no longer work. Also problematic when we try to long press on an image in the message
|
* the view no longer work. Also problematic when we try to long press on an image in the message
|
||||||
* view
|
* view
|
||||||
*/
|
*/
|
||||||
fun View.forwardTouches(parent: View) {
|
|
||||||
var isLongClick = false
|
class CancelableSimpleOnGestureListener(view: View, parentView: View) : SimpleOnGestureListener() {
|
||||||
var textInitiallySelectable = false
|
private var lastUpEvent: MotionEvent? = null
|
||||||
if (this@forwardTouches is TextView)
|
private val parent = parentView
|
||||||
textInitiallySelectable = this@forwardTouches.isTextSelectable
|
private val thisView = view
|
||||||
|
private var textInitiallySelectable = false
|
||||||
|
|
||||||
|
init {
|
||||||
|
if (thisView is TextView)
|
||||||
|
textInitiallySelectable = thisView.isTextSelectable
|
||||||
|
}
|
||||||
|
|
||||||
|
fun cancelCurrentClick() {
|
||||||
|
lastUpEvent?.recycle()
|
||||||
|
lastUpEvent = null
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSingleTapConfirmed(e: MotionEvent): Boolean {
|
||||||
|
if (lastUpEvent !== null) {
|
||||||
|
parent.onTouchEvent(e)
|
||||||
|
parent.onTouchEvent(lastUpEvent)
|
||||||
|
lastUpEvent?.recycle()
|
||||||
|
lastUpEvent = null
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSingleTapUp(e: MotionEvent): Boolean {
|
||||||
|
lastUpEvent = MotionEvent.obtain(e)
|
||||||
|
thisView.onTouchEvent(e)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDown(e: MotionEvent): Boolean {
|
||||||
|
thisView.onTouchEvent(e)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onLongPress(e: MotionEvent) {
|
||||||
|
parent.onTouchEvent(e)
|
||||||
|
// this is kinda odd but we have to 'bounce' the text selectable value so it doesn't
|
||||||
|
// start selecting text on a long press, but will start selecting it on the next double-tap
|
||||||
|
if (thisView is TextView) {
|
||||||
|
thisView.setTextIsSelectable(false)
|
||||||
|
thisView.setTextIsSelectable(textInitiallySelectable)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun View.forwardTouches(parent: View): CancelableSimpleOnGestureListener {
|
||||||
|
val gestureListener = CancelableSimpleOnGestureListener(this, parent)
|
||||||
|
|
||||||
setOnTouchListener(object : OnTouchListener {
|
setOnTouchListener(object : OnTouchListener {
|
||||||
private val gestureDetector =
|
val gestureDetector = GestureDetector(parent.context, gestureListener)
|
||||||
GestureDetector(parent.context, object : SimpleOnGestureListener() {
|
|
||||||
private var lastUpEvent: MotionEvent? = null
|
|
||||||
|
|
||||||
override fun onSingleTapConfirmed(e: MotionEvent): Boolean {
|
|
||||||
parent.onTouchEvent(e)
|
|
||||||
if (lastUpEvent !== null) {
|
|
||||||
parent.onTouchEvent(lastUpEvent)
|
|
||||||
lastUpEvent?.recycle()
|
|
||||||
lastUpEvent = null
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onSingleTapUp(e: MotionEvent): Boolean {
|
|
||||||
onTouchEvent(e)
|
|
||||||
lastUpEvent = MotionEvent.obtain(e)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDown(e: MotionEvent): Boolean {
|
|
||||||
isLongClick = false
|
|
||||||
onTouchEvent(e)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onLongPress(e: MotionEvent) {
|
|
||||||
parent.onTouchEvent(e)
|
|
||||||
isLongClick = true
|
|
||||||
// this is kinda odd but we have to 'bounce' the text selectable value so it doesn't
|
|
||||||
// start selecting text on a long press, but will start selecting it on the next double-tap
|
|
||||||
if (this@forwardTouches is TextView) {
|
|
||||||
(this@forwardTouches as TextView).setTextIsSelectable(false)
|
|
||||||
(this@forwardTouches as TextView).setTextIsSelectable(textInitiallySelectable)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
override fun onTouch(v: View, e: MotionEvent): Boolean {
|
override fun onTouch(v: View, e: MotionEvent): Boolean {
|
||||||
return gestureDetector.onTouchEvent(e)
|
return gestureDetector.onTouchEvent(e)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return gestureListener
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ViewPager.addOnPageChangeListener(listener: (Int) -> Unit) {
|
fun ViewPager.addOnPageChangeListener(listener: (Int) -> Unit) {
|
||||||
|
|||||||
+16
-14
@@ -39,24 +39,26 @@ class BlockedNumbersPresenter @Inject constructor(
|
|||||||
super.bindIntents(view)
|
super.bindIntents(view)
|
||||||
|
|
||||||
view.unblockAddress()
|
view.unblockAddress()
|
||||||
.doOnNext { id ->
|
.observeOn(Schedulers.io())
|
||||||
blockingRepo.getBlockedNumber(id)?.address
|
.doOnNext { id ->
|
||||||
?.let(conversationRepo::getThreadId)
|
blockingRepo.getBlockedNumber(id)?.address
|
||||||
?.let { threadId -> markUnblocked.execute(listOf(threadId)) }
|
?.let(conversationRepo::getThreadId)
|
||||||
}
|
?.let { threadId -> markUnblocked.execute(listOf(threadId)) }
|
||||||
.doOnNext(blockingRepo::unblockNumber)
|
}
|
||||||
.subscribeOn(Schedulers.io())
|
.doOnNext(blockingRepo::unblockNumber)
|
||||||
.autoDisposable(view.scope())
|
.subscribeOn(Schedulers.io())
|
||||||
.subscribe()
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe()
|
||||||
|
|
||||||
view.addAddress()
|
view.addAddress()
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
.subscribe { view.showAddDialog() }
|
.subscribe { view.showAddDialog() }
|
||||||
|
|
||||||
view.saveAddress()
|
view.saveAddress()
|
||||||
.subscribeOn(Schedulers.io())
|
.observeOn(Schedulers.io())
|
||||||
.autoDisposable(view.scope())
|
.subscribeOn(Schedulers.io())
|
||||||
.subscribe { address -> blockingRepo.blockNumber(address) }
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe { address -> blockingRepo.blockNumber(address) }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,11 @@
|
|||||||
package dev.octoshrimpy.quik.feature.compose
|
package dev.octoshrimpy.quik.feature.compose
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.media.MediaMetadataRetriever
|
||||||
|
import android.provider.MediaStore.MATCH_DEFAULT
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
@@ -27,25 +31,22 @@ import dev.octoshrimpy.quik.R
|
|||||||
import dev.octoshrimpy.quik.common.base.QkAdapter
|
import dev.octoshrimpy.quik.common.base.QkAdapter
|
||||||
import dev.octoshrimpy.quik.common.base.QkViewHolder
|
import dev.octoshrimpy.quik.common.base.QkViewHolder
|
||||||
import dev.octoshrimpy.quik.common.util.extensions.getDisplayName
|
import dev.octoshrimpy.quik.common.util.extensions.getDisplayName
|
||||||
import dev.octoshrimpy.quik.extensions.mapNotNull
|
import dev.octoshrimpy.quik.extensions.resourceExists
|
||||||
import dev.octoshrimpy.quik.model.Attachment
|
import dev.octoshrimpy.quik.model.Attachment
|
||||||
import ezvcard.Ezvcard
|
import ezvcard.Ezvcard
|
||||||
import io.reactivex.Observable
|
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
|
||||||
import io.reactivex.schedulers.Schedulers
|
|
||||||
import io.reactivex.subjects.PublishSubject
|
import io.reactivex.subjects.PublishSubject
|
||||||
import io.reactivex.subjects.Subject
|
import io.reactivex.subjects.Subject
|
||||||
|
import kotlinx.android.synthetic.main.attachment_file_list_item.*
|
||||||
import kotlinx.android.synthetic.main.attachment_contact_list_item.*
|
import kotlinx.android.synthetic.main.attachment_contact_list_item.*
|
||||||
import kotlinx.android.synthetic.main.attachment_image_list_item.*
|
|
||||||
import kotlinx.android.synthetic.main.attachment_image_list_item.view.*
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
|
||||||
class AttachmentAdapter @Inject constructor(
|
class AttachmentAdapter @Inject constructor(
|
||||||
private val context: Context
|
private val context: Context
|
||||||
) : QkAdapter<Attachment>() {
|
) : QkAdapter<Attachment>() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val VIEW_TYPE_IMAGE = 0
|
private const val VIEW_TYPE_FILE = 0
|
||||||
private const val VIEW_TYPE_CONTACT = 1
|
private const val VIEW_TYPE_CONTACT = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,14 +54,13 @@ class AttachmentAdapter @Inject constructor(
|
|||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QkViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QkViewHolder {
|
||||||
val inflater = LayoutInflater.from(parent.context)
|
val inflater = LayoutInflater.from(parent.context)
|
||||||
val view = when (viewType) {
|
|
||||||
VIEW_TYPE_IMAGE -> inflater.inflate(R.layout.attachment_image_list_item, parent, false)
|
|
||||||
.apply { thumbnailBounds.clipToOutline = true }
|
|
||||||
|
|
||||||
VIEW_TYPE_CONTACT -> inflater.inflate(R.layout.attachment_contact_list_item, parent, false)
|
val view = inflater.inflate(
|
||||||
|
if (viewType == VIEW_TYPE_CONTACT) R.layout.attachment_contact_list_item
|
||||||
else -> null!! // Impossible
|
else R.layout.attachment_file_list_item,
|
||||||
}
|
parent,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
return QkViewHolder(view).apply {
|
return QkViewHolder(view).apply {
|
||||||
view.setOnClickListener {
|
view.setOnClickListener {
|
||||||
@@ -73,26 +73,81 @@ class AttachmentAdapter @Inject constructor(
|
|||||||
override fun onBindViewHolder(holder: QkViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: QkViewHolder, position: Int) {
|
||||||
val attachment = getItem(position)
|
val attachment = getItem(position)
|
||||||
|
|
||||||
when (attachment) {
|
if (attachment.isVCard(context)) {
|
||||||
is Attachment.Image -> Glide.with(context)
|
val displayName = Ezvcard.parse(
|
||||||
.load(attachment.getUri())
|
String(attachment.getResourceBytes(context))
|
||||||
.into(holder.thumbnail)
|
).first().getDisplayName() ?: ""
|
||||||
|
holder.name.text = displayName
|
||||||
is Attachment.Contact -> Observable.just(attachment.vCard)
|
holder.name.isVisible = displayName.isNotEmpty()
|
||||||
.mapNotNull { vCard -> Ezvcard.parse(vCard).first() }
|
return
|
||||||
.map { vcard -> vcard.getDisplayName() ?: "" }
|
|
||||||
.subscribeOn(Schedulers.computation())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe { displayName ->
|
|
||||||
holder.name?.text = displayName
|
|
||||||
holder.name?.isVisible = displayName.isNotEmpty()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if attachment uri is missing
|
||||||
|
if (!attachment.getUri().resourceExists(context)) {
|
||||||
|
holder.thumbnail.setImageResource(android.R.drawable.ic_delete)
|
||||||
|
holder.fileName.text = context.getString(R.string.attachment_missing)
|
||||||
|
holder.fileName.visibility = View.VISIBLE
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val uri = attachment.getUri()
|
||||||
|
val mimeType = attachment.getType(context)
|
||||||
|
|
||||||
|
// if attachment mime type is image/* or video/*, use image/frame
|
||||||
|
if (attachment.hasDisplayableImage(context)) {
|
||||||
|
Glide
|
||||||
|
.with(context)
|
||||||
|
.load(uri)
|
||||||
|
.into(holder.thumbnail)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// if audio mime type, try and use embedded image if one exists
|
||||||
|
if (attachment.isAudio(context)) {
|
||||||
|
val metaDataRetriever = MediaMetadataRetriever()
|
||||||
|
metaDataRetriever.setDataSource(context, uri)
|
||||||
|
val embeddedPicture = metaDataRetriever.embeddedPicture
|
||||||
|
if (embeddedPicture != null) {
|
||||||
|
Glide
|
||||||
|
.with(context)
|
||||||
|
.load(embeddedPicture)
|
||||||
|
.into(holder.thumbnail)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// try and use icon from default app for type
|
||||||
|
val intent = Intent(Intent.ACTION_VIEW).setDataAndType(uri, mimeType)
|
||||||
|
val appIcon = context
|
||||||
|
.packageManager
|
||||||
|
.resolveActivity(intent, MATCH_DEFAULT)
|
||||||
|
?.loadIcon(context.packageManager)
|
||||||
|
if (appIcon != null)
|
||||||
|
Glide
|
||||||
|
.with(context)
|
||||||
|
.load(appIcon)
|
||||||
|
.into(holder.thumbnail)
|
||||||
|
else if (mimeType?.startsWith("audio/") == true)
|
||||||
|
// else, if audio, use default local audio icon
|
||||||
|
Glide
|
||||||
|
.with(context)
|
||||||
|
.load(R.drawable.ic_round_volume_up_24)
|
||||||
|
.into(holder.thumbnail)
|
||||||
|
else
|
||||||
|
// else, use default attachment icon
|
||||||
|
Glide
|
||||||
|
.with(context)
|
||||||
|
.load(R.drawable.ic_attachment_black_24dp)
|
||||||
|
.into(holder.thumbnail)
|
||||||
|
|
||||||
|
// else, show file name
|
||||||
|
holder.fileName.text = attachment.getName(context)
|
||||||
|
holder.fileName.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getItemViewType(position: Int) = when (getItem(position)) {
|
override fun getItemViewType(position: Int) = when (getItem(position).isVCard(context)) {
|
||||||
is Attachment.Image -> VIEW_TYPE_IMAGE
|
true -> VIEW_TYPE_CONTACT
|
||||||
is Attachment.Contact -> VIEW_TYPE_CONTACT
|
else -> VIEW_TYPE_FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -43,6 +43,7 @@ import androidx.appcompat.app.AlertDialog
|
|||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.constraintlayout.widget.ConstraintSet
|
import androidx.constraintlayout.widget.ConstraintSet
|
||||||
import androidx.core.app.ActivityCompat
|
import androidx.core.app.ActivityCompat
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.ViewModelProviders
|
import androidx.lifecycle.ViewModelProviders
|
||||||
@@ -71,10 +72,12 @@ import dev.octoshrimpy.quik.feature.contacts.ContactsActivity
|
|||||||
import dev.octoshrimpy.quik.model.Attachment
|
import dev.octoshrimpy.quik.model.Attachment
|
||||||
import dev.octoshrimpy.quik.model.Recipient
|
import dev.octoshrimpy.quik.model.Recipient
|
||||||
import io.reactivex.Observable
|
import io.reactivex.Observable
|
||||||
|
import io.reactivex.Single
|
||||||
import io.reactivex.subjects.PublishSubject
|
import io.reactivex.subjects.PublishSubject
|
||||||
import io.reactivex.subjects.Subject
|
import io.reactivex.subjects.Subject
|
||||||
import kotlinx.android.synthetic.main.compose_activity.*
|
import kotlinx.android.synthetic.main.compose_activity.*
|
||||||
import kotlinx.android.synthetic.main.main_activity.toolbar
|
import kotlinx.android.synthetic.main.main_activity.toolbar
|
||||||
|
import kotlinx.coroutines.reactive.publish
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@@ -82,15 +85,6 @@ import javax.inject.Inject
|
|||||||
|
|
||||||
class ComposeActivity : QkThemedActivity(), ComposeView {
|
class ComposeActivity : QkThemedActivity(), ComposeView {
|
||||||
|
|
||||||
companion object {
|
|
||||||
private const val SelectContactRequestCode = 0
|
|
||||||
private const val TakePhotoRequestCode = 1
|
|
||||||
private const val AttachPhotoRequestCode = 2
|
|
||||||
private const val AttachContactRequestCode = 3
|
|
||||||
|
|
||||||
private const val CameraDestinationKey = "camera_destination"
|
|
||||||
}
|
|
||||||
|
|
||||||
@Inject lateinit var attachmentAdapter: AttachmentAdapter
|
@Inject lateinit var attachmentAdapter: AttachmentAdapter
|
||||||
@Inject lateinit var chipsAdapter: ChipsAdapter
|
@Inject lateinit var chipsAdapter: ChipsAdapter
|
||||||
@Inject lateinit var dateFormatter: DateFormatter
|
@Inject lateinit var dateFormatter: DateFormatter
|
||||||
@@ -103,19 +97,22 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
override val chipDeletedIntent: Subject<Recipient> by lazy { chipsAdapter.chipDeleted }
|
override val chipDeletedIntent: Subject<Recipient> by lazy { chipsAdapter.chipDeleted }
|
||||||
override val menuReadyIntent: Observable<Unit> = menu.map { Unit }
|
override val menuReadyIntent: Observable<Unit> = menu.map { Unit }
|
||||||
override val optionsItemIntent: Subject<Int> = PublishSubject.create()
|
override val optionsItemIntent: Subject<Int> = PublishSubject.create()
|
||||||
|
override val scheduleAction: Subject<Boolean> = PublishSubject.create()
|
||||||
override val sendAsGroupIntent by lazy { sendAsGroupBackground.clicks() }
|
override val sendAsGroupIntent by lazy { sendAsGroupBackground.clicks() }
|
||||||
override val messageClickIntent: Subject<Long> by lazy { messageAdapter.clicks }
|
override val messageClickIntent: Subject<Long> by lazy { messageAdapter.clicks }
|
||||||
override val messagePartClickIntent: Subject<Long> by lazy { messageAdapter.partClicks }
|
override val messagePartClickIntent: Subject<Long> by lazy { messageAdapter.partClicks }
|
||||||
override val messagesSelectedIntent by lazy { messageAdapter.selectionChanges }
|
override val messagesSelectedIntent by lazy { messageAdapter.selectionChanges }
|
||||||
override val cancelSendingIntent: Subject<Long> by lazy { messageAdapter.cancelSending }
|
override val cancelSendingIntent: Subject<Long> by lazy { messageAdapter.cancelSending }
|
||||||
|
override val sendNowIntent: Subject<Long> by lazy { messageAdapter.sendNow }
|
||||||
override val attachmentDeletedIntent: Subject<Attachment> by lazy { attachmentAdapter.attachmentDeleted }
|
override val attachmentDeletedIntent: Subject<Attachment> by lazy { attachmentAdapter.attachmentDeleted }
|
||||||
override val textChangedIntent by lazy { message.textChanges() }
|
override val textChangedIntent by lazy { message.textChanges() }
|
||||||
override val attachIntent by lazy { Observable.merge(attach.clicks(), attachingBackground.clicks()) }
|
override val attachIntent by lazy { Observable.merge(attach.clicks(), attachingBackground.clicks()) }
|
||||||
override val cameraIntent by lazy { Observable.merge(camera.clicks(), cameraLabel.clicks()) }
|
override val cameraIntent by lazy { Observable.merge(camera.clicks(), cameraLabel.clicks()) }
|
||||||
override val galleryIntent by lazy { Observable.merge(gallery.clicks(), galleryLabel.clicks()) }
|
override val attachImageFileIntent by lazy { Observable.merge(gallery.clicks(), galleryLabel.clicks()) }
|
||||||
|
override val attachAnyFileIntent by lazy { Observable.merge(attachAFileIcon.clicks(), attachAFileLabel.clicks()) }
|
||||||
override val scheduleIntent by lazy { Observable.merge(schedule.clicks(), scheduleLabel.clicks()) }
|
override val scheduleIntent by lazy { Observable.merge(schedule.clicks(), scheduleLabel.clicks()) }
|
||||||
override val attachContactIntent by lazy { Observable.merge(contact.clicks(), contactLabel.clicks()) }
|
override val attachContactIntent by lazy { Observable.merge(contact.clicks(), contactLabel.clicks()) }
|
||||||
override val attachmentSelectedIntent: Subject<Uri> = PublishSubject.create()
|
override val attachAnyFileSelectedIntent: Subject<Uri> = PublishSubject.create()
|
||||||
override val contactSelectedIntent: Subject<Uri> = PublishSubject.create()
|
override val contactSelectedIntent: Subject<Uri> = PublishSubject.create()
|
||||||
override val inputContentIntent by lazy { message.inputContentSelected }
|
override val inputContentIntent by lazy { message.inputContentSelected }
|
||||||
override val scheduleSelectedIntent: Subject<Long> = PublishSubject.create()
|
override val scheduleSelectedIntent: Subject<Long> = PublishSubject.create()
|
||||||
@@ -125,6 +122,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
override val viewQksmsPlusIntent: Subject<Unit> = PublishSubject.create()
|
override val viewQksmsPlusIntent: Subject<Unit> = PublishSubject.create()
|
||||||
override val backPressedIntent: Subject<Unit> = PublishSubject.create()
|
override val backPressedIntent: Subject<Unit> = PublishSubject.create()
|
||||||
override val confirmDeleteIntent: Subject<List<Long>> = PublishSubject.create()
|
override val confirmDeleteIntent: Subject<List<Long>> = PublishSubject.create()
|
||||||
|
override val messageLinkAskIntent: Subject<Uri> by lazy { messageAdapter.messageLinkClicks }
|
||||||
|
|
||||||
private val viewModel by lazy { ViewModelProviders.of(this, viewModelFactory)[ComposeViewModel::class.java] }
|
private val viewModel by lazy { ViewModelProviders.of(this, viewModelFactory)[ComposeViewModel::class.java] }
|
||||||
|
|
||||||
@@ -330,6 +328,10 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
)
|
)
|
||||||
constraintSet.applyTo(constraintLayout)
|
constraintSet.applyTo(constraintLayout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if scheduling mode is set, show schedule dialog
|
||||||
|
if (state.scheduling)
|
||||||
|
scheduleAction.onNext(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun clearSelection() = messageAdapter.clearSelection()
|
override fun clearSelection() = messageAdapter.clearSelection()
|
||||||
@@ -350,6 +352,23 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun showMessageLinkAskDialog(uri: Uri) {
|
||||||
|
AlertDialog.Builder(this)
|
||||||
|
.setTitle(R.string.messageLinkHandling_dialog_title)
|
||||||
|
.setMessage(getString(R.string.messageLinkHandling_dialog_body, uri.toString()))
|
||||||
|
.setPositiveButton(
|
||||||
|
R.string.messageLinkHandling_dialog_positive
|
||||||
|
) { _, _ ->
|
||||||
|
ContextCompat.startActivity(
|
||||||
|
this,
|
||||||
|
Intent(Intent.ACTION_VIEW).setData(uri),
|
||||||
|
null
|
||||||
|
)
|
||||||
|
}
|
||||||
|
.setNegativeButton(R.string.messageLinkHandling_dialog_negative) { _, _ -> { } }
|
||||||
|
.show()
|
||||||
|
}
|
||||||
|
|
||||||
override fun requestDefaultSms() {
|
override fun requestDefaultSms() {
|
||||||
navigator.showDefaultSmsDialog(this)
|
navigator.showDefaultSmsDialog(this)
|
||||||
}
|
}
|
||||||
@@ -386,7 +405,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
val intent = Intent(Intent.ACTION_PICK)
|
val intent = Intent(Intent.ACTION_PICK)
|
||||||
.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE)
|
.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE)
|
||||||
|
|
||||||
startActivityForResult(Intent.createChooser(intent, null), AttachContactRequestCode)
|
startActivityForResult(Intent.createChooser(intent, null), ComposeView.AttachContactRequestCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showContacts(sharing: Boolean, chips: List<Recipient>) {
|
override fun showContacts(sharing: Boolean, chips: List<Recipient>) {
|
||||||
@@ -395,7 +414,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
val intent = Intent(this, ContactsActivity::class.java)
|
val intent = Intent(this, ContactsActivity::class.java)
|
||||||
.putExtra(ContactsActivity.SharingKey, sharing)
|
.putExtra(ContactsActivity.SharingKey, sharing)
|
||||||
.putExtra(ContactsActivity.ChipsKey, serialized)
|
.putExtra(ContactsActivity.ChipsKey, serialized)
|
||||||
startActivityForResult(intent, SelectContactRequestCode)
|
startActivityForResult(intent, ComposeView.SelectContactRequestCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun themeChanged() {
|
override fun themeChanged() {
|
||||||
@@ -415,17 +434,17 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
|
|
||||||
val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
|
val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
|
||||||
.putExtra(MediaStore.EXTRA_OUTPUT, cameraDestination)
|
.putExtra(MediaStore.EXTRA_OUTPUT, cameraDestination)
|
||||||
startActivityForResult(Intent.createChooser(intent, null), TakePhotoRequestCode)
|
startActivityForResult(Intent.createChooser(intent, null), ComposeView.TakePhotoRequestCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun requestGallery() {
|
override fun requestGallery(mimeType: String, requestCode: Int) {
|
||||||
val intent = Intent(Intent.ACTION_PICK)
|
val intent = Intent(Intent.ACTION_PICK)
|
||||||
.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true)
|
.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true)
|
||||||
.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION)
|
.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION)
|
||||||
.putExtra(Intent.EXTRA_LOCAL_ONLY, false)
|
.putExtra(Intent.EXTRA_LOCAL_ONLY, false)
|
||||||
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||||
.setType("image/*")
|
.setType(mimeType)
|
||||||
startActivityForResult(Intent.createChooser(intent, null), AttachPhotoRequestCode)
|
startActivityForResult(Intent.createChooser(intent, null), requestCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setDraft(draft: String) {
|
override fun setDraft(draft: String) {
|
||||||
@@ -473,36 +492,43 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
when {
|
if (resultCode != Activity.RESULT_OK)
|
||||||
requestCode == SelectContactRequestCode -> {
|
return
|
||||||
|
|
||||||
|
when (requestCode) {
|
||||||
|
ComposeView.SelectContactRequestCode -> {
|
||||||
chipsSelectedIntent.onNext(data?.getSerializableExtra(ContactsActivity.ChipsKey)
|
chipsSelectedIntent.onNext(data?.getSerializableExtra(ContactsActivity.ChipsKey)
|
||||||
?.let { serializable -> serializable as? HashMap<String, String?> }
|
?.let { serializable -> serializable as? HashMap<String, String?> }
|
||||||
?: hashMapOf())
|
?: hashMapOf())
|
||||||
}
|
}
|
||||||
requestCode == TakePhotoRequestCode && resultCode == Activity.RESULT_OK -> {
|
|
||||||
cameraDestination?.let(attachmentSelectedIntent::onNext)
|
ComposeView.TakePhotoRequestCode -> {
|
||||||
|
cameraDestination?.let(attachAnyFileSelectedIntent::onNext)
|
||||||
}
|
}
|
||||||
requestCode == AttachPhotoRequestCode && resultCode == Activity.RESULT_OK -> {
|
|
||||||
|
ComposeView.AttachAFileRequestCode -> {
|
||||||
data?.clipData?.itemCount
|
data?.clipData?.itemCount
|
||||||
?.let { count -> 0 until count }
|
?.let { count -> 0 until count }
|
||||||
?.mapNotNull { i -> data.clipData?.getItemAt(i)?.uri }
|
?.mapNotNull { i -> data.clipData?.getItemAt(i)?.uri }
|
||||||
?.forEach(attachmentSelectedIntent::onNext)
|
?.forEach(attachAnyFileSelectedIntent::onNext)
|
||||||
?: data?.data?.let(attachmentSelectedIntent::onNext)
|
?: data?.data?.let(attachAnyFileSelectedIntent::onNext)
|
||||||
}
|
}
|
||||||
requestCode == AttachContactRequestCode && resultCode == Activity.RESULT_OK -> {
|
|
||||||
|
ComposeView.AttachContactRequestCode -> {
|
||||||
data?.data?.let(contactSelectedIntent::onNext)
|
data?.data?.let(contactSelectedIntent::onNext)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> super.onActivityResult(requestCode, resultCode, data)
|
else -> super.onActivityResult(requestCode, resultCode, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSaveInstanceState(outState: Bundle) {
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
outState.putParcelable(CameraDestinationKey, cameraDestination)
|
outState.putParcelable(ComposeView.CameraDestinationKey, cameraDestination)
|
||||||
super.onSaveInstanceState(outState)
|
super.onSaveInstanceState(outState)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
|
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
|
||||||
cameraDestination = savedInstanceState.getParcelable(CameraDestinationKey)
|
cameraDestination = savedInstanceState.getParcelable(ComposeView.CameraDestinationKey)
|
||||||
super.onRestoreInstanceState(savedInstanceState)
|
super.onRestoreInstanceState(savedInstanceState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,22 +78,14 @@ class ComposeActivityModule {
|
|||||||
val uris = mutableListOf<Uri>()
|
val uris = mutableListOf<Uri>()
|
||||||
activity.intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM)?.run(uris::add)
|
activity.intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM)?.run(uris::add)
|
||||||
activity.intent.getParcelableArrayListExtra<Uri>(Intent.EXTRA_STREAM)?.run(uris::addAll)
|
activity.intent.getParcelableArrayListExtra<Uri>(Intent.EXTRA_STREAM)?.run(uris::addAll)
|
||||||
return Attachments(uris.mapNotNull { uri ->
|
|
||||||
val mimeType = activity.contentResolver.getType(uri)
|
|
||||||
when {
|
|
||||||
ContentType.isImageType(mimeType) -> {
|
|
||||||
Attachment.Image(uri)
|
|
||||||
}
|
|
||||||
|
|
||||||
ContentType.TEXT_VCARD.equals(mimeType, true) -> {
|
return Attachments(uris.mapNotNull { Attachment(it) })
|
||||||
val inputStream = activity.contentResolver.openInputStream(uri)
|
}
|
||||||
val text = inputStream?.reader(Charset.forName("utf-8"))?.readText()
|
|
||||||
text?.let(Attachment::Contact)
|
|
||||||
}
|
|
||||||
|
|
||||||
else -> null
|
@Provides
|
||||||
}
|
@Named("mode")
|
||||||
})
|
fun provideSharedAction(activity: ComposeActivity): String {
|
||||||
|
return activity.intent.getStringExtra("mode") ?: "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ data class ComposeState(
|
|||||||
val scheduled: Long = 0,
|
val scheduled: Long = 0,
|
||||||
val attachments: List<Attachment> = ArrayList(),
|
val attachments: List<Attachment> = ArrayList(),
|
||||||
val attaching: Boolean = false,
|
val attaching: Boolean = false,
|
||||||
|
val scheduling: Boolean = false,
|
||||||
val remaining: String = "",
|
val remaining: String = "",
|
||||||
val subscription: SubscriptionInfoCompat? = null,
|
val subscription: SubscriptionInfoCompat? = null,
|
||||||
val canSend: Boolean = false,
|
val canSend: Boolean = false,
|
||||||
|
|||||||
@@ -29,6 +29,15 @@ import io.reactivex.subjects.Subject
|
|||||||
|
|
||||||
interface ComposeView : QkView<ComposeState> {
|
interface ComposeView : QkView<ComposeState> {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val SelectContactRequestCode = 0
|
||||||
|
const val TakePhotoRequestCode = 1
|
||||||
|
const val AttachAFileRequestCode = 4
|
||||||
|
const val AttachContactRequestCode = 3
|
||||||
|
|
||||||
|
const val CameraDestinationKey = "camera_destination"
|
||||||
|
}
|
||||||
|
|
||||||
val activityVisibleIntent: Observable<Boolean>
|
val activityVisibleIntent: Observable<Boolean>
|
||||||
val chipsSelectedIntent: Subject<HashMap<String, String?>>
|
val chipsSelectedIntent: Subject<HashMap<String, String?>>
|
||||||
val chipDeletedIntent: Subject<Recipient>
|
val chipDeletedIntent: Subject<Recipient>
|
||||||
@@ -39,14 +48,17 @@ interface ComposeView : QkView<ComposeState> {
|
|||||||
val messagePartClickIntent: Subject<Long>
|
val messagePartClickIntent: Subject<Long>
|
||||||
val messagesSelectedIntent: Observable<List<Long>>
|
val messagesSelectedIntent: Observable<List<Long>>
|
||||||
val cancelSendingIntent: Subject<Long>
|
val cancelSendingIntent: Subject<Long>
|
||||||
|
val sendNowIntent: Subject<Long>
|
||||||
val attachmentDeletedIntent: Subject<Attachment>
|
val attachmentDeletedIntent: Subject<Attachment>
|
||||||
val textChangedIntent: Observable<CharSequence>
|
val textChangedIntent: Observable<CharSequence>
|
||||||
val attachIntent: Observable<Unit>
|
val attachIntent: Observable<Unit>
|
||||||
val cameraIntent: Observable<*>
|
val cameraIntent: Observable<*>
|
||||||
val galleryIntent: Observable<*>
|
val attachAnyFileIntent: Observable<*>
|
||||||
|
val attachImageFileIntent: Observable<*>
|
||||||
val scheduleIntent: Observable<*>
|
val scheduleIntent: Observable<*>
|
||||||
|
val scheduleAction: Observable<*>
|
||||||
val attachContactIntent: Observable<*>
|
val attachContactIntent: Observable<*>
|
||||||
val attachmentSelectedIntent: Observable<Uri>
|
val attachAnyFileSelectedIntent: Observable<Uri>
|
||||||
val contactSelectedIntent: Observable<Uri>
|
val contactSelectedIntent: Observable<Uri>
|
||||||
val inputContentIntent: Observable<InputContentInfoCompat>
|
val inputContentIntent: Observable<InputContentInfoCompat>
|
||||||
val scheduleSelectedIntent: Observable<Long>
|
val scheduleSelectedIntent: Observable<Long>
|
||||||
@@ -56,11 +68,13 @@ interface ComposeView : QkView<ComposeState> {
|
|||||||
val viewQksmsPlusIntent: Subject<Unit>
|
val viewQksmsPlusIntent: Subject<Unit>
|
||||||
val backPressedIntent: Observable<Unit>
|
val backPressedIntent: Observable<Unit>
|
||||||
val confirmDeleteIntent: Observable<List<Long>>
|
val confirmDeleteIntent: Observable<List<Long>>
|
||||||
|
val messageLinkAskIntent: Observable<Uri>
|
||||||
|
|
||||||
fun clearSelection()
|
fun clearSelection()
|
||||||
fun toggleSelectAll()
|
fun toggleSelectAll()
|
||||||
fun expandMessages(messageIds: List<Long>, expand: Boolean)
|
fun expandMessages(messageIds: List<Long>, expand: Boolean)
|
||||||
fun showDetails(details: String)
|
fun showDetails(details: String)
|
||||||
|
fun showMessageLinkAskDialog(uri: Uri)
|
||||||
fun requestDefaultSms()
|
fun requestDefaultSms()
|
||||||
fun requestStoragePermission()
|
fun requestStoragePermission()
|
||||||
fun requestSmsPermission()
|
fun requestSmsPermission()
|
||||||
@@ -68,7 +82,7 @@ interface ComposeView : QkView<ComposeState> {
|
|||||||
fun themeChanged()
|
fun themeChanged()
|
||||||
fun showKeyboard()
|
fun showKeyboard()
|
||||||
fun requestCamera()
|
fun requestCamera()
|
||||||
fun requestGallery()
|
fun requestGallery(mimeType: String, requestCode: Int)
|
||||||
fun requestDatePicker()
|
fun requestDatePicker()
|
||||||
fun requestContact()
|
fun requestContact()
|
||||||
fun setDraft(draft: String)
|
fun setDraft(draft: String)
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ import dev.octoshrimpy.quik.util.Preferences
|
|||||||
import dev.octoshrimpy.quik.util.tryOrNull
|
import dev.octoshrimpy.quik.util.tryOrNull
|
||||||
import com.uber.autodispose.android.lifecycle.scope
|
import com.uber.autodispose.android.lifecycle.scope
|
||||||
import com.uber.autodispose.autoDisposable
|
import com.uber.autodispose.autoDisposable
|
||||||
|
import dev.octoshrimpy.quik.extensions.isSmil
|
||||||
import io.reactivex.Observable
|
import io.reactivex.Observable
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.rxkotlin.Observables
|
import io.reactivex.rxkotlin.Observables
|
||||||
@@ -79,6 +80,7 @@ class ComposeViewModel @Inject constructor(
|
|||||||
@Named("addresses") private val addresses: List<String>,
|
@Named("addresses") private val addresses: List<String>,
|
||||||
@Named("text") private val sharedText: String,
|
@Named("text") private val sharedText: String,
|
||||||
@Named("attachments") private val sharedAttachments: Attachments,
|
@Named("attachments") private val sharedAttachments: Attachments,
|
||||||
|
@Named("mode") private val mode: String,
|
||||||
private val contactRepo: ContactRepository,
|
private val contactRepo: ContactRepository,
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
private val activeConversationManager: ActiveConversationManager,
|
private val activeConversationManager: ActiveConversationManager,
|
||||||
@@ -242,6 +244,10 @@ class ComposeViewModel @Inject constructor(
|
|||||||
val sub = if (subs.size > 1) subs.firstOrNull { it.subscriptionId == subId } ?: subs[0] else null
|
val sub = if (subs.size > 1) subs.firstOrNull { it.subscriptionId == subId } ?: subs[0] else null
|
||||||
newState { copy(subscription = sub) }
|
newState { copy(subscription = sub) }
|
||||||
}.subscribe()
|
}.subscribe()
|
||||||
|
|
||||||
|
// actions
|
||||||
|
if (mode == "scheduling")
|
||||||
|
newState { copy(scheduling = true) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun bindView(view: ComposeView) {
|
override fun bindView(view: ComposeView) {
|
||||||
@@ -378,8 +384,8 @@ class ComposeViewModel @Inject constructor(
|
|||||||
.filter { it == R.id.forward }
|
.filter { it == R.id.forward }
|
||||||
.withLatestFrom(view.messagesSelectedIntent) { _, messages ->
|
.withLatestFrom(view.messagesSelectedIntent) { _, messages ->
|
||||||
messages?.firstOrNull()?.let { messageRepo.getMessage(it) }?.let { message ->
|
messages?.firstOrNull()?.let { messageRepo.getMessage(it) }?.let { message ->
|
||||||
val images = message.parts.filter { it.isImage() }.mapNotNull { it.getUri() }
|
val attachments = message.parts.filter { !it.isSmil() }.mapNotNull { it.getUri() }
|
||||||
navigator.showCompose(message.getText(), images)
|
navigator.showCompose(message.getText(), attachments)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
@@ -487,6 +493,31 @@ class ComposeViewModel @Inject constructor(
|
|||||||
cancelMessage.execute(CancelDelayedMessage.Params(message.id, message.threadId))
|
cancelMessage.execute(CancelDelayedMessage.Params(message.id, message.threadId))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// send a delayed message now
|
||||||
|
view.sendNowIntent
|
||||||
|
.mapNotNull(messageRepo::getMessage)
|
||||||
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe { message ->
|
||||||
|
cancelMessage.execute(CancelDelayedMessage.Params(message.id, message.threadId))
|
||||||
|
val address = listOf(conversationRepo
|
||||||
|
.getConversation(threadId)?.recipients?.firstOrNull()?.address ?: message.address)
|
||||||
|
sendMessage.execute(
|
||||||
|
SendMessage.Params(
|
||||||
|
message.subId,
|
||||||
|
message.threadId,
|
||||||
|
address,
|
||||||
|
message.body,
|
||||||
|
listOf(), // sms with attachments (mms) can't be delayed so we can know attachments are empty for a 'send now' delayed sms
|
||||||
|
0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show the message details
|
||||||
|
view.messageLinkAskIntent
|
||||||
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe { view.showMessageLinkAskDialog(it) }
|
||||||
|
|
||||||
// Set the current conversation
|
// Set the current conversation
|
||||||
Observables
|
Observables
|
||||||
.combineLatest(
|
.combineLatest(
|
||||||
@@ -528,19 +559,21 @@ class ComposeViewModel @Inject constructor(
|
|||||||
view.cameraIntent
|
view.cameraIntent
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
.subscribe {
|
.subscribe {
|
||||||
if (permissionManager.hasStorage()) {
|
newState { copy(attaching = false) }
|
||||||
newState { copy(attaching = false) }
|
view.requestCamera()
|
||||||
view.requestCamera()
|
|
||||||
} else {
|
|
||||||
view.requestStoragePermission()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attach a photo from gallery
|
// pick a photo (specifically) from image provider apps
|
||||||
view.galleryIntent
|
view.attachImageFileIntent
|
||||||
.doOnNext { newState { copy(attaching = false) } }
|
.doOnNext { newState { copy(attaching = false) } }
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
.subscribe { view.requestGallery() }
|
.subscribe { view.requestGallery("image/*", ComposeView.AttachAFileRequestCode) }
|
||||||
|
|
||||||
|
// pick any file from any provider apps
|
||||||
|
view.attachAnyFileIntent
|
||||||
|
.doOnNext { newState { copy(attaching = false) } }
|
||||||
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe { view.requestGallery("*/*", ComposeView.AttachAFileRequestCode) }
|
||||||
|
|
||||||
// Choose a time to schedule the message
|
// Choose a time to schedule the message
|
||||||
view.scheduleIntent
|
view.scheduleIntent
|
||||||
@@ -552,15 +585,21 @@ class ComposeViewModel @Inject constructor(
|
|||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
.subscribe { view.requestDatePicker() }
|
.subscribe { view.requestDatePicker() }
|
||||||
|
|
||||||
// A photo was selected
|
view.scheduleAction
|
||||||
Observable.merge(
|
.take(1)
|
||||||
view.attachmentSelectedIntent.map { uri -> Attachment.Image(uri) },
|
.doOnNext{ newState { copy(scheduling = false) } }
|
||||||
view.inputContentIntent.map { inputContent -> Attachment.Image(inputContent = inputContent) })
|
.autoDisposable(view.scope())
|
||||||
.withLatestFrom(attachments) { attachment, attachments -> attachments + attachment }
|
.subscribe { view.requestDatePicker() }
|
||||||
.doOnNext(attachments::onNext)
|
|
||||||
.autoDisposable(view.scope())
|
|
||||||
.subscribe { newState { copy(attaching = false) } }
|
|
||||||
|
|
||||||
|
// a file, photo or otherwise, was picked by the user
|
||||||
|
Observable.merge(
|
||||||
|
view.attachAnyFileSelectedIntent.map { uri -> Attachment(uri) },
|
||||||
|
view.inputContentIntent.map { inputContent -> Attachment(inputContent = inputContent) }
|
||||||
|
)
|
||||||
|
.withLatestFrom(attachments) { attachment, attachments -> attachments + attachment }
|
||||||
|
.doOnNext(attachments::onNext)
|
||||||
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe { newState { copy(attaching = false) } }
|
||||||
// Set the scheduled time
|
// Set the scheduled time
|
||||||
view.scheduleSelectedIntent
|
view.scheduleSelectedIntent
|
||||||
.filter { scheduled ->
|
.filter { scheduled ->
|
||||||
@@ -579,7 +618,7 @@ class ComposeViewModel @Inject constructor(
|
|||||||
|
|
||||||
// Contact was selected for attachment
|
// Contact was selected for attachment
|
||||||
view.contactSelectedIntent
|
view.contactSelectedIntent
|
||||||
.map { uri -> Attachment.Contact(getVCard(uri)!!) }
|
.map { uri -> Attachment(getFullVCardUri(uri)) }
|
||||||
.withLatestFrom(attachments) { attachment, attachments -> attachments + attachment }
|
.withLatestFrom(attachments) { attachment, attachments -> attachments + attachment }
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
@@ -704,7 +743,6 @@ class ComposeViewModel @Inject constructor(
|
|||||||
state.scheduled != 0L -> {
|
state.scheduled != 0L -> {
|
||||||
newState { copy(scheduled = 0) }
|
newState { copy(scheduled = 0) }
|
||||||
val uris = attachments
|
val uris = attachments
|
||||||
.mapNotNull { it as? Attachment.Image }
|
|
||||||
.map { it.getUri() }
|
.map { it.getUri() }
|
||||||
.map { it.toString() }
|
.map { it.toString() }
|
||||||
val params = AddScheduledMessage
|
val params = AddScheduledMessage
|
||||||
@@ -784,17 +822,17 @@ class ComposeViewModel @Inject constructor(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getVCard(contactData: Uri): String? {
|
private fun getFullVCardUri(contactData: Uri): Uri {
|
||||||
val lookupKey = context.contentResolver.query(contactData, null, null, null, null)?.use { cursor ->
|
val lookupKey = context.contentResolver.query(contactData, null, null, null, null)?.use {
|
||||||
cursor.moveToFirst()
|
it.moveToFirst()
|
||||||
cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY))
|
val index = it.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY)
|
||||||
|
if (index >= 0)
|
||||||
|
it.getString(index)
|
||||||
|
else
|
||||||
|
""
|
||||||
}
|
}
|
||||||
|
|
||||||
val vCardUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey)
|
return Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey)
|
||||||
return context.contentResolver.openAssetFileDescriptor(vCardUri, "r")
|
|
||||||
?.createInputStream()
|
|
||||||
?.readBytes()
|
|
||||||
?.let { bytes -> String(bytes) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -21,17 +21,23 @@ package dev.octoshrimpy.quik.feature.compose
|
|||||||
import android.animation.ObjectAnimator
|
import android.animation.ObjectAnimator
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
|
import android.net.Uri
|
||||||
import android.text.Layout
|
import android.text.Layout
|
||||||
import android.text.Spannable
|
import android.text.Spannable
|
||||||
import android.text.SpannableString
|
import android.text.SpannableString
|
||||||
|
import android.text.SpannableStringBuilder
|
||||||
|
import android.text.method.LinkMovementMethod
|
||||||
|
import android.text.style.ClickableSpan
|
||||||
import android.text.style.StyleSpan
|
import android.text.style.StyleSpan
|
||||||
|
import android.text.style.URLSpan
|
||||||
|
import android.text.util.Linkify
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.ProgressBar
|
import android.widget.ProgressBar
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
|
||||||
import com.jakewharton.rxbinding2.view.clicks
|
import com.jakewharton.rxbinding2.view.clicks
|
||||||
|
import com.moez.QKSMS.common.QkMediaPlayer
|
||||||
import dev.octoshrimpy.quik.R
|
import dev.octoshrimpy.quik.R
|
||||||
import dev.octoshrimpy.quik.common.base.QkRealmAdapter
|
import dev.octoshrimpy.quik.common.base.QkRealmAdapter
|
||||||
import dev.octoshrimpy.quik.common.base.QkViewHolder
|
import dev.octoshrimpy.quik.common.base.QkViewHolder
|
||||||
@@ -55,6 +61,7 @@ import dev.octoshrimpy.quik.model.Message
|
|||||||
import dev.octoshrimpy.quik.model.Recipient
|
import dev.octoshrimpy.quik.model.Recipient
|
||||||
import dev.octoshrimpy.quik.util.PhoneNumberUtils
|
import dev.octoshrimpy.quik.util.PhoneNumberUtils
|
||||||
import dev.octoshrimpy.quik.util.Preferences
|
import dev.octoshrimpy.quik.util.Preferences
|
||||||
|
import io.reactivex.disposables.Disposable
|
||||||
import io.reactivex.subjects.PublishSubject
|
import io.reactivex.subjects.PublishSubject
|
||||||
import io.reactivex.subjects.Subject
|
import io.reactivex.subjects.Subject
|
||||||
import io.realm.RealmResults
|
import io.realm.RealmResults
|
||||||
@@ -67,6 +74,7 @@ import kotlinx.android.synthetic.main.message_list_item_in.status
|
|||||||
import kotlinx.android.synthetic.main.message_list_item_in.timestamp
|
import kotlinx.android.synthetic.main.message_list_item_in.timestamp
|
||||||
import kotlinx.android.synthetic.main.message_list_item_in.view.*
|
import kotlinx.android.synthetic.main.message_list_item_in.view.*
|
||||||
import kotlinx.android.synthetic.main.message_list_item_out.*
|
import kotlinx.android.synthetic.main.message_list_item_out.*
|
||||||
|
import kotlinx.android.synthetic.main.message_list_item_out.view.cancel
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@@ -83,6 +91,13 @@ class MessagesAdapter @Inject constructor(
|
|||||||
private val textViewStyler: TextViewStyler
|
private val textViewStyler: TextViewStyler
|
||||||
) : QkRealmAdapter<Message>() {
|
) : QkRealmAdapter<Message>() {
|
||||||
|
|
||||||
|
class AudioState(
|
||||||
|
var partId: Long = -1,
|
||||||
|
var state: QkMediaPlayer.PlayingState = QkMediaPlayer.PlayingState.Stopped,
|
||||||
|
var seekBarUpdater: Disposable? = null,
|
||||||
|
var viewHolder: QkViewHolder? = null
|
||||||
|
)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val VIEW_TYPE_MESSAGE_IN = 0
|
private const val VIEW_TYPE_MESSAGE_IN = 0
|
||||||
private const val VIEW_TYPE_MESSAGE_OUT = 1
|
private const val VIEW_TYPE_MESSAGE_OUT = 1
|
||||||
@@ -96,7 +111,9 @@ class MessagesAdapter @Inject constructor(
|
|||||||
|
|
||||||
val clicks: Subject<Long> = PublishSubject.create()
|
val clicks: Subject<Long> = PublishSubject.create()
|
||||||
val partClicks: Subject<Long> = PublishSubject.create()
|
val partClicks: Subject<Long> = PublishSubject.create()
|
||||||
|
val messageLinkClicks: Subject<Uri> = PublishSubject.create()
|
||||||
val cancelSending: Subject<Long> = PublishSubject.create()
|
val cancelSending: Subject<Long> = PublishSubject.create()
|
||||||
|
val sendNow: Subject<Long> = PublishSubject.create()
|
||||||
|
|
||||||
var data: Pair<Conversation, RealmResults<Message>>? = null
|
var data: Pair<Conversation, RealmResults<Message>>? = null
|
||||||
set(value) {
|
set(value) {
|
||||||
@@ -127,11 +144,12 @@ class MessagesAdapter @Inject constructor(
|
|||||||
|
|
||||||
private val contactCache = ContactCache()
|
private val contactCache = ContactCache()
|
||||||
private val expanded = HashMap<Long, Boolean>()
|
private val expanded = HashMap<Long, Boolean>()
|
||||||
private val partsViewPool = RecyclerView.RecycledViewPool()
|
|
||||||
private val subs = subscriptionManager.activeSubscriptionInfoList
|
private val subs = subscriptionManager.activeSubscriptionInfoList
|
||||||
|
|
||||||
var theme: Colors.Theme = colors.theme()
|
var theme: Colors.Theme = colors.theme()
|
||||||
|
|
||||||
|
private val audioState = AudioState()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the viewType is negative, then the viewHolder has an attachment. We'll consider
|
* If the viewType is negative, then the viewHolder has an attachment. We'll consider
|
||||||
* this a unique viewType even though it uses the same view, so that regular messages
|
* this a unique viewType even though it uses the same view, so that regular messages
|
||||||
@@ -147,6 +165,7 @@ class MessagesAdapter @Inject constructor(
|
|||||||
view = layoutInflater.inflate(R.layout.message_list_item_out, parent, false)
|
view = layoutInflater.inflate(R.layout.message_list_item_out, parent, false)
|
||||||
view.findViewById<ImageView>(R.id.cancelIcon).setTint(theme.theme)
|
view.findViewById<ImageView>(R.id.cancelIcon).setTint(theme.theme)
|
||||||
view.findViewById<ProgressBar>(R.id.cancel).setTint(theme.theme)
|
view.findViewById<ProgressBar>(R.id.cancel).setTint(theme.theme)
|
||||||
|
view.findViewById<ImageView>(R.id.sendNowIcon).setTint(theme.theme)
|
||||||
} else {
|
} else {
|
||||||
view = layoutInflater.inflate(R.layout.message_list_item_in, parent, false)
|
view = layoutInflater.inflate(R.layout.message_list_item_in, parent, false)
|
||||||
}
|
}
|
||||||
@@ -156,8 +175,6 @@ class MessagesAdapter @Inject constructor(
|
|||||||
val partsAdapter = partsAdapterProvider.get()
|
val partsAdapter = partsAdapterProvider.get()
|
||||||
partsAdapter.clicks.subscribe(partClicks)
|
partsAdapter.clicks.subscribe(partClicks)
|
||||||
view.attachments.adapter = partsAdapter
|
view.attachments.adapter = partsAdapter
|
||||||
view.attachments.setRecycledViewPool(partsViewPool)
|
|
||||||
view.body.forwardTouches(view)
|
|
||||||
|
|
||||||
return QkViewHolder(view).apply {
|
return QkViewHolder(view).apply {
|
||||||
view.setOnClickListener {
|
view.setOnClickListener {
|
||||||
@@ -193,28 +210,42 @@ class MessagesAdapter @Inject constructor(
|
|||||||
// Update the selected state
|
// Update the selected state
|
||||||
holder.containerView.isActivated = isSelected(message.id) || highlight == message.id
|
holder.containerView.isActivated = isSelected(message.id) || highlight == message.id
|
||||||
|
|
||||||
// Bind the cancel view
|
// Bind the cancelFrame (cancel button) view
|
||||||
holder.cancel?.let { cancel ->
|
if (holder.cancelFrame != null) {
|
||||||
val isCancellable = message.isSending() && message.date > System.currentTimeMillis()
|
holder.cancelFrame.let { cancelFrame ->
|
||||||
cancel.setVisible(isCancellable)
|
val isCancellable = message.isSending() && message.date > System.currentTimeMillis()
|
||||||
cancel.clicks().subscribe { cancelSending.onNext(message.id) }
|
cancelFrame.visibility = if (isCancellable) View.VISIBLE else View.GONE
|
||||||
cancel.progress = 2
|
cancelFrame.clicks().subscribe { cancelSending.onNext(message.id) }
|
||||||
|
cancelFrame.cancel.progress = 2
|
||||||
|
|
||||||
if (isCancellable) {
|
if (isCancellable) {
|
||||||
val delay = when (prefs.sendDelay.get()) {
|
val delay = when (prefs.sendDelay.get()) {
|
||||||
Preferences.SEND_DELAY_SHORT -> 3000
|
Preferences.SEND_DELAY_SHORT -> 3000
|
||||||
Preferences.SEND_DELAY_MEDIUM -> 5000
|
Preferences.SEND_DELAY_MEDIUM -> 5000
|
||||||
Preferences.SEND_DELAY_LONG -> 10000
|
Preferences.SEND_DELAY_LONG -> 10000
|
||||||
else -> 0
|
else -> 0
|
||||||
}
|
}
|
||||||
val progress = (1 - (message.date - System.currentTimeMillis()) / delay.toFloat()) * 100
|
val progress =
|
||||||
|
(1 - (message.date - System.currentTimeMillis()) / delay.toFloat()) * 100
|
||||||
|
|
||||||
ObjectAnimator.ofInt(cancel, "progress", progress.toInt(), 100)
|
ObjectAnimator.ofInt(cancelFrame.cancel, "progress", progress.toInt(), 100)
|
||||||
.setDuration(message.date - System.currentTimeMillis())
|
.setDuration(message.date - System.currentTimeMillis())
|
||||||
.start()
|
.start()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bind the send now icon view
|
||||||
|
if (holder.sendNowIcon != null) {
|
||||||
|
holder.sendNowIcon.let { sendNowIcon ->
|
||||||
|
val isCancellable = message.isSending() && message.date > System.currentTimeMillis()
|
||||||
|
sendNowIcon.visibility = if (isCancellable) View.VISIBLE else View.GONE
|
||||||
|
sendNowIcon.clicks().subscribe { sendNow.onNext(message.id) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val cancelableSimpleOnGestureListener = holder.body.forwardTouches(holder.containerView)
|
||||||
|
|
||||||
// Bind the message status
|
// Bind the message status
|
||||||
bindStatus(holder, message, next)
|
bindStatus(holder, message, next)
|
||||||
|
|
||||||
@@ -272,8 +303,48 @@ class MessagesAdapter @Inject constructor(
|
|||||||
false -> TextViewStyler.SIZE_PRIMARY
|
false -> TextViewStyler.SIZE_PRIMARY
|
||||||
})
|
})
|
||||||
|
|
||||||
holder.body.text = messageText
|
val spanString = SpannableStringBuilder(messageText)
|
||||||
holder.body.setVisible(message.isSms() || messageText.isNotBlank())
|
|
||||||
|
when (prefs.messageLinkHandling.get()) {
|
||||||
|
Preferences.MESSAGE_LINK_HANDLING_BLOCK -> holder.body.autoLinkMask = 0
|
||||||
|
Preferences.MESSAGE_LINK_HANDLING_ASK -> {
|
||||||
|
// manually handle link clicks if user has set to ask before opening links
|
||||||
|
holder.body.isClickable = false
|
||||||
|
holder.body.linksClickable = false
|
||||||
|
holder.body.movementMethod = LinkMovementMethod.getInstance()
|
||||||
|
|
||||||
|
Linkify.addLinks(spanString, holder.body.autoLinkMask)
|
||||||
|
|
||||||
|
for (span in spanString.getSpans(
|
||||||
|
0,
|
||||||
|
spanString.length,
|
||||||
|
URLSpan::class.java)
|
||||||
|
) {
|
||||||
|
// set handler for when user touches a link into new span
|
||||||
|
spanString.setSpan(
|
||||||
|
object : ClickableSpan() {
|
||||||
|
override fun onClick(widget: View) {
|
||||||
|
messageLinkClicks.onNext(Uri.parse(span.url))
|
||||||
|
|
||||||
|
// interrupt the upcoming click event on the body view
|
||||||
|
cancelableSimpleOnGestureListener.cancelCurrentClick()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
spanString.getSpanStart(span),
|
||||||
|
spanString.getSpanEnd(span),
|
||||||
|
spanString.getSpanFlags(span)
|
||||||
|
)
|
||||||
|
|
||||||
|
// remove original span
|
||||||
|
spanString.removeSpan(span)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else -> holder.body.movementMethod = LinkMovementMethod.getInstance()
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.body.text = spanString
|
||||||
|
holder.body.setVisible(message.isSms() || spanString.isNotBlank())
|
||||||
|
|
||||||
holder.body.setBackgroundResource(getBubble(
|
holder.body.setBackgroundResource(getBubble(
|
||||||
emojiOnly = emojiOnly,
|
emojiOnly = emojiOnly,
|
||||||
canGroupWithPrevious = canGroup(message, previous) || media.isNotEmpty(),
|
canGroupWithPrevious = canGroup(message, previous) || media.isNotEmpty(),
|
||||||
@@ -283,7 +354,7 @@ class MessagesAdapter @Inject constructor(
|
|||||||
// Bind the attachments
|
// Bind the attachments
|
||||||
val partsAdapter = holder.attachments.adapter as PartsAdapter
|
val partsAdapter = holder.attachments.adapter as PartsAdapter
|
||||||
partsAdapter.theme = theme
|
partsAdapter.theme = theme
|
||||||
partsAdapter.setData(message, previous, next, holder)
|
partsAdapter.setData(message, previous, next, holder, audioState)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun bindStatus(holder: QkViewHolder, message: Message, next: Message?) {
|
private fun bindStatus(holder: QkViewHolder, message: Message, next: Message?) {
|
||||||
|
|||||||
@@ -33,16 +33,14 @@ import dev.octoshrimpy.quik.common.util.extensions.setBackgroundTint
|
|||||||
import dev.octoshrimpy.quik.common.util.extensions.setTint
|
import dev.octoshrimpy.quik.common.util.extensions.setTint
|
||||||
import dev.octoshrimpy.quik.common.widget.BubbleImageView
|
import dev.octoshrimpy.quik.common.widget.BubbleImageView
|
||||||
import dev.octoshrimpy.quik.extensions.isAudio
|
import dev.octoshrimpy.quik.extensions.isAudio
|
||||||
|
import dev.octoshrimpy.quik.feature.compose.MessagesAdapter
|
||||||
import dev.octoshrimpy.quik.model.Message
|
import dev.octoshrimpy.quik.model.Message
|
||||||
import dev.octoshrimpy.quik.model.MmsPart
|
import dev.octoshrimpy.quik.model.MmsPart
|
||||||
import dev.octoshrimpy.quik.util.GlideApp
|
import dev.octoshrimpy.quik.util.GlideApp
|
||||||
import io.reactivex.Observable
|
import io.reactivex.Observable
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.disposables.Disposable
|
|
||||||
import io.reactivex.schedulers.Schedulers
|
import io.reactivex.schedulers.Schedulers
|
||||||
import kotlinx.android.synthetic.main.mms_audio_preview_list_item.*
|
import kotlinx.android.synthetic.main.mms_audio_preview_list_item.*
|
||||||
import kotlinx.android.synthetic.main.mms_audio_preview_list_item.view.playPause
|
|
||||||
import kotlinx.android.synthetic.main.mms_audio_preview_list_item.view.seekBar
|
|
||||||
import kotlinx.android.synthetic.main.mms_image_preview_list_item.thumbnail
|
import kotlinx.android.synthetic.main.mms_image_preview_list_item.thumbnail
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@@ -53,91 +51,132 @@ class AudioBinder @Inject constructor(colors: Colors, private val context: Conte
|
|||||||
|
|
||||||
override val partLayout = R.layout.mms_audio_preview_list_item
|
override val partLayout = R.layout.mms_audio_preview_list_item
|
||||||
override var theme = colors.theme()
|
override var theme = colors.theme()
|
||||||
private var thisPlayingState = QkMediaPlayer.PlayingState.Stopped
|
|
||||||
|
|
||||||
override fun canBindPart(part: MmsPart) = part.isAudio()
|
override fun canBindPart(part: MmsPart) = part.isAudio()
|
||||||
|
|
||||||
|
var audioState = MessagesAdapter.AudioState(-1, QkMediaPlayer.PlayingState.Stopped)
|
||||||
|
|
||||||
|
private fun startSeekBarUpdateTimer() {
|
||||||
|
audioState.apply {
|
||||||
|
seekBarUpdater?.dispose()
|
||||||
|
seekBarUpdater = Observable.interval(500, TimeUnit.MILLISECONDS)
|
||||||
|
.subscribeOn(Schedulers.single())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.doOnNext {
|
||||||
|
viewHolder?.seekBar?.progress = QkMediaPlayer.currentPosition
|
||||||
|
}
|
||||||
|
.subscribe()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun uiToPlaying(viewHolder: QkViewHolder) {
|
||||||
|
viewHolder.seekBar.max = QkMediaPlayer.duration
|
||||||
|
viewHolder.seekBar.isEnabled = true
|
||||||
|
viewHolder.seekBar.progress = QkMediaPlayer.currentPosition
|
||||||
|
viewHolder.playPause.setImageResource(R.drawable.exo_icon_pause)
|
||||||
|
viewHolder.playPause.tag = QkMediaPlayer.PlayingState.Playing
|
||||||
|
viewHolder.metadataTitle.isSelected = true // start marquee
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun uiToPaused(viewHolder: QkViewHolder) {
|
||||||
|
viewHolder.playPause.setImageResource(R.drawable.exo_icon_play)
|
||||||
|
viewHolder.playPause.tag = QkMediaPlayer.PlayingState.Paused
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun uiToStopped(viewHolder: QkViewHolder) {
|
||||||
|
viewHolder.seekBar.progress = 0
|
||||||
|
viewHolder.seekBar.max = 0
|
||||||
|
viewHolder.seekBar.isEnabled = false
|
||||||
|
viewHolder.playPause.setImageResource(R.drawable.exo_icon_play)
|
||||||
|
viewHolder.playPause.tag = QkMediaPlayer.PlayingState.Stopped
|
||||||
|
viewHolder.metadataTitle.isSelected = false // stop marquee
|
||||||
|
}
|
||||||
|
|
||||||
override fun bindPart(
|
override fun bindPart(
|
||||||
holder: QkViewHolder,
|
holder: QkViewHolder,
|
||||||
part: MmsPart,
|
part: MmsPart,
|
||||||
message: Message,
|
message: Message,
|
||||||
canGroupWithPrevious: Boolean,
|
canGroupWithPrevious: Boolean,
|
||||||
canGroupWithNext: Boolean
|
canGroupWithNext: Boolean,
|
||||||
) {
|
) {
|
||||||
// play/pause button click handling
|
// play/pause button click handling
|
||||||
holder.playPause.setOnClickListener { view ->
|
holder.playPause.setOnClickListener {
|
||||||
var seekBarUpdater: Disposable? = null
|
when (holder.playPause.tag) {
|
||||||
|
QkMediaPlayer.PlayingState.Playing -> {
|
||||||
|
if (audioState.partId == part.id) {
|
||||||
|
QkMediaPlayer.pause()
|
||||||
|
uiToPaused(holder)
|
||||||
|
audioState.state = QkMediaPlayer.PlayingState.Paused
|
||||||
|
|
||||||
when (thisPlayingState) {
|
// stop progress bar update timer
|
||||||
QkMediaPlayer.PlayingState.Stopped -> {
|
audioState.seekBarUpdater?.dispose()
|
||||||
QkMediaPlayer.apply {
|
|
||||||
reset() // make sure reset before trying to (re-)use
|
|
||||||
|
|
||||||
setAudioAttributes(
|
|
||||||
AudioAttributes.Builder()
|
|
||||||
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC) // music, maybe?? could be voice. don't want to use CONTENT_TYPE_UNKNOWN though
|
|
||||||
.setUsage(AudioAttributes.USAGE_MEDIA)
|
|
||||||
.build()
|
|
||||||
)
|
|
||||||
|
|
||||||
setDataSource(context, part.getUri())
|
|
||||||
|
|
||||||
setOnPreparedListener {
|
|
||||||
// start timer to update seek bar
|
|
||||||
seekBarUpdater = Observable.interval(500, TimeUnit.MILLISECONDS)
|
|
||||||
.subscribeOn(Schedulers.single())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.map { System.nanoTime() }
|
|
||||||
.doOnNext { holder.seekBar.progress = QkMediaPlayer.currentPosition }
|
|
||||||
.subscribe()
|
|
||||||
|
|
||||||
// set seek bar max value
|
|
||||||
holder.seekBar.max = QkMediaPlayer.duration
|
|
||||||
|
|
||||||
start()
|
|
||||||
|
|
||||||
thisPlayingState = QkMediaPlayer.PlayingState.Playing
|
|
||||||
view.playPause.setImageResource(R.drawable.exo_icon_pause)
|
|
||||||
holder.containerView.seekBar.isEnabled = true
|
|
||||||
holder.metadataTitle.isSelected = true
|
|
||||||
}
|
|
||||||
|
|
||||||
setOnCompletionListener { // also called on error because we don't have an onerrorlistener
|
|
||||||
seekBarUpdater?.dispose() // stop timer
|
|
||||||
|
|
||||||
thisPlayingState = QkMediaPlayer.PlayingState.Stopped
|
|
||||||
holder.containerView.seekBar.seekBar.isEnabled = false
|
|
||||||
holder.containerView.seekBar.seekBar.progress = 0
|
|
||||||
view.playPause.setImageResource(R.drawable.exo_icon_play)
|
|
||||||
holder.metadataTitle.isSelected = false
|
|
||||||
}
|
|
||||||
|
|
||||||
// prepare to play
|
|
||||||
prepareAsync()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QkMediaPlayer.PlayingState.Playing -> {
|
|
||||||
QkMediaPlayer.pause()
|
|
||||||
view.playPause.setImageResource(R.drawable.exo_icon_play)
|
|
||||||
thisPlayingState = QkMediaPlayer.PlayingState.Paused
|
|
||||||
}
|
|
||||||
QkMediaPlayer.PlayingState.Paused -> {
|
QkMediaPlayer.PlayingState.Paused -> {
|
||||||
QkMediaPlayer.start()
|
if (audioState.partId == part.id) {
|
||||||
view.playPause.setImageResource(R.drawable.exo_icon_pause)
|
QkMediaPlayer.start()
|
||||||
thisPlayingState = QkMediaPlayer.PlayingState.Playing
|
uiToPlaying(holder)
|
||||||
|
audioState.state = QkMediaPlayer.PlayingState.Playing
|
||||||
|
|
||||||
|
// start progress bar update timer
|
||||||
|
startSeekBarUpdateTimer()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
QkMediaPlayer.reset() // make sure reset before trying to (re-)use
|
||||||
|
|
||||||
|
QkMediaPlayer.setOnPreparedListener {
|
||||||
|
// start media playing
|
||||||
|
QkMediaPlayer.start()
|
||||||
|
|
||||||
|
uiToPlaying(holder)
|
||||||
|
|
||||||
|
// set current view holder and part as active
|
||||||
|
audioState.apply {
|
||||||
|
audioState.state = QkMediaPlayer.PlayingState.Playing
|
||||||
|
partId = part.id
|
||||||
|
viewHolder = holder
|
||||||
|
}
|
||||||
|
|
||||||
|
// start progress bar update timer
|
||||||
|
startSeekBarUpdateTimer()
|
||||||
|
}
|
||||||
|
|
||||||
|
QkMediaPlayer.setOnCompletionListener { // also called on error because we don't have an onerrorlistener
|
||||||
|
audioState.apply {
|
||||||
|
// if this part is currently active, set it to stopped and inactive
|
||||||
|
if ((partId == part.id) && (viewHolder != null))
|
||||||
|
uiToStopped(viewHolder!!)
|
||||||
|
|
||||||
|
state = QkMediaPlayer.PlayingState.Stopped
|
||||||
|
partId = -1
|
||||||
|
viewHolder = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// start the media player play sequence
|
||||||
|
QkMediaPlayer.setAudioAttributes(
|
||||||
|
AudioAttributes.Builder()
|
||||||
|
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC) // music, maybe?? could be voice. don't want to use CONTENT_TYPE_UNKNOWN though
|
||||||
|
.setUsage(AudioAttributes.USAGE_MEDIA)
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
|
||||||
|
QkMediaPlayer.setDataSource(context, part.getUri())
|
||||||
|
|
||||||
|
QkMediaPlayer.prepareAsync()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.thumbnail.bubbleStyle = when {
|
holder.containerView.setOnClickListener { clicks.onNext(part.id) }
|
||||||
!canGroupWithPrevious && canGroupWithNext ->
|
|
||||||
if (message.isMe()) BubbleImageView.Style.OUT_FIRST else BubbleImageView.Style.IN_FIRST
|
// if this item is the active active audio item update the active view holder
|
||||||
canGroupWithPrevious && canGroupWithNext ->
|
if (audioState.partId == part.id)
|
||||||
if (message.isMe()) BubbleImageView.Style.OUT_MIDDLE else BubbleImageView.Style.IN_MIDDLE
|
audioState.viewHolder = holder
|
||||||
canGroupWithPrevious && !canGroupWithNext ->
|
// else, this is not the active item so ensure the stored view holder is not this one
|
||||||
if (message.isMe()) BubbleImageView.Style.OUT_LAST else BubbleImageView.Style.IN_LAST
|
else if (audioState.viewHolder == holder)
|
||||||
else -> BubbleImageView.Style.ONLY
|
audioState.viewHolder = null
|
||||||
}
|
|
||||||
|
|
||||||
// tint colours
|
// tint colours
|
||||||
val secondaryColor =
|
val secondaryColor =
|
||||||
@@ -151,9 +190,6 @@ class AudioBinder @Inject constructor(colors: Colors, private val context: Conte
|
|||||||
else
|
else
|
||||||
holder.containerView.context.resolveThemeColor(android.R.attr.textColorPrimary)
|
holder.containerView.context.resolveThemeColor(android.R.attr.textColorPrimary)
|
||||||
|
|
||||||
val metaDataRetriever = MediaMetadataRetriever()
|
|
||||||
metaDataRetriever.setDataSource(context, part.getUri())
|
|
||||||
|
|
||||||
// sound wave
|
// sound wave
|
||||||
holder.soundWave.setTint(primaryColor)
|
holder.soundWave.setTint(primaryColor)
|
||||||
|
|
||||||
@@ -161,11 +197,11 @@ class AudioBinder @Inject constructor(colors: Colors, private val context: Conte
|
|||||||
holder.seekBar.apply {
|
holder.seekBar.apply {
|
||||||
setTint(secondaryColor)
|
setTint(secondaryColor)
|
||||||
thumbTintList = ColorStateList.valueOf(secondaryColor)
|
thumbTintList = ColorStateList.valueOf(secondaryColor)
|
||||||
max = 0
|
|
||||||
isEnabled = false
|
|
||||||
setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
|
||||||
override fun onProgressChanged(p0: SeekBar?, progress: Int, fromUser: Boolean) {
|
override fun onProgressChanged(p0: SeekBar?, progress: Int, fromUser: Boolean) {
|
||||||
if ((thisPlayingState != QkMediaPlayer.PlayingState.Stopped) && fromUser)
|
// if seek was initiated by the user and this part is currently playing
|
||||||
|
if (fromUser)
|
||||||
QkMediaPlayer.seekTo(progress)
|
QkMediaPlayer.seekTo(progress)
|
||||||
}
|
}
|
||||||
override fun onStartTrackingTouch(p0: SeekBar?) { /* nothing */ }
|
override fun onStartTrackingTouch(p0: SeekBar?) { /* nothing */ }
|
||||||
@@ -175,35 +211,65 @@ class AudioBinder @Inject constructor(colors: Colors, private val context: Conte
|
|||||||
|
|
||||||
// playPause button
|
// playPause button
|
||||||
holder.playPause. apply {
|
holder.playPause. apply {
|
||||||
|
if ((audioState.partId == part.id) &&
|
||||||
|
(audioState.state == QkMediaPlayer.PlayingState.Playing))
|
||||||
|
uiToPlaying(holder)
|
||||||
|
else if ((audioState.partId == part.id) &&
|
||||||
|
(audioState.state == QkMediaPlayer.PlayingState.Paused))
|
||||||
|
uiToPaused(holder)
|
||||||
|
else
|
||||||
|
uiToStopped(holder)
|
||||||
|
|
||||||
setTint(secondaryColor)
|
setTint(secondaryColor)
|
||||||
setBackgroundTint(primaryColor)
|
setBackgroundTint(primaryColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.metadataTitle.apply {
|
MediaMetadataRetriever().use {
|
||||||
// metadata title
|
it.setDataSource(context, part.getUri())
|
||||||
text = metaDataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE) ?: ""
|
|
||||||
|
|
||||||
if (text == "")
|
// metadata title
|
||||||
visibility = View.GONE
|
holder.metadataTitle.apply {
|
||||||
else {
|
text = it.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE)
|
||||||
setTextColor(primaryColor)
|
|
||||||
setBackgroundTint(0xccffffff.toInt() and secondaryColor) // hex value is alpha
|
if (text.isEmpty())
|
||||||
|
visibility = View.GONE
|
||||||
|
else {
|
||||||
|
visibility = View.VISIBLE
|
||||||
|
setTextColor(primaryColor)
|
||||||
|
setBackgroundTint(0xccffffff.toInt() and secondaryColor) // hex value is alpha
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// bubble / embedded image
|
||||||
|
holder.thumbnail.apply {
|
||||||
|
bubbleStyle = when {
|
||||||
|
!canGroupWithPrevious && canGroupWithNext ->
|
||||||
|
if (message.isMe()) BubbleImageView.Style.OUT_FIRST else BubbleImageView.Style.IN_FIRST
|
||||||
|
canGroupWithPrevious && canGroupWithNext ->
|
||||||
|
if (message.isMe()) BubbleImageView.Style.OUT_MIDDLE else BubbleImageView.Style.IN_MIDDLE
|
||||||
|
canGroupWithPrevious && !canGroupWithNext ->
|
||||||
|
if (message.isMe()) BubbleImageView.Style.OUT_LAST else BubbleImageView.Style.IN_LAST
|
||||||
|
else -> BubbleImageView.Style.ONLY
|
||||||
|
}
|
||||||
|
|
||||||
|
val embeddedPicture = it.embeddedPicture
|
||||||
|
if (embeddedPicture == null) {
|
||||||
|
holder.frame.layoutParams.height = (holder.frame.layoutParams.width / 2)
|
||||||
|
setTint(secondaryColor)
|
||||||
|
setImageResource(R.drawable.rectangle)
|
||||||
|
} else {
|
||||||
|
holder.frame.layoutParams.height = holder.frame.layoutParams.width
|
||||||
|
setTint(null)
|
||||||
|
GlideApp.with(context)
|
||||||
|
.asBitmap()
|
||||||
|
.load(embeddedPicture)
|
||||||
|
.override(
|
||||||
|
holder.frame.layoutParams.width,
|
||||||
|
holder.frame.layoutParams.height
|
||||||
|
)
|
||||||
|
.into(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// embedded image
|
|
||||||
val embeddedPicture = metaDataRetriever.embeddedPicture
|
|
||||||
if (embeddedPicture == null) {
|
|
||||||
holder.thumbnail.setTint(secondaryColor)
|
|
||||||
holder.frame.layoutParams.height /= 2
|
|
||||||
holder.thumbnail.requestLayout()
|
|
||||||
} else {
|
|
||||||
GlideApp.with(context)
|
|
||||||
.asBitmap()
|
|
||||||
.load(embeddedPicture)
|
|
||||||
.into(holder.thumbnail)
|
|
||||||
}
|
|
||||||
|
|
||||||
metaDataRetriever.close()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,6 +28,7 @@ import dev.octoshrimpy.quik.common.util.extensions.forwardTouches
|
|||||||
import dev.octoshrimpy.quik.extensions.isSmil
|
import dev.octoshrimpy.quik.extensions.isSmil
|
||||||
import dev.octoshrimpy.quik.extensions.isText
|
import dev.octoshrimpy.quik.extensions.isText
|
||||||
import dev.octoshrimpy.quik.feature.compose.BubbleUtils.canGroup
|
import dev.octoshrimpy.quik.feature.compose.BubbleUtils.canGroup
|
||||||
|
import dev.octoshrimpy.quik.feature.compose.MessagesAdapter
|
||||||
import dev.octoshrimpy.quik.model.Message
|
import dev.octoshrimpy.quik.model.Message
|
||||||
import dev.octoshrimpy.quik.model.MmsPart
|
import dev.octoshrimpy.quik.model.MmsPart
|
||||||
import io.reactivex.Observable
|
import io.reactivex.Observable
|
||||||
@@ -39,7 +40,7 @@ class PartsAdapter @Inject constructor(
|
|||||||
fileBinder: FileBinder,
|
fileBinder: FileBinder,
|
||||||
imageBinder: ImageBinder,
|
imageBinder: ImageBinder,
|
||||||
audioBinder: AudioBinder,
|
audioBinder: AudioBinder,
|
||||||
vCardBinder: VCardBinder
|
vCardBinder: VCardBinder,
|
||||||
) : QkAdapter<MmsPart>() {
|
) : QkAdapter<MmsPart>() {
|
||||||
|
|
||||||
private val partBinders = listOf(audioBinder, imageBinder, vCardBinder, fileBinder)
|
private val partBinders = listOf(audioBinder, imageBinder, vCardBinder, fileBinder)
|
||||||
@@ -57,14 +58,22 @@ class PartsAdapter @Inject constructor(
|
|||||||
private var next: Message? = null
|
private var next: Message? = null
|
||||||
private var holder: QkViewHolder? = null
|
private var holder: QkViewHolder? = null
|
||||||
private var bodyVisible: Boolean = true
|
private var bodyVisible: Boolean = true
|
||||||
|
private var audioState: MessagesAdapter.AudioState? = null
|
||||||
|
|
||||||
fun setData(message: Message, previous: Message?, next: Message?, holder: QkViewHolder) {
|
fun setData(
|
||||||
|
message: Message,
|
||||||
|
previous: Message?,
|
||||||
|
next: Message?,
|
||||||
|
holder: QkViewHolder,
|
||||||
|
audioState: MessagesAdapter.AudioState?
|
||||||
|
) {
|
||||||
this.message = message
|
this.message = message
|
||||||
this.previous = previous
|
this.previous = previous
|
||||||
this.next = next
|
this.next = next
|
||||||
this.holder = holder
|
this.holder = holder
|
||||||
this.bodyVisible = holder.body.visibility == View.VISIBLE
|
this.bodyVisible = holder.body.visibility == View.VISIBLE
|
||||||
this.data = message.parts.filter { !it.isSmil() && !it.isText() }
|
this.data = message.parts.filter { !it.isSmil() && !it.isText() }
|
||||||
|
this.audioState = audioState
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QkViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QkViewHolder {
|
||||||
@@ -80,9 +89,13 @@ class PartsAdapter @Inject constructor(
|
|||||||
val canGroupWithPrevious = canGroup(message, previous) || position > 0
|
val canGroupWithPrevious = canGroup(message, previous) || position > 0
|
||||||
val canGroupWithNext = canGroup(message, next) || position < itemCount - 1 || bodyVisible
|
val canGroupWithNext = canGroup(message, next) || position < itemCount - 1 || bodyVisible
|
||||||
|
|
||||||
partBinders
|
val binder = partBinders.firstOrNull { it.canBindPart(part) }
|
||||||
.firstOrNull { it.canBindPart(part) }
|
|
||||||
?.bindPart(holder, part, message, canGroupWithPrevious, canGroupWithNext)
|
// if audioState is set and binder is audio type, set audioState into it
|
||||||
|
if ((audioState != null) && (binder is AudioBinder))
|
||||||
|
binder.audioState = audioState!!
|
||||||
|
|
||||||
|
binder?.bindPart(holder, part, message, canGroupWithPrevious, canGroupWithNext)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getItemViewType(position: Int): Int {
|
override fun getItemViewType(position: Int): Int {
|
||||||
|
|||||||
+2
@@ -99,6 +99,8 @@ class NotificationPrefsActivity : QkThemedActivity(), NotificationPrefsView {
|
|||||||
previews.summary = state.previewSummary
|
previews.summary = state.previewSummary
|
||||||
previewModeDialog.adapter.selectedItem = state.previewId
|
previewModeDialog.adapter.selectedItem = state.previewId
|
||||||
wake.checkbox.isChecked = state.wakeEnabled
|
wake.checkbox.isChecked = state.wakeEnabled
|
||||||
|
silentNotContact.checkbox.isChecked = state.silentNotContact
|
||||||
|
silentNotContact.isVisible = state.threadId == 0L
|
||||||
vibration.checkbox.isChecked = state.vibrationEnabled
|
vibration.checkbox.isChecked = state.vibrationEnabled
|
||||||
ringtone.summary = state.ringtoneName
|
ringtone.summary = state.ringtoneName
|
||||||
|
|
||||||
|
|||||||
+1
@@ -28,6 +28,7 @@ data class NotificationPrefsState(
|
|||||||
val previewSummary: String = "",
|
val previewSummary: String = "",
|
||||||
val previewId: Int = Preferences.NOTIFICATION_PREVIEWS_ALL,
|
val previewId: Int = Preferences.NOTIFICATION_PREVIEWS_ALL,
|
||||||
val wakeEnabled: Boolean = false,
|
val wakeEnabled: Boolean = false,
|
||||||
|
val silentNotContact: Boolean = false,
|
||||||
val action1Summary: String = "",
|
val action1Summary: String = "",
|
||||||
val action2Summary: String = "",
|
val action2Summary: String = "",
|
||||||
val action3Summary: String = "",
|
val action3Summary: String = "",
|
||||||
|
|||||||
+5
@@ -79,6 +79,9 @@ class NotificationPrefsViewModel @Inject constructor(
|
|||||||
disposables += wake.asObservable()
|
disposables += wake.asObservable()
|
||||||
.subscribe { enabled -> newState { copy(wakeEnabled = enabled) } }
|
.subscribe { enabled -> newState { copy(wakeEnabled = enabled) } }
|
||||||
|
|
||||||
|
disposables += prefs.silentNotContact.asObservable()
|
||||||
|
.subscribe { enabled -> newState { copy(silentNotContact = enabled) } }
|
||||||
|
|
||||||
disposables += vibration.asObservable()
|
disposables += vibration.asObservable()
|
||||||
.subscribe { enabled -> newState { copy(vibrationEnabled = enabled) } }
|
.subscribe { enabled -> newState { copy(vibrationEnabled = enabled) } }
|
||||||
|
|
||||||
@@ -113,6 +116,8 @@ class NotificationPrefsViewModel @Inject constructor(
|
|||||||
|
|
||||||
R.id.wake -> wake.set(!wake.get())
|
R.id.wake -> wake.set(!wake.get())
|
||||||
|
|
||||||
|
R.id.silentNotContact -> prefs.silentNotContact.set(!prefs.silentNotContact.get())
|
||||||
|
|
||||||
R.id.vibration -> vibration.set(!vibration.get())
|
R.id.vibration -> vibration.set(!vibration.get())
|
||||||
|
|
||||||
R.id.ringtone -> view.showRingtonePicker(ringtone.get().takeIf { it.isNotEmpty() }?.let(Uri::parse))
|
R.id.ringtone -> view.showRingtonePicker(ringtone.get().takeIf { it.isNotEmpty() }?.let(Uri::parse))
|
||||||
|
|||||||
+89
-9
@@ -19,32 +19,112 @@
|
|||||||
package dev.octoshrimpy.quik.feature.scheduled
|
package dev.octoshrimpy.quik.feature.scheduled
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.media.MediaMetadataRetriever
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
import android.provider.MediaStore.MATCH_DEFAULT
|
||||||
|
import android.provider.OpenableColumns
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import com.bumptech.glide.Glide
|
||||||
import dev.octoshrimpy.quik.R
|
import dev.octoshrimpy.quik.R
|
||||||
import dev.octoshrimpy.quik.common.base.QkAdapter
|
import dev.octoshrimpy.quik.common.base.QkAdapter
|
||||||
import dev.octoshrimpy.quik.common.base.QkViewHolder
|
import dev.octoshrimpy.quik.common.base.QkViewHolder
|
||||||
import dev.octoshrimpy.quik.util.GlideApp
|
import dev.octoshrimpy.quik.extensions.resourceExists
|
||||||
import kotlinx.android.synthetic.main.attachment_image_list_item.view.*
|
import kotlinx.android.synthetic.main.scheduled_message_image_list_item.fileName
|
||||||
import kotlinx.android.synthetic.main.scheduled_message_image_list_item.*
|
import kotlinx.android.synthetic.main.scheduled_message_image_list_item.thumbnail
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
|
||||||
class ScheduledMessageAttachmentAdapter @Inject constructor(
|
class ScheduledMessageAttachmentAdapter @Inject constructor(
|
||||||
private val context: Context
|
private val context: Context
|
||||||
) : QkAdapter<Uri>() {
|
) : QkAdapter<Uri>() {
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QkViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QkViewHolder {
|
||||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.scheduled_message_image_list_item, parent, false)
|
return QkViewHolder(
|
||||||
view.thumbnail.clipToOutline = true
|
LayoutInflater
|
||||||
|
.from(parent.context)
|
||||||
return QkViewHolder(view)
|
.inflate(R.layout.scheduled_message_image_list_item, parent, false)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: QkViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: QkViewHolder, position: Int) {
|
||||||
val attachment = getItem(position)
|
val uri = getItem(position)
|
||||||
|
|
||||||
GlideApp.with(context).load(attachment).into(holder.thumbnail)
|
// if uri target doesn't exist anymore
|
||||||
|
if (!uri.resourceExists(context)) {
|
||||||
|
holder.thumbnail.setImageResource(android.R.drawable.ic_delete)
|
||||||
|
holder.fileName.text = context.getString(R.string.attachment_missing)
|
||||||
|
holder.fileName.visibility = View.VISIBLE
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val mimeType = context.contentResolver.getType(uri)
|
||||||
|
|
||||||
|
// if attachment mime type is image/* or video/*, use image/video-frame
|
||||||
|
if ((mimeType?.startsWith("image/") == true) ||
|
||||||
|
(mimeType?.startsWith("video/") == true)
|
||||||
|
) {
|
||||||
|
Glide
|
||||||
|
.with(context)
|
||||||
|
.load(uri)
|
||||||
|
.into(holder.thumbnail)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// if audio mime type, try and use embedded image if one exists
|
||||||
|
if (mimeType?.startsWith("audio/") == true) {
|
||||||
|
val metaDataRetriever = MediaMetadataRetriever()
|
||||||
|
metaDataRetriever.setDataSource(context, uri)
|
||||||
|
val embeddedPicture = metaDataRetriever.embeddedPicture
|
||||||
|
if (embeddedPicture != null) {
|
||||||
|
Glide
|
||||||
|
.with(context)
|
||||||
|
.load(embeddedPicture)
|
||||||
|
.into(holder.thumbnail)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// try and use icon from default app for type
|
||||||
|
val intent = Intent(Intent.ACTION_VIEW).setDataAndType(uri, mimeType)
|
||||||
|
val appIcon = context
|
||||||
|
.packageManager
|
||||||
|
.resolveActivity(intent, MATCH_DEFAULT)
|
||||||
|
?.loadIcon(context.packageManager)
|
||||||
|
if (appIcon != null)
|
||||||
|
Glide
|
||||||
|
.with(context)
|
||||||
|
.load(appIcon)
|
||||||
|
.into(holder.thumbnail)
|
||||||
|
else if (mimeType?.startsWith("audio/") == true)
|
||||||
|
// else, if audio, use default local audio icon
|
||||||
|
Glide
|
||||||
|
.with(context)
|
||||||
|
.load(R.drawable.ic_round_volume_up_24)
|
||||||
|
.into(holder.thumbnail)
|
||||||
|
else
|
||||||
|
// else, use default attachment icon
|
||||||
|
Glide
|
||||||
|
.with(context)
|
||||||
|
.load(R.drawable.ic_attachment_black_24dp)
|
||||||
|
.into(holder.thumbnail)
|
||||||
|
|
||||||
|
// else, show file name
|
||||||
|
val cursor = context.contentResolver.query(
|
||||||
|
uri, arrayOf(OpenableColumns.DISPLAY_NAME), null, null, null
|
||||||
|
)
|
||||||
|
cursor?.use {
|
||||||
|
try {
|
||||||
|
cursor.moveToFirst()
|
||||||
|
holder.fileName.text = cursor.getString(
|
||||||
|
cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME) ?: 0
|
||||||
|
)
|
||||||
|
holder.fileName.visibility = View.VISIBLE
|
||||||
|
} catch (e: Exception) {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class ScheduledViewModel @Inject constructor(
|
|||||||
|
|
||||||
view.composeIntent
|
view.composeIntent
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
.subscribe { navigator.showCompose() }
|
.subscribe { navigator.showCompose(mode = "scheduling") }
|
||||||
|
|
||||||
view.upgradeIntent
|
view.upgradeIntent
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ import dev.octoshrimpy.quik.common.util.extensions.animateLayoutChanges
|
|||||||
import dev.octoshrimpy.quik.common.util.extensions.setBackgroundTint
|
import dev.octoshrimpy.quik.common.util.extensions.setBackgroundTint
|
||||||
import dev.octoshrimpy.quik.common.util.extensions.setVisible
|
import dev.octoshrimpy.quik.common.util.extensions.setVisible
|
||||||
import dev.octoshrimpy.quik.common.widget.PreferenceView
|
import dev.octoshrimpy.quik.common.widget.PreferenceView
|
||||||
import dev.octoshrimpy.quik.common.widget.QkSwitch
|
|
||||||
import dev.octoshrimpy.quik.common.widget.TextInputDialog
|
import dev.octoshrimpy.quik.common.widget.TextInputDialog
|
||||||
import dev.octoshrimpy.quik.feature.settings.about.AboutController
|
import dev.octoshrimpy.quik.feature.settings.about.AboutController
|
||||||
import dev.octoshrimpy.quik.feature.settings.autodelete.AutoDeleteDialog
|
import dev.octoshrimpy.quik.feature.settings.autodelete.AutoDeleteDialog
|
||||||
@@ -73,6 +72,7 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
|
|||||||
@Inject lateinit var textSizeDialog: QkDialog
|
@Inject lateinit var textSizeDialog: QkDialog
|
||||||
@Inject lateinit var sendDelayDialog: QkDialog
|
@Inject lateinit var sendDelayDialog: QkDialog
|
||||||
@Inject lateinit var mmsSizeDialog: QkDialog
|
@Inject lateinit var mmsSizeDialog: QkDialog
|
||||||
|
@Inject lateinit var messageLinkHandlingDialog: QkDialog
|
||||||
|
|
||||||
@Inject override lateinit var presenter: SettingsPresenter
|
@Inject override lateinit var presenter: SettingsPresenter
|
||||||
|
|
||||||
@@ -113,6 +113,7 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
|
|||||||
textSizeDialog.adapter.setData(R.array.text_sizes)
|
textSizeDialog.adapter.setData(R.array.text_sizes)
|
||||||
sendDelayDialog.adapter.setData(R.array.delayed_sending_labels)
|
sendDelayDialog.adapter.setData(R.array.delayed_sending_labels)
|
||||||
mmsSizeDialog.adapter.setData(R.array.mms_sizes, R.array.mms_sizes_ids)
|
mmsSizeDialog.adapter.setData(R.array.mms_sizes, R.array.mms_sizes_ids)
|
||||||
|
messageLinkHandlingDialog.adapter.setData(R.array.messageLinkHandlings, R.array.messageLinkHandling_ids)
|
||||||
|
|
||||||
about.summary = context.getString(R.string.settings_version, BuildConfig.VERSION_NAME)
|
about.summary = context.getString(R.string.settings_version, BuildConfig.VERSION_NAME)
|
||||||
}
|
}
|
||||||
@@ -150,6 +151,8 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
|
|||||||
|
|
||||||
override fun mmsSizeSelected(): Observable<Int> = mmsSizeDialog.adapter.menuItemClicks
|
override fun mmsSizeSelected(): Observable<Int> = mmsSizeDialog.adapter.menuItemClicks
|
||||||
|
|
||||||
|
override fun messageLinkHandlingSelected(): Observable<Int> = messageLinkHandlingDialog.adapter.menuItemClicks
|
||||||
|
|
||||||
override fun render(state: SettingsState) {
|
override fun render(state: SettingsState) {
|
||||||
themePreview.setBackgroundTint(state.theme)
|
themePreview.setBackgroundTint(state.theme)
|
||||||
night.summary = state.nightModeSummary
|
night.summary = state.nightModeSummary
|
||||||
@@ -195,6 +198,9 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
|
|||||||
mmsSize.summary = state.maxMmsSizeSummary
|
mmsSize.summary = state.maxMmsSizeSummary
|
||||||
mmsSizeDialog.adapter.selectedItem = state.maxMmsSizeId
|
mmsSizeDialog.adapter.selectedItem = state.maxMmsSizeId
|
||||||
|
|
||||||
|
messsageLinkHandling.summary = state.messageLinkHandlingSummary
|
||||||
|
messageLinkHandlingDialog.adapter.selectedItem = state.messageLinkHandlingId
|
||||||
|
|
||||||
when (state.syncProgress) {
|
when (state.syncProgress) {
|
||||||
is SyncRepository.SyncProgress.Idle -> syncingProgress.isVisible = false
|
is SyncRepository.SyncProgress.Idle -> syncingProgress.isVisible = false
|
||||||
|
|
||||||
@@ -254,6 +260,8 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
|
|||||||
|
|
||||||
override fun showMmsSizePicker() = mmsSizeDialog.show(activity!!)
|
override fun showMmsSizePicker() = mmsSizeDialog.show(activity!!)
|
||||||
|
|
||||||
|
override fun showMessageLinkHandlingDialogPicker() = messageLinkHandlingDialog.show(activity!!)
|
||||||
|
|
||||||
override fun showSwipeActions() {
|
override fun showSwipeActions() {
|
||||||
router.pushController(RouterTransaction.with(SwipeActionsController())
|
router.pushController(RouterTransaction.with(SwipeActionsController())
|
||||||
.pushChangeHandler(QkChangeHandler())
|
.pushChangeHandler(QkChangeHandler())
|
||||||
|
|||||||
@@ -138,6 +138,19 @@ class SettingsPresenter @Inject constructor(
|
|||||||
newState { copy(maxMmsSizeSummary = mmsSizeLabels[index], maxMmsSizeId = maxMmsSize) }
|
newState { copy(maxMmsSizeSummary = mmsSizeLabels[index], maxMmsSizeId = maxMmsSize) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val messageLinkHandlingLabels = context.resources.getStringArray(R.array.messageLinkHandlings)
|
||||||
|
val messageLinkHandlingIds = context.resources.getIntArray(R.array.messageLinkHandling_ids)
|
||||||
|
disposables += prefs.messageLinkHandling.asObservable()
|
||||||
|
.subscribe { messageLinkHandlingId ->
|
||||||
|
val index = messageLinkHandlingIds.indexOf(messageLinkHandlingId)
|
||||||
|
newState {
|
||||||
|
copy(
|
||||||
|
messageLinkHandlingSummary = messageLinkHandlingLabels[index],
|
||||||
|
messageLinkHandlingId = messageLinkHandlingId
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
disposables += syncRepo.syncProgress
|
disposables += syncRepo.syncProgress
|
||||||
.sample(16, TimeUnit.MILLISECONDS)
|
.sample(16, TimeUnit.MILLISECONDS)
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
@@ -204,6 +217,8 @@ class SettingsPresenter @Inject constructor(
|
|||||||
|
|
||||||
R.id.mmsSize -> view.showMmsSizePicker()
|
R.id.mmsSize -> view.showMmsSizePicker()
|
||||||
|
|
||||||
|
R.id.messsageLinkHandling -> view.showMessageLinkHandlingDialogPicker()
|
||||||
|
|
||||||
R.id.sync -> syncMessages.execute(Unit)
|
R.id.sync -> syncMessages.execute(Unit)
|
||||||
|
|
||||||
R.id.about -> view.showAbout()
|
R.id.about -> view.showAbout()
|
||||||
@@ -294,6 +309,10 @@ class SettingsPresenter @Inject constructor(
|
|||||||
view.mmsSizeSelected()
|
view.mmsSizeSelected()
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
.subscribe(prefs.mmsSize::set)
|
.subscribe(prefs.mmsSize::set)
|
||||||
|
|
||||||
|
view.messageLinkHandlingSelected()
|
||||||
|
.autoDisposable(view.scope())
|
||||||
|
.subscribe(prefs.messageLinkHandling::set)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -46,5 +46,7 @@ data class SettingsState(
|
|||||||
val longAsMms: Boolean = false,
|
val longAsMms: Boolean = false,
|
||||||
val maxMmsSizeSummary: String = "100KB",
|
val maxMmsSizeSummary: String = "100KB",
|
||||||
val maxMmsSizeId: Int = 100,
|
val maxMmsSizeId: Int = 100,
|
||||||
|
val messageLinkHandlingSummary: String = "Ask before opening",
|
||||||
|
val messageLinkHandlingId: Int = 2,
|
||||||
val syncProgress: SyncRepository.SyncProgress = SyncRepository.SyncProgress.Idle
|
val syncProgress: SyncRepository.SyncProgress = SyncRepository.SyncProgress.Idle
|
||||||
)
|
)
|
||||||
@@ -34,6 +34,7 @@ interface SettingsView : QkViewContract<SettingsState> {
|
|||||||
fun signatureChanged(): Observable<String>
|
fun signatureChanged(): Observable<String>
|
||||||
fun autoDeleteChanged(): Observable<Int>
|
fun autoDeleteChanged(): Observable<Int>
|
||||||
fun mmsSizeSelected(): Observable<Int>
|
fun mmsSizeSelected(): Observable<Int>
|
||||||
|
fun messageLinkHandlingSelected(): Observable<Int>
|
||||||
|
|
||||||
fun showQksmsPlusSnackbar()
|
fun showQksmsPlusSnackbar()
|
||||||
fun showNightModeDialog()
|
fun showNightModeDialog()
|
||||||
@@ -45,6 +46,7 @@ interface SettingsView : QkViewContract<SettingsState> {
|
|||||||
fun showAutoDeleteDialog(days: Int)
|
fun showAutoDeleteDialog(days: Int)
|
||||||
suspend fun showAutoDeleteWarningDialog(messages: Int): Boolean
|
suspend fun showAutoDeleteWarningDialog(messages: Int): Boolean
|
||||||
fun showMmsSizePicker()
|
fun showMmsSizePicker()
|
||||||
|
fun showMessageLinkHandlingDialogPicker()
|
||||||
fun showSwipeActions()
|
fun showSwipeActions()
|
||||||
fun showThemePicker()
|
fun showThemePicker()
|
||||||
fun showAbout()
|
fun showAbout()
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 52 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||||
|
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M3,10v4c0,0.55 0.45,1 1,1h3l3.29,3.29c0.63,0.63 1.71,0.18 1.71,-0.71L12,6.41c0,-0.89 -1.08,-1.34 -1.71,-0.71L7,9L4,9c-0.55,0 -1,0.45 -1,1zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,4.45v0.2c0,0.38 0.25,0.71 0.6,0.85C17.18,6.53 19,9.06 19,12s-1.82,5.47 -4.4,6.5c-0.36,0.14 -0.6,0.47 -0.6,0.85v0.2c0,0.63 0.63,1.07 1.21,0.85C18.6,19.11 21,15.84 21,12s-2.4,-7.11 -5.79,-8.4c-0.58,-0.23 -1.21,0.22 -1.21,0.85z"/>
|
||||||
|
|
||||||
|
</vector>
|
||||||
+11
-1
@@ -37,7 +37,17 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
tools:src="@tools:sample/avatars" />
|
tools:src="@tools:sample/backgrounds/scenic[0]" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/fileName"
|
||||||
|
style="@style/TextPrimary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#ddffffff"
|
||||||
|
android:gravity="center"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
@@ -32,8 +32,6 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="12dp"
|
||||||
android:clipChildren="false"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
app:layout_constraintBottom_toTopOf="@id/messageBackground"
|
app:layout_constraintBottom_toTopOf="@id/messageBackground"
|
||||||
@@ -204,7 +202,7 @@
|
|||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:src="@drawable/ic_cancel_black_24dp"
|
android:src="@drawable/ic_cancel_black_24dp"
|
||||||
android:tint="?android:attr/textColorSecondary"
|
app:tint="?android:attr/textColorSecondary"
|
||||||
app:layout_constraintBottom_toTopOf="@id/scheduledSeparator"
|
app:layout_constraintBottom_toTopOf="@id/scheduledSeparator"
|
||||||
app:layout_constraintEnd_toEndOf="@id/messageBackground" />
|
app:layout_constraintEnd_toEndOf="@id/messageBackground" />
|
||||||
|
|
||||||
@@ -230,7 +228,7 @@
|
|||||||
app:layout_constraintBottom_toTopOf="@id/message"
|
app:layout_constraintBottom_toTopOf="@id/message"
|
||||||
app:layout_constraintEnd_toEndOf="@id/messageBackground"
|
app:layout_constraintEnd_toEndOf="@id/messageBackground"
|
||||||
app:layout_constraintStart_toStartOf="@id/messageBackground"
|
app:layout_constraintStart_toStartOf="@id/messageBackground"
|
||||||
tools:listitem="@layout/attachment_image_list_item" />
|
tools:listitem="@layout/attachment_file_list_item" />
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.QkEditText
|
<dev.octoshrimpy.quik.common.widget.QkEditText
|
||||||
android:id="@+id/message"
|
android:id="@+id/message"
|
||||||
@@ -262,7 +260,7 @@
|
|||||||
android:contentDescription="@string/compose_sim_cd"
|
android:contentDescription="@string/compose_sim_cd"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:src="@drawable/ic_sim_card_black_24dp"
|
android:src="@drawable/ic_sim_card_black_24dp"
|
||||||
android:tint="?android:attr/textColorSecondary"
|
app:tint="?android:attr/textColorSecondary"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/messageBackground"
|
app:layout_constraintBottom_toBottomOf="@id/messageBackground"
|
||||||
app:layout_constraintEnd_toEndOf="@id/messageBackground" />
|
app:layout_constraintEnd_toEndOf="@id/messageBackground" />
|
||||||
@@ -304,7 +302,7 @@
|
|||||||
android:contentDescription="@string/compose_send_cd"
|
android:contentDescription="@string/compose_send_cd"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:src="@drawable/ic_send_black_24dp"
|
android:src="@drawable/ic_send_black_24dp"
|
||||||
android:tint="?android:textColorSecondary"
|
app:tint="?android:textColorSecondary"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/messageBackground"
|
app:layout_constraintBottom_toBottomOf="@id/messageBackground"
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
@@ -371,7 +369,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:constraint_referenced_ids="contact,contactLabel,schedule,scheduleLabel,gallery,galleryLabel,camera,cameraLabel,attachingBackground" />
|
app:constraint_referenced_ids="contact,contactLabel,schedule,scheduleLabel,gallery,galleryLabel,attachAFileIcon,attachAFileLabel,camera,cameraLabel,attachingBackground" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/attachingBackground"
|
android:id="@+id/attachingBackground"
|
||||||
@@ -395,7 +393,7 @@
|
|||||||
android:elevation="4dp"
|
android:elevation="4dp"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:src="@drawable/ic_person_black_24dp"
|
android:src="@drawable/ic_person_black_24dp"
|
||||||
android:tint="?android:attr/textColorSecondary"
|
app:tint="?android:attr/textColorSecondary"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
app:layout_constraintBottom_toTopOf="@id/schedule"
|
app:layout_constraintBottom_toTopOf="@id/schedule"
|
||||||
app:layout_constraintEnd_toEndOf="@id/attach"
|
app:layout_constraintEnd_toEndOf="@id/attach"
|
||||||
@@ -429,9 +427,9 @@
|
|||||||
android:elevation="4dp"
|
android:elevation="4dp"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:src="@drawable/ic_event_black_24dp"
|
android:src="@drawable/ic_event_black_24dp"
|
||||||
android:tint="?android:attr/textColorSecondary"
|
app:tint="?android:attr/textColorSecondary"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
app:layout_constraintBottom_toTopOf="@id/gallery"
|
app:layout_constraintBottom_toTopOf="@id/attachAFileIcon"
|
||||||
app:layout_constraintEnd_toEndOf="@id/attach"
|
app:layout_constraintEnd_toEndOf="@id/attach"
|
||||||
app:layout_constraintStart_toStartOf="@id/attach" />
|
app:layout_constraintStart_toStartOf="@id/attach" />
|
||||||
|
|
||||||
@@ -452,6 +450,43 @@
|
|||||||
app:layout_constraintStart_toEndOf="@id/schedule"
|
app:layout_constraintStart_toEndOf="@id/schedule"
|
||||||
app:layout_constraintTop_toTopOf="@id/schedule" />
|
app:layout_constraintTop_toTopOf="@id/schedule" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/attachAFileIcon"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:background="@drawable/circle"
|
||||||
|
android:backgroundTint="?attr/bubbleColor"
|
||||||
|
android:contentDescription="@string/compose_attach_file_cd"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:rotation="-45"
|
||||||
|
android:src="@drawable/ic_attachment_black_24dp"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/gallery"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/attach"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/attach"
|
||||||
|
app:tint="?android:attr/textColorSecondary" />
|
||||||
|
|
||||||
|
<dev.octoshrimpy.quik.common.widget.QkTextView
|
||||||
|
android:id="@+id/attachAFileLabel"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:background="@drawable/rounded_rectangle_4dp"
|
||||||
|
android:backgroundTint="?attr/bubbleColor"
|
||||||
|
android:elevation="4dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:text="@string/compose_attach_file_cd"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/attachAFileIcon"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/attachAFileIcon"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/attachAFileIcon" />
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/gallery"
|
android:id="@+id/gallery"
|
||||||
android:layout_width="40dp"
|
android:layout_width="40dp"
|
||||||
@@ -463,7 +498,7 @@
|
|||||||
android:elevation="4dp"
|
android:elevation="4dp"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:src="@drawable/ic_insert_photo_black_24dp"
|
android:src="@drawable/ic_insert_photo_black_24dp"
|
||||||
android:tint="?android:attr/textColorSecondary"
|
app:tint="?android:attr/textColorSecondary"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
app:layout_constraintBottom_toTopOf="@id/camera"
|
app:layout_constraintBottom_toTopOf="@id/camera"
|
||||||
app:layout_constraintEnd_toEndOf="@id/attach"
|
app:layout_constraintEnd_toEndOf="@id/attach"
|
||||||
@@ -497,7 +532,7 @@
|
|||||||
android:elevation="4dp"
|
android:elevation="4dp"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:src="@drawable/ic_camera_alt_black_24dp"
|
android:src="@drawable/ic_camera_alt_black_24dp"
|
||||||
android:tint="?android:attr/textColorSecondary"
|
app:tint="?android:attr/textColorSecondary"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
app:layout_constraintBottom_toTopOf="@id/attach"
|
app:layout_constraintBottom_toTopOf="@id/attach"
|
||||||
app:layout_constraintEnd_toEndOf="@id/attach"
|
app:layout_constraintEnd_toEndOf="@id/attach"
|
||||||
|
|||||||
@@ -17,110 +17,126 @@
|
|||||||
~ You should have received a copy of the GNU General Public License
|
~ You should have received a copy of the GNU General Public License
|
||||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/selectableItemBackground">
|
android:background="?attr/selectableItemBackground">
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.QkTextView
|
<LinearLayout
|
||||||
android:id="@+id/timestamp"
|
android:layout_width="match_parent"
|
||||||
style="@style/TextSecondary"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:layout_marginEnd="36dp"
|
||||||
android:padding="8dp"
|
android:orientation="vertical">
|
||||||
app:layout_constraintEnd_toStartOf="@id/sim"
|
|
||||||
app:layout_constraintHorizontal_chainStyle="packed"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:text="Tue at 11:39pm" />
|
|
||||||
|
|
||||||
<ImageView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/sim"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="16dp"
|
android:layout_height="wrap_content">
|
||||||
android:layout_height="16dp"
|
|
||||||
android:layout_marginEnd="2dp"
|
|
||||||
android:src="@drawable/ic_sim_card_black_24dp"
|
|
||||||
android:tint="?android:attr/textColorSecondary"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/timestamp"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/simIndex"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/timestamp"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/timestamp" />
|
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.QkTextView
|
<dev.octoshrimpy.quik.common.widget.QkTextView
|
||||||
android:id="@+id/simIndex"
|
android:id="@+id/timestamp"
|
||||||
android:layout_width="wrap_content"
|
style="@style/TextSecondary"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/timestamp"
|
android:gravity="center"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:padding="8dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/sim"
|
app:layout_constraintEnd_toStartOf="@id/sim"
|
||||||
app:layout_constraintTop_toTopOf="@id/timestamp"
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
app:textSize="tertiary"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
tools:text="1" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="Tue at 11:39pm" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<ImageView
|
||||||
android:id="@+id/attachments"
|
android:id="@+id/sim"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="16dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="16dp"
|
||||||
android:layout_marginStart="12dp"
|
android:layout_marginEnd="2dp"
|
||||||
android:layout_marginEnd="12dp"
|
android:src="@drawable/ic_sim_card_black_24dp"
|
||||||
android:nestedScrollingEnabled="false"
|
app:layout_constraintBottom_toBottomOf="@id/timestamp"
|
||||||
android:orientation="vertical"
|
app:layout_constraintEnd_toStartOf="@id/simIndex"
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
app:layout_constraintStart_toEndOf="@id/timestamp"
|
||||||
app:layout_constrainedWidth="true"
|
app:layout_constraintTop_toTopOf="@id/timestamp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:tint="?android:attr/textColorSecondary" />
|
||||||
app:layout_constraintHorizontal_bias="0"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/avatar"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/timestamp"
|
|
||||||
tools:itemCount="1"
|
|
||||||
tools:listitem="@layout/mms_image_preview_list_item" />
|
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.AvatarView
|
<dev.octoshrimpy.quik.common.widget.QkTextView
|
||||||
android:id="@+id/avatar"
|
android:id="@+id/simIndex"
|
||||||
android:layout_width="36dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="36dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="12dp"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/body"
|
app:layout_constraintBottom_toBottomOf="@id/timestamp"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/sim"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/timestamp"
|
||||||
|
app:textSize="tertiary"
|
||||||
|
tools:text="1" />
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.TightTextView
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
android:id="@+id/body"
|
|
||||||
style="@style/TextPrimary"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:layout_marginEnd="12dp"
|
|
||||||
android:autoLink="email|phone|web"
|
|
||||||
android:background="@drawable/message_only"
|
|
||||||
android:gravity="start|center_vertical"
|
|
||||||
android:minHeight="36dp"
|
|
||||||
android:textIsSelectable="true"
|
|
||||||
app:layout_constrainedWidth="true"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="0"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/avatar"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/attachments"
|
|
||||||
app:layout_constraintWidth_max="384dp"
|
|
||||||
tools:backgroundTint="@color/tools_theme"
|
|
||||||
tools:text="@tools:sample/lorem/random" />
|
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.QkTextView
|
<LinearLayout
|
||||||
android:id="@+id/status"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_gravity="start"
|
android:orientation="horizontal"
|
||||||
android:layout_marginStart="72dp"
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
android:layout_marginBottom="4dp"
|
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/body"
|
|
||||||
app:textSize="tertiary"
|
|
||||||
tools:text="Sending..." />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
<dev.octoshrimpy.quik.common.widget.AvatarView
|
||||||
|
android:id="@+id/avatar"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/body"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/attachments"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:nestedScrollingEnabled="false"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
tools:itemCount="1"
|
||||||
|
tools:listitem="@layout/mms_image_preview_list_item" />
|
||||||
|
|
||||||
|
<dev.octoshrimpy.quik.common.widget.TightTextView
|
||||||
|
android:id="@+id/body"
|
||||||
|
style="@style/TextPrimary"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:autoLink="email|phone|web"
|
||||||
|
android:background="@drawable/message_only"
|
||||||
|
android:gravity="start|center_vertical"
|
||||||
|
android:minHeight="36dp"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
tools:backgroundTint="@color/tools_theme"
|
||||||
|
tools:text="@tools:sample/lorem/random" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<dev.octoshrimpy.quik.common.widget.QkTextView
|
||||||
|
android:id="@+id/status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="start"
|
||||||
|
android:layout_marginStart="72dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/body"
|
||||||
|
app:textSize="tertiary"
|
||||||
|
tools:text="Sending..." />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
@@ -17,133 +17,180 @@
|
|||||||
~ You should have received a copy of the GNU General Public License
|
~ You should have received a copy of the GNU General Public License
|
||||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/selectableItemBackground">
|
android:background="?attr/selectableItemBackground">
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.QkTextView
|
<LinearLayout
|
||||||
android:id="@+id/timestamp"
|
android:layout_width="match_parent"
|
||||||
style="@style/TextSecondary"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:layout_marginStart="36dp"
|
||||||
android:padding="8dp"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/sim"
|
|
||||||
app:layout_constraintHorizontal_chainStyle="packed"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:text="Tue at 11:39pm" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/sim"
|
|
||||||
android:layout_width="16dp"
|
|
||||||
android:layout_height="16dp"
|
|
||||||
android:layout_marginEnd="2dp"
|
|
||||||
android:src="@drawable/ic_sim_card_black_24dp"
|
|
||||||
android:tint="?android:attr/textColorSecondary"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/timestamp"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/simIndex"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/timestamp"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/timestamp" />
|
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.QkTextView
|
|
||||||
android:id="@+id/simIndex"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/timestamp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/sim"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/timestamp"
|
|
||||||
app:textSize="tertiary"
|
|
||||||
tools:text="1" />
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/attachments"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="end"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
android:gravity="end"
|
android:orientation="vertical">
|
||||||
android:nestedScrollingEnabled="false"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
|
||||||
app:layout_constrainedWidth="true"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="1"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/timestamp"
|
|
||||||
tools:itemCount="1"
|
|
||||||
tools:listitem="@layout/mms_image_preview_list_item" />
|
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.TightTextView
|
|
||||||
android:id="@+id/body"
|
|
||||||
style="@style/TextPrimary"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:layout_marginEnd="12dp"
|
|
||||||
android:autoLink="email|phone|web"
|
|
||||||
android:background="@drawable/message_only"
|
|
||||||
android:backgroundTint="?attr/bubbleColor"
|
|
||||||
android:gravity="start|center_vertical"
|
|
||||||
android:minHeight="36dp"
|
|
||||||
android:textIsSelectable="true"
|
|
||||||
app:layout_constrainedWidth="true"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintHorizontal_bias="1"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/attachments"
|
|
||||||
app:layout_constraintWidth_max="384dp"
|
|
||||||
tools:text="Hey! How's it going?" />
|
|
||||||
|
|
||||||
<ProgressBar
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cancel"
|
android:layout_width="match_parent"
|
||||||
style="?android:attr/progressBarStyleHorizontal"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="36dp"
|
android:contentDescription="@string/compose_message_item">
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:background="@drawable/circle"
|
|
||||||
android:backgroundTint="?attr/bubbleColor"
|
|
||||||
android:elevation="4dp"
|
|
||||||
android:foreground="?attr/selectableItemBackground"
|
|
||||||
android:indeterminate="false"
|
|
||||||
android:progressDrawable="@drawable/circular_progress_bar"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/body"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/body"
|
|
||||||
tools:progress="45"
|
|
||||||
tools:progressTint="@color/tools_theme" />
|
|
||||||
|
|
||||||
<ImageView
|
<dev.octoshrimpy.quik.common.widget.QkTextView
|
||||||
android:id="@+id/cancelIcon"
|
android:id="@+id/timestamp"
|
||||||
android:layout_width="0dp"
|
style="@style/TextSecondary"
|
||||||
android:layout_height="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:elevation="4dp"
|
android:layout_height="wrap_content"
|
||||||
android:padding="6dp"
|
android:gravity="center"
|
||||||
android:src="@drawable/ic_stop_black_24dp"
|
android:padding="8dp"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/cancel"
|
app:layout_constraintEnd_toStartOf="@id/sim"
|
||||||
app:layout_constraintEnd_toEndOf="@id/cancel"
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
app:layout_constraintStart_toStartOf="@id/cancel"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@id/cancel"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:tint="@color/tools_theme" />
|
tools:text="Tue at 11:39pm" />
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.QkTextView
|
<ImageView
|
||||||
android:id="@+id/status"
|
android:id="@+id/sim"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="16dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="16dp"
|
||||||
android:layout_gravity="end"
|
android:layout_marginEnd="2dp"
|
||||||
android:layout_marginTop="4dp"
|
android:contentDescription="@string/compose_message_sim"
|
||||||
android:layout_marginEnd="24dp"
|
android:src="@drawable/ic_sim_card_black_24dp"
|
||||||
android:layout_marginBottom="4dp"
|
app:layout_constraintBottom_toBottomOf="@id/timestamp"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
app:layout_constraintEnd_toStartOf="@id/simIndex"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintStart_toEndOf="@id/timestamp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintTop_toTopOf="@id/timestamp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/body"
|
app:tint="?android:attr/textColorSecondary" />
|
||||||
app:textSize="tertiary"
|
|
||||||
tools:text="Sending..." />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
<dev.octoshrimpy.quik.common.widget.QkTextView
|
||||||
|
android:id="@+id/simIndex"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/timestamp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/sim"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/timestamp"
|
||||||
|
app:textSize="tertiary"
|
||||||
|
tools:text="1" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/attachments"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:gravity="end"
|
||||||
|
android:nestedScrollingEnabled="false"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
tools:itemCount="1"
|
||||||
|
tools:listitem="@layout/mms_image_preview_list_item" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/cancelFrame"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@id/bodyBox"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/cancel"
|
||||||
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:background="@drawable/circle"
|
||||||
|
android:backgroundTint="?attr/bubbleColor"
|
||||||
|
android:clickable="false"
|
||||||
|
android:foreground="?attr/selectableItemBackground"
|
||||||
|
android:indeterminate="false"
|
||||||
|
android:progressDrawable="@drawable/circular_progress_bar"
|
||||||
|
tools:progress="45"
|
||||||
|
tools:progressTint="@color/tools_theme"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/cancelIcon"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:clickable="false"
|
||||||
|
android:contentDescription="@string/compose_message_cancel"
|
||||||
|
android:padding="6dp"
|
||||||
|
android:src="@drawable/ic_stop_black_24dp"
|
||||||
|
tools:tint="@color/tools_theme" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/bodyBox"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toStartOf="@id/sendNowIcon"
|
||||||
|
android:layout_toEndOf="@id/cancelFrame"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<dev.octoshrimpy.quik.common.widget.TightTextView
|
||||||
|
android:id="@+id/body"
|
||||||
|
style="@style/TextPrimary"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:autoLink="email|phone|web"
|
||||||
|
android:background="@drawable/message_only"
|
||||||
|
android:backgroundTint="?attr/bubbleColor"
|
||||||
|
android:gravity="start|center_vertical"
|
||||||
|
android:minHeight="36dp"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
tools:text="@tools:sample/lorem/random[0]" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/sendNowIcon"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_alignBottom="@id/bodyBox"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:background="@drawable/circle"
|
||||||
|
android:backgroundTint="?attr/bubbleColor"
|
||||||
|
android:baselineAlignBottom="true"
|
||||||
|
android:contentDescription="@string/compose_message_send_now"
|
||||||
|
android:padding="6dp"
|
||||||
|
android:src="@drawable/ic_send_black_24dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:tint="@color/tools_theme"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<dev.octoshrimpy.quik.common.widget.QkTextView
|
||||||
|
android:id="@+id/status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:contentDescription="@string/compose_message_attachment"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
app:textSize="tertiary"
|
||||||
|
tools:text="Sending..." />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/frame"
|
android:id="@+id/frame"
|
||||||
android:layout_width="280dp"
|
android:layout_width="280dp"
|
||||||
android:layout_height="280dp"
|
android:layout_height="140dp"
|
||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
android:clipChildren="false">
|
android:clipChildren="false">
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:title="@string/settings_notification_previews_title"
|
app:title="@string/settings_notification_previews_title"
|
||||||
tools:summary="Show name and message" />
|
tools:summary="@string/settings_notification_previews_summary" />
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.PreferenceView
|
<dev.octoshrimpy.quik.common.widget.PreferenceView
|
||||||
android:id="@+id/wake"
|
android:id="@+id/wake"
|
||||||
@@ -79,6 +79,14 @@
|
|||||||
app:title="@string/settings_notification_wake_title"
|
app:title="@string/settings_notification_wake_title"
|
||||||
app:widget="@layout/settings_switch_widget" />
|
app:widget="@layout/settings_switch_widget" />
|
||||||
|
|
||||||
|
<dev.octoshrimpy.quik.common.widget.PreferenceView
|
||||||
|
android:id="@+id/silentNotContact"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:title="@string/settings_notification_silent_title"
|
||||||
|
app:summary="@string/settings_notification_silent_summary"
|
||||||
|
app:widget="@layout/settings_switch_widget" />
|
||||||
|
|
||||||
<dev.octoshrimpy.quik.common.widget.PreferenceView
|
<dev.octoshrimpy.quik.common.widget.PreferenceView
|
||||||
android:id="@+id/vibration"
|
android:id="@+id/vibration"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -19,18 +19,27 @@
|
|||||||
-->
|
-->
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="48dp"
|
android:layout_width="56dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="56dp"
|
||||||
android:layout_marginEnd="8dp">
|
android:layout_marginEnd="8dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/thumbnail"
|
android:id="@+id/thumbnail"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:background="@drawable/rounded_rectangle_4dp"
|
android:background="@drawable/rounded_rectangle_4dp"
|
||||||
android:backgroundTint="?android:attr/divider"
|
android:backgroundTint="?android:attr/divider"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
tools:src="@tools:sample/backgrounds/scenic" />
|
tools:src="@tools:sample/backgrounds/scenic" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/fileName"
|
||||||
|
style="@style/TextPrimary"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#ddffffff"
|
||||||
|
android:gravity="center"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
@@ -212,6 +212,15 @@
|
|||||||
app:title="@string/settings_mms_size_title"
|
app:title="@string/settings_mms_size_title"
|
||||||
tools:summary="100KB" />
|
tools:summary="100KB" />
|
||||||
|
|
||||||
|
<dev.octoshrimpy.quik.common.widget.PreferenceView
|
||||||
|
android:id="@+id/messsageLinkHandling"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:icon="@android:drawable/stat_sys_warning"
|
||||||
|
app:title="@string/settings_mms_weblink_title"
|
||||||
|
tools:summary="100KB" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
|
|||||||
@@ -250,7 +250,7 @@
|
|||||||
</plurals>
|
</plurals>
|
||||||
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
||||||
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
||||||
<string name="settings_mms_size_title">Auto-compress MMS attachments</string>
|
<string name="settings_mms_size_title">Auto-compress MMS image attachments</string>
|
||||||
<string name="settings_sync_title">Συγχρονισμός μηνυμάτων</string>
|
<string name="settings_sync_title">Συγχρονισμός μηνυμάτων</string>
|
||||||
<string name="settings_sync_summary">Επανασυγχρονισμός μηνυμάτων με τη βάση δεδομένων SMS του Android</string>
|
<string name="settings_sync_summary">Επανασυγχρονισμός μηνυμάτων με τη βάση δεδομένων SMS του Android</string>
|
||||||
<string name="settings_about_title">Σχετικά με το QUIK</string>
|
<string name="settings_about_title">Σχετικά με το QUIK</string>
|
||||||
|
|||||||
@@ -68,9 +68,9 @@
|
|||||||
<string name="main_default_sms_message">Faire de QUIK votre application SMS par défaut</string>
|
<string name="main_default_sms_message">Faire de QUIK votre application SMS par défaut</string>
|
||||||
<string name="main_default_sms_change">Changer</string>
|
<string name="main_default_sms_change">Changer</string>
|
||||||
<string name="main_permission_required">Autorisation requise</string>
|
<string name="main_permission_required">Autorisation requise</string>
|
||||||
<string name="main_permission_sms">QUIK a besoin de l\'autorisation d’envoyer et de consulter des messages SMS</string>
|
<string name="main_permission_sms">QUIK a besoin de l\'autorisation d\’envoyer et de consulter les messages SMS</string>
|
||||||
<string name="main_permission_contacts">QUIK a besoin de l\'autorisation d\'accéder aux contacts</string>
|
<string name="main_permission_contacts">QUIK a besoin de l\'autorisation d\'accéder aux contacts</string>
|
||||||
<string name="main_permission_notifications">QUIK needs permission to display notifications</string>
|
<string name="main_permission_notifications">QUIK a besoin de l\'autorisation d\'afficher des notifications</string>
|
||||||
<string name="main_permission_allow">Autoriser</string>
|
<string name="main_permission_allow">Autoriser</string>
|
||||||
|
|
||||||
<string name="drawer_inbox">Boite de réception</string>
|
<string name="drawer_inbox">Boite de réception</string>
|
||||||
@@ -86,14 +86,14 @@
|
|||||||
<string name="drawer_plus_banner_summary">Débloquer les nouvelles fonctions sensationnelles et soutenir le développement</string>
|
<string name="drawer_plus_banner_summary">Débloquer les nouvelles fonctions sensationnelles et soutenir le développement</string>
|
||||||
|
|
||||||
<string name="rate_title">Vous aimez QUIK?</string>
|
<string name="rate_title">Vous aimez QUIK?</string>
|
||||||
<string name="rate_summary">Partagez un peu d’amour et évaluez-nous sur le Play Store !</string>
|
<string name="rate_summary">Partagez un peu d\’amour et évaluez-nous sur le Play Store!</string>
|
||||||
<string name="rate_okay">OK !</string>
|
<string name="rate_okay">OK!</string>
|
||||||
<string name="rate_dismiss">ANNULER</string>
|
<string name="rate_dismiss">ANNULER</string>
|
||||||
|
|
||||||
<string name="dialog_delete_title">Supprimer</string>
|
<string name="dialog_delete_title">Supprimer</string>
|
||||||
<plurals name="dialog_delete_message">
|
<plurals name="dialog_delete_message">
|
||||||
<item quantity="one">Êtes-vous sûr de vouloir supprimer cette conversation ?</item>
|
<item quantity="one">Êtes-vous sûr de vouloir supprimer cette conversation?</item>
|
||||||
<item quantity="other">Êtes-vous sûr de vouloir supprimer %d conversations ?</item>
|
<item quantity="other">Êtes-vous sûr de vouloir supprimer %d conversations?</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
<plurals name="dialog_delete_chat">
|
<plurals name="dialog_delete_chat">
|
||||||
<item quantity="one">Êtes-vous sûr de vouloir supprimer ce message?</item>
|
<item quantity="one">Êtes-vous sûr de vouloir supprimer ce message?</item>
|
||||||
@@ -114,10 +114,10 @@
|
|||||||
<string name="compose_subtitle_results">%1$d sur %2$d résultats</string>
|
<string name="compose_subtitle_results">%1$d sur %2$d résultats</string>
|
||||||
<string name="compose_send_group_title">Envoyer en tant que message groupé</string>
|
<string name="compose_send_group_title">Envoyer en tant que message groupé</string>
|
||||||
<string name="compose_send_group_summary">Les destinataires et les réponses seront visibles par tout le monde</string>
|
<string name="compose_send_group_summary">Les destinataires et les réponses seront visibles par tout le monde</string>
|
||||||
<string name="compose_messages_empty">C\'est le début de votre conversation. Dites quelque chose de sympa !</string>
|
<string name="compose_messages_empty">C\'est le début de votre conversation. Dites quelque chose de sympa!</string>
|
||||||
<string name="compose_vcard_label">Fiche du contact</string>
|
<string name="compose_vcard_label">Fiche du contact</string>
|
||||||
<string name="compose_scheduled_for">Programmé pour</string>
|
<string name="compose_scheduled_for">Programmé pour</string>
|
||||||
<string name="compose_scheduled_future">Le moment choisi doit être dans le futur !</string>
|
<string name="compose_scheduled_future">Le moment choisi doit être dans le futur!</string>
|
||||||
<string name="compose_scheduled_plus">Vous devez déverrouiller QUIK+ pour utiliser la programmation de message</string>
|
<string name="compose_scheduled_plus">Vous devez déverrouiller QUIK+ pour utiliser la programmation de message</string>
|
||||||
<string name="compose_scheduled_toast">Ajouté aux messages programmés</string>
|
<string name="compose_scheduled_toast">Ajouté aux messages programmés</string>
|
||||||
<string name="compose_hint">Écrire un message…</string>
|
<string name="compose_hint">Écrire un message…</string>
|
||||||
@@ -130,16 +130,16 @@
|
|||||||
<string name="compose_menu_next">Suivant</string>
|
<string name="compose_menu_next">Suivant</string>
|
||||||
<string name="compose_menu_clear">Effacer</string>
|
<string name="compose_menu_clear">Effacer</string>
|
||||||
<string name="compose_details_title">Détails du message</string>
|
<string name="compose_details_title">Détails du message</string>
|
||||||
<string name="compose_details_type">Type : %s</string>
|
<string name="compose_details_type">Type: %s</string>
|
||||||
<string name="compose_details_from">De : %s</string>
|
<string name="compose_details_from">De: %s</string>
|
||||||
<string name="compose_details_to">À : %s</string>
|
<string name="compose_details_to">À: %s</string>
|
||||||
<string name="compose_details_subject">Objet : %s</string>
|
<string name="compose_details_subject">Objet: %s</string>
|
||||||
<string name="compose_details_priority">Priorité : %s</string>
|
<string name="compose_details_priority">Priorité: %s</string>
|
||||||
<string name="compose_details_size">Taille : %s</string>
|
<string name="compose_details_size">Taille: %s</string>
|
||||||
<string name="compose_details_sent">Envoyé : %s</string>
|
<string name="compose_details_sent">Envoyé: %s</string>
|
||||||
<string name="compose_details_received">Reçu : %s</string>
|
<string name="compose_details_received">Reçu: %s</string>
|
||||||
<string name="compose_details_delivered">Délivré : %s</string>
|
<string name="compose_details_delivered">Délivré: %s</string>
|
||||||
<string name="compose_details_error_code">Code erreur : %d</string>
|
<string name="compose_details_error_code">Code erreur: %d</string>
|
||||||
<string name="compose_attach_cd">Ajouter une pièce jointe</string>
|
<string name="compose_attach_cd">Ajouter une pièce jointe</string>
|
||||||
<string name="compose_gallery_cd">Joindre une photo</string>
|
<string name="compose_gallery_cd">Joindre une photo</string>
|
||||||
<string name="compose_camera_cd">Prendre une photo</string>
|
<string name="compose_camera_cd">Prendre une photo</string>
|
||||||
@@ -174,8 +174,8 @@
|
|||||||
<string name="backup_restoring">Restaurer à partir d\'une sauvegarde</string>
|
<string name="backup_restoring">Restaurer à partir d\'une sauvegarde</string>
|
||||||
<string name="backup_loading">Chargement…</string>
|
<string name="backup_loading">Chargement…</string>
|
||||||
<string name="backup_never">Jamais</string>
|
<string name="backup_never">Jamais</string>
|
||||||
<string name="backup_location_title">Backup location</string>
|
<string name="backup_location_title">Emplacement de sauvegarde</string>
|
||||||
<string name="backup_location_summary">Set folder</string>
|
<string name="backup_location_summary">Définir le dossier</string>
|
||||||
<string name="backup_restore_title">Restauration</string>
|
<string name="backup_restore_title">Restauration</string>
|
||||||
<string name="backup_restore_summary">Sélectionner une sauvegarde</string>
|
<string name="backup_restore_summary">Sélectionner une sauvegarde</string>
|
||||||
<string name="backup_restore_error_plus">Déverrouillez QUIK+ pour utiliser la sauvegarde et la restauration</string>
|
<string name="backup_restore_error_plus">Déverrouillez QUIK+ pour utiliser la sauvegarde et la restauration</string>
|
||||||
@@ -184,8 +184,8 @@
|
|||||||
<string name="backup_restore_confirm_title">Restaurer à partir d’une sauvegarde</string>
|
<string name="backup_restore_confirm_title">Restaurer à partir d’une sauvegarde</string>
|
||||||
<string name="backup_restore_stop_title">Arrêter la restauration</string>
|
<string name="backup_restore_stop_title">Arrêter la restauration</string>
|
||||||
<string name="backup_restore_stop_message">Les messages qui ont déjà été restaurés resteront sur votre appareil</string>
|
<string name="backup_restore_stop_message">Les messages qui ont déjà été restaurés resteront sur votre appareil</string>
|
||||||
<string name="backup_select_location_rationale_title">Select backup location</string>
|
<string name="backup_select_location_rationale_title">Sélectionnez l\'emplacement de sauvegarde</string>
|
||||||
<string name="backup_select_location_rationale_message">Please select a folder to save your backups to</string>
|
<string name="backup_select_location_rationale_message">Veuillez sélectionner un dossier dans lequel enregistrer vos sauvegardes</string>
|
||||||
<string name="backup_details">%1$s\n%2$d messages</string>
|
<string name="backup_details">%1$s\n%2$d messages</string>
|
||||||
<string name="backup_selected_backup_error_title">Erreur</string>
|
<string name="backup_selected_backup_error_title">Erreur</string>
|
||||||
<string name="backup_selected_backup_error_message">Impossible de lire le fichier de sauvegarde</string>
|
<string name="backup_selected_backup_error_message">Impossible de lire le fichier de sauvegarde</string>
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
<string name="backup_restore_dialog_title">Sauvegardes</string>
|
<string name="backup_restore_dialog_title">Sauvegardes</string>
|
||||||
<string name="backup_restore_dialog_summary" translatable="false">/QUIK/Backups</string>
|
<string name="backup_restore_dialog_summary" translatable="false">/QUIK/Backups</string>
|
||||||
<string name="backup_restore_dialog_empty">Aucune sauvegarde trouvée</string>
|
<string name="backup_restore_dialog_empty">Aucune sauvegarde trouvée</string>
|
||||||
<string name="backup_disclaimer">Actuellement, seulement la sauvegarde et la restauration des SMS sont pris en charge. Les MMS et les sauvegardes planifiées arriveront bientôt !</string>
|
<string name="backup_disclaimer">Actuellement, seulement la sauvegarde et la restauration des SMS sont pris en charge. Les MMS et les sauvegardes planifiées arriveront bientôt!</string>
|
||||||
<string name="backup_now">Sauvegarder maintenant</string>
|
<string name="backup_now">Sauvegarder maintenant</string>
|
||||||
<string name="backup_progress_parsing">Analyse de la sauvegarde…</string>
|
<string name="backup_progress_parsing">Analyse de la sauvegarde…</string>
|
||||||
<string name="backup_progress_running">%d/%d messages</string>
|
<string name="backup_progress_running">%d/%d messages</string>
|
||||||
@@ -204,9 +204,9 @@
|
|||||||
|
|
||||||
<string name="scheduled_title">Programmé</string>
|
<string name="scheduled_title">Programmé</string>
|
||||||
<string name="scheduled_empty_description">Envoyer automatiquement un message, au moment précis que vous souhaitez</string>
|
<string name="scheduled_empty_description">Envoyer automatiquement un message, au moment précis que vous souhaitez</string>
|
||||||
<string name="scheduled_empty_message_1">Hé ! Quand était votre anniversaire déjà ?</string>
|
<string name="scheduled_empty_message_1">Hé! Quand était votre anniversaire déjà ?</string>
|
||||||
<string name="scheduled_empty_message_2">C’est le 23 décembre</string>
|
<string name="scheduled_empty_message_2">C’est le 23 décembre</string>
|
||||||
<string name="scheduled_empty_message_3">Joyeux anniversaire ! Regarde le grand ami que je suis, je me souviens de ton anniversaire</string>
|
<string name="scheduled_empty_message_3">Joyeux anniversaire! Regarde le grand ami que je suis, je me souviens de ton anniversaire</string>
|
||||||
<!--  is a special character required at the end of this string to fix it's formatting in the app -->
|
<!--  is a special character required at the end of this string to fix it's formatting in the app -->
|
||||||
<string name="scheduled_empty_message_3_timestamp">Envoyé le 23 décembre </string>
|
<string name="scheduled_empty_message_3_timestamp">Envoyé le 23 décembre </string>
|
||||||
<string name="scheduled_compose_cd">Programmer un message</string>
|
<string name="scheduled_compose_cd">Programmer un message</string>
|
||||||
@@ -339,7 +339,7 @@
|
|||||||
<string name="about_changelog_title">Liste des modifications</string>
|
<string name="about_changelog_title">Liste des modifications</string>
|
||||||
<string name="about_contact_title">Contact</string>
|
<string name="about_contact_title">Contact</string>
|
||||||
<string name="about_license_title">Licence</string>
|
<string name="about_license_title">Licence</string>
|
||||||
<string name="about_copyright_title">Droits d’auteur</string>
|
<string name="about_copyright_title">Droits d\’auteur</string>
|
||||||
|
|
||||||
<string name="qksms_plus_description_title">Soutenir le développement, tout déverrouiller</string>
|
<string name="qksms_plus_description_title">Soutenir le développement, tout déverrouiller</string>
|
||||||
<string name="qksms_plus_description_summary">Vous pouvez sauver un développeur affamé pour seulement %s</string>
|
<string name="qksms_plus_description_summary">Vous pouvez sauver un développeur affamé pour seulement %s</string>
|
||||||
@@ -350,7 +350,7 @@
|
|||||||
<string name="qksms_plus_upgrade_d" translatable="false">One-time purchase of %1$s %2$s</string>
|
<string name="qksms_plus_upgrade_d" translatable="false">One-time purchase of %1$s %2$s</string>
|
||||||
<!-- Substitutions are for price and currency. Ex: Unlock + donate for $4.99 USD -->
|
<!-- Substitutions are for price and currency. Ex: Unlock + donate for $4.99 USD -->
|
||||||
<string name="qksms_plus_upgrade_donate">Déverrouiller + faire un don pour %1$s %2$s</string>
|
<string name="qksms_plus_upgrade_donate">Déverrouiller + faire un don pour %1$s %2$s</string>
|
||||||
<string name="qksms_plus_thanks_title">Merci de soutenir QUIK !</string>
|
<string name="qksms_plus_thanks_title">Merci de soutenir QUIK!</string>
|
||||||
<string name="qksms_plus_thanks_summary">Vous avez maintenant accès à toutes les fonctionnalités de QUIK+</string>
|
<string name="qksms_plus_thanks_summary">Vous avez maintenant accès à toutes les fonctionnalités de QUIK+</string>
|
||||||
<string name="qksms_plus_error">Une erreur s\'est produite. Merci de réessayer.</string>
|
<string name="qksms_plus_error">Une erreur s\'est produite. Merci de réessayer.</string>
|
||||||
<string name="qksms_plus_free_title">QUIK + est gratuit pour les utilisateurs de F-Droid ! Si vous souhaitez soutenir le développement, n’hésitez pas à faire un don.</string>
|
<string name="qksms_plus_free_title">QUIK + est gratuit pour les utilisateurs de F-Droid ! Si vous souhaitez soutenir le développement, n’hésitez pas à faire un don.</string>
|
||||||
@@ -375,7 +375,7 @@
|
|||||||
<string name="qksms_plus_respond_title">Réponse automatique</string>
|
<string name="qksms_plus_respond_title">Réponse automatique</string>
|
||||||
<string name="qksms_plus_respond_summary">Répondre automatiquement aux messages entrants avec une réponse prédéfinie</string>
|
<string name="qksms_plus_respond_summary">Répondre automatiquement aux messages entrants avec une réponse prédéfinie</string>
|
||||||
<string name="qksms_plus_more_title">Plus</string>
|
<string name="qksms_plus_more_title">Plus</string>
|
||||||
<string name="qksms_plus_more_summary">QUIK est en cours de développement actif, et votre achat comprendra toutes les futures fonctionnalités QUIK + !</string>
|
<string name="qksms_plus_more_summary">QUIK est en cours de développement actif, et votre achat comprendra toutes les futures fonctionnalités QUIK +!</string>
|
||||||
|
|
||||||
<string name="widget_loading">Chargement…</string>
|
<string name="widget_loading">Chargement…</string>
|
||||||
<string name="widget_more">Afficher plus de conversations</string>
|
<string name="widget_more">Afficher plus de conversations</string>
|
||||||
@@ -500,7 +500,7 @@
|
|||||||
<item>J\'arrive</item>
|
<item>J\'arrive</item>
|
||||||
<item>Merci</item>
|
<item>Merci</item>
|
||||||
<item>Ça a l\'air bien</item>
|
<item>Ça a l\'air bien</item>
|
||||||
<item>Quoi de neuf ?</item>
|
<item>Quoi de neuf?</item>
|
||||||
<item>D\'accord</item>
|
<item>D\'accord</item>
|
||||||
<item>Non</item>
|
<item>Non</item>
|
||||||
<item>Je t\'aime</item>
|
<item>Je t\'aime</item>
|
||||||
|
|||||||
@@ -254,7 +254,7 @@
|
|||||||
</plurals>
|
</plurals>
|
||||||
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
||||||
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
||||||
<string name="settings_mms_size_title">Auto-compress MMS attachments</string>
|
<string name="settings_mms_size_title">Auto-compress MMS image attachments</string>
|
||||||
<string name="settings_sync_title">Sync messages</string>
|
<string name="settings_sync_title">Sync messages</string>
|
||||||
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
||||||
<string name="settings_about_title">About QUIK</string>
|
<string name="settings_about_title">About QUIK</string>
|
||||||
|
|||||||
@@ -254,7 +254,7 @@
|
|||||||
</plurals>
|
</plurals>
|
||||||
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
||||||
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
||||||
<string name="settings_mms_size_title">Auto-compress MMS attachments</string>
|
<string name="settings_mms_size_title">Auto-compress MMS image attachments</string>
|
||||||
<string name="settings_sync_title">Sinchronizuoti pranešimus</string>
|
<string name="settings_sync_title">Sinchronizuoti pranešimus</string>
|
||||||
<string name="settings_sync_summary">Iš naujo sinchronizuoti Android pranešimų duomenų bazę</string>
|
<string name="settings_sync_summary">Iš naujo sinchronizuoti Android pranešimų duomenų bazę</string>
|
||||||
<string name="settings_about_title">Apie QUIK</string>
|
<string name="settings_about_title">Apie QUIK</string>
|
||||||
|
|||||||
@@ -250,7 +250,7 @@
|
|||||||
</plurals>
|
</plurals>
|
||||||
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
||||||
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
||||||
<string name="settings_mms_size_title">Auto-compress MMS attachments</string>
|
<string name="settings_mms_size_title">Auto-compress MMS image attachments</string>
|
||||||
<string name="settings_sync_title">Sync messages</string>
|
<string name="settings_sync_title">Sync messages</string>
|
||||||
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
||||||
<string name="settings_about_title">About QUIK</string>
|
<string name="settings_about_title">About QUIK</string>
|
||||||
|
|||||||
@@ -250,7 +250,7 @@
|
|||||||
</plurals>
|
</plurals>
|
||||||
<string name="settings_long_as_mms_title">நீண்ட செய்திகளை எம்.எம்.எஸ் ஆக அனுப்பு</string>
|
<string name="settings_long_as_mms_title">நீண்ட செய்திகளை எம்.எம்.எஸ் ஆக அனுப்பு</string>
|
||||||
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
||||||
<string name="settings_mms_size_title">Auto-compress MMS attachments</string>
|
<string name="settings_mms_size_title">Auto-compress MMS image attachments</string>
|
||||||
<string name="settings_sync_title">தகவல்களை ஒத்திசை</string>
|
<string name="settings_sync_title">தகவல்களை ஒத்திசை</string>
|
||||||
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
||||||
<string name="settings_about_title">QUIK பற்றி</string>
|
<string name="settings_about_title">QUIK பற்றி</string>
|
||||||
|
|||||||
@@ -250,7 +250,7 @@
|
|||||||
</plurals>
|
</plurals>
|
||||||
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
||||||
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
||||||
<string name="settings_mms_size_title">Auto-compress MMS attachments</string>
|
<string name="settings_mms_size_title">Auto-compress MMS image attachments</string>
|
||||||
<string name="settings_sync_title">Sync messages</string>
|
<string name="settings_sync_title">Sync messages</string>
|
||||||
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
||||||
<string name="settings_about_title">About QUIK</string>
|
<string name="settings_about_title">About QUIK</string>
|
||||||
|
|||||||
@@ -250,7 +250,7 @@
|
|||||||
</plurals>
|
</plurals>
|
||||||
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
||||||
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
||||||
<string name="settings_mms_size_title">Auto-compress MMS attachments</string>
|
<string name="settings_mms_size_title">Auto-compress MMS image attachments</string>
|
||||||
<string name="settings_sync_title">Sync messages</string>
|
<string name="settings_sync_title">Sync messages</string>
|
||||||
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
||||||
<string name="settings_about_title">About QUIK</string>
|
<string name="settings_about_title">About QUIK</string>
|
||||||
|
|||||||
@@ -141,6 +141,7 @@
|
|||||||
<string name="compose_details_delivered">Delivered: %s</string>
|
<string name="compose_details_delivered">Delivered: %s</string>
|
||||||
<string name="compose_details_error_code">Error code: %d</string>
|
<string name="compose_details_error_code">Error code: %d</string>
|
||||||
<string name="compose_attach_cd">Add an attachment</string>
|
<string name="compose_attach_cd">Add an attachment</string>
|
||||||
|
<string name="compose_attach_file_cd">Attach any file</string>
|
||||||
<string name="compose_gallery_cd">Attach a photo</string>
|
<string name="compose_gallery_cd">Attach a photo</string>
|
||||||
<string name="compose_camera_cd">Take a photo</string>
|
<string name="compose_camera_cd">Take a photo</string>
|
||||||
<string name="compose_schedule_cd">Schedule message</string>
|
<string name="compose_schedule_cd">Schedule message</string>
|
||||||
@@ -151,6 +152,12 @@
|
|||||||
<string name="compose_sim_cd">%s selected, change SIM card</string>
|
<string name="compose_sim_cd">%s selected, change SIM card</string>
|
||||||
<string name="compose_send_cd">Send message</string>
|
<string name="compose_send_cd">Send message</string>
|
||||||
|
|
||||||
|
<string name="compose_message_cancel">Cancel</string>
|
||||||
|
<string name="compose_message_send_now">Send now</string>
|
||||||
|
<string name="compose_message_sim">SIM number</string>
|
||||||
|
<string name="compose_message_item">Message item</string>
|
||||||
|
<string name="compose_message_attachment">Attachment</string>
|
||||||
|
|
||||||
<string name="message_status_sending">Sending…</string>
|
<string name="message_status_sending">Sending…</string>
|
||||||
<string name="message_status_delivered">Delivered %s</string>
|
<string name="message_status_delivered">Delivered %s</string>
|
||||||
<string name="message_status_failed">Failed to send. Tap to try again</string>
|
<string name="message_status_failed">Failed to send. Tap to try again</string>
|
||||||
@@ -211,6 +218,7 @@
|
|||||||
<string name="scheduled_empty_message_3_timestamp">Sending on December 23rd </string>
|
<string name="scheduled_empty_message_3_timestamp">Sending on December 23rd </string>
|
||||||
<string name="scheduled_compose_cd">Schedule a message</string>
|
<string name="scheduled_compose_cd">Schedule a message</string>
|
||||||
<string name="scheduled_options_title">Scheduled message</string>
|
<string name="scheduled_options_title">Scheduled message</string>
|
||||||
|
<string name="attachment_missing">Missing</string>
|
||||||
<string-array name="scheduled_options">
|
<string-array name="scheduled_options">
|
||||||
<item>Send now</item>
|
<item>Send now</item>
|
||||||
<item>Copy text</item>
|
<item>Copy text</item>
|
||||||
@@ -237,7 +245,10 @@
|
|||||||
<string name="settings_notification_action_2">Button 2</string>
|
<string name="settings_notification_action_2">Button 2</string>
|
||||||
<string name="settings_notification_action_3">Button 3</string>
|
<string name="settings_notification_action_3">Button 3</string>
|
||||||
<string name="settings_notification_previews_title">Notification previews</string>
|
<string name="settings_notification_previews_title">Notification previews</string>
|
||||||
|
<string name="settings_notification_previews_summary">Show name and message</string>
|
||||||
<string name="settings_notification_wake_title">Wake screen</string>
|
<string name="settings_notification_wake_title">Wake screen</string>
|
||||||
|
<string name="settings_notification_silent_title">Silent if not a contact</string>
|
||||||
|
<string name="settings_notification_silent_summary">Silences notifications for messages without recipients in your contacts</string>
|
||||||
<string name="settings_vibration_title">Vibration</string>
|
<string name="settings_vibration_title">Vibration</string>
|
||||||
<string name="settings_ringtone_title">Sound</string>
|
<string name="settings_ringtone_title">Sound</string>
|
||||||
<string name="settings_ringtone_none">None</string>
|
<string name="settings_ringtone_none">None</string>
|
||||||
@@ -284,7 +295,8 @@
|
|||||||
</plurals>
|
</plurals>
|
||||||
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
<string name="settings_long_as_mms_title">Send long messages as MMS</string>
|
||||||
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
<string name="settings_long_as_mms_summary">If your longer text messages are failing to send, or sending in the wrong order, you can send them as MMS messages instead. Additional charges may apply</string>
|
||||||
<string name="settings_mms_size_title">Auto-compress MMS attachments</string>
|
<string name="settings_mms_size_title">Auto-compress MMS image attachments</string>
|
||||||
|
<string name="settings_mms_weblink_title">Link handling in messages</string>
|
||||||
<string name="settings_sync_title">Sync messages</string>
|
<string name="settings_sync_title">Sync messages</string>
|
||||||
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
<string name="settings_sync_summary">Re-sync your messages with the native Android SMS database</string>
|
||||||
<string name="settings_about_title">About QUIK</string>
|
<string name="settings_about_title">About QUIK</string>
|
||||||
@@ -494,6 +506,18 @@
|
|||||||
<item>0</item>
|
<item>0</item>
|
||||||
</integer-array>
|
</integer-array>
|
||||||
|
|
||||||
|
<string-array name="messageLinkHandlings">
|
||||||
|
<item>Block</item>
|
||||||
|
<item>Allow</item>
|
||||||
|
<item>Ask before opening</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<integer-array name="messageLinkHandling_ids">
|
||||||
|
<item>0</item>
|
||||||
|
<item>1</item>
|
||||||
|
<item>2</item>
|
||||||
|
</integer-array>
|
||||||
|
|
||||||
<string-array name="qk_responses">
|
<string-array name="qk_responses">
|
||||||
<item>Okay</item>
|
<item>Okay</item>
|
||||||
<item>Give me a moment</item>
|
<item>Give me a moment</item>
|
||||||
@@ -510,4 +534,8 @@
|
|||||||
</string-array>
|
</string-array>
|
||||||
<string name="speak_no_messages">No Messages</string>
|
<string name="speak_no_messages">No Messages</string>
|
||||||
<string name="speak_unseen_messages">Speak unseen messages</string>
|
<string name="speak_unseen_messages">Speak unseen messages</string>
|
||||||
|
<string name="messageLinkHandling_dialog_title">External Link Warning</string>
|
||||||
|
<string name="messageLinkHandling_dialog_body">Some links may be unsafe or redirect you unexpectedly. Review the link below before proceeding:\n\n%1$s\n\nDo you want to continue?</string>
|
||||||
|
<string name="messageLinkHandling_dialog_positive">Yes, open the link</string>
|
||||||
|
<string name="messageLinkHandling_dialog_negative">No</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user