Merge branch 'octoshrimpy:master' into send_immediately_35

This commit is contained in:
gavine99
2025-01-29 12:33:00 +11:00
committed by GitHub
14 changed files with 106 additions and 24 deletions
+32 -1
View File
@@ -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,
"versionName": "4.0.8",
"fixed": [
@@ -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>> {
val realm = Realm.getDefaultInstance()
@@ -110,7 +110,7 @@ class Attachment(
if (resourceBytes != null)
return resourceBytes!!
resourceBytes = ByteArray(0)
resourceBytes = ByteArray(0)
try {
context.contentResolver.openInputStream(getUri())?.use {
@@ -33,6 +33,8 @@ interface ContactRepository {
fun getUnmanagedContact(lookupKey: String): Contact?
fun getUnmanagedAllContacts(): List<Contact>
fun getUnmanagedContacts(starred: Boolean = false): Observable<List<Contact>>
fun getUnmanagedContactGroups(): Observable<List<ContactGroup>>
@@ -107,6 +107,7 @@ class Preferences @Inject constructor(
val textSize = rxPrefs.getInteger("textSize", TEXT_SIZE_NORMAL)
val blockingManager = rxPrefs.getInteger("blockingManager", BLOCKING_MANAGER_QKSMS)
val drop = rxPrefs.getBoolean("drop", false)
val silentNotContact = rxPrefs.getBoolean("silentNotContact", false)
val notifAction1 = rxPrefs.getInteger("notifAction1", NOTIFICATION_ACTION_READ)
val notifAction2 = rxPrefs.getInteger("notifAction2", NOTIFICATION_ACTION_REPLY)
val notifAction3 = rxPrefs.getInteger("notifAction3", NOTIFICATION_ACTION_NONE)
+1 -1
View File
@@ -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.
+3 -3
View File
@@ -30,13 +30,13 @@ android {
applicationId 'dev.octoshrimpy.quik'
minSdkVersion 23
targetSdkVersion 33
versionCode 2225
versionName '4.0.8'
versionCode 2226
versionName '4.0.9'
setProperty("archivesBaseName", "QUIK-v${versionName}")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
setProperty("archivesBaseName", "QUIK-v${versionName}")
versionNameSuffix '-alpha'
versionNameSuffix '-beta'
}
signingConfigs {
@@ -52,6 +52,7 @@ import dev.octoshrimpy.quik.receiver.MarkReadReceiver
import dev.octoshrimpy.quik.receiver.MarkSeenReceiver
import dev.octoshrimpy.quik.receiver.RemoteMessagingReceiver
import dev.octoshrimpy.quik.receiver.SpeakThreadsReceiver
import dev.octoshrimpy.quik.repository.ContactRepository
import dev.octoshrimpy.quik.repository.ConversationRepository
import dev.octoshrimpy.quik.repository.MessageRepository
import dev.octoshrimpy.quik.util.GlideApp
@@ -70,7 +71,8 @@ class NotificationManagerImpl @Inject constructor(
private val prefs: Preferences,
private val messageRepo: MessageRepository,
private val permissions: PermissionManager,
private val phoneNumberUtils: PhoneNumberUtils
private val phoneNumberUtils: PhoneNumberUtils,
private val contactRepo: ContactRepository,
) : dev.octoshrimpy.quik.manager.NotificationManager {
companion object {
@@ -145,12 +147,28 @@ class NotificationManagerImpl @Inject constructor(
.setAutoCancel(true)
.setContentIntent(contentPI)
.setDeleteIntent(seenPI)
.setSound(ringtone)
.setLights(Color.WHITE, 500, 2000)
.setWhen(conversation.lastMessage?.date ?: System.currentTimeMillis())
.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")
if (conversation.recipients.size >= 2) {
messagingStyle.isGroupConversation = true
@@ -39,24 +39,26 @@ class BlockedNumbersPresenter @Inject constructor(
super.bindIntents(view)
view.unblockAddress()
.doOnNext { id ->
blockingRepo.getBlockedNumber(id)?.address
?.let(conversationRepo::getThreadId)
?.let { threadId -> markUnblocked.execute(listOf(threadId)) }
}
.doOnNext(blockingRepo::unblockNumber)
.subscribeOn(Schedulers.io())
.autoDisposable(view.scope())
.subscribe()
.observeOn(Schedulers.io())
.doOnNext { id ->
blockingRepo.getBlockedNumber(id)?.address
?.let(conversationRepo::getThreadId)
?.let { threadId -> markUnblocked.execute(listOf(threadId)) }
}
.doOnNext(blockingRepo::unblockNumber)
.subscribeOn(Schedulers.io())
.autoDisposable(view.scope())
.subscribe()
view.addAddress()
.autoDisposable(view.scope())
.subscribe { view.showAddDialog() }
.autoDisposable(view.scope())
.subscribe { view.showAddDialog() }
view.saveAddress()
.subscribeOn(Schedulers.io())
.autoDisposable(view.scope())
.subscribe { address -> blockingRepo.blockNumber(address) }
.observeOn(Schedulers.io())
.subscribeOn(Schedulers.io())
.autoDisposable(view.scope())
.subscribe { address -> blockingRepo.blockNumber(address) }
}
}
@@ -99,6 +99,8 @@ class NotificationPrefsActivity : QkThemedActivity(), NotificationPrefsView {
previews.summary = state.previewSummary
previewModeDialog.adapter.selectedItem = state.previewId
wake.checkbox.isChecked = state.wakeEnabled
silentNotContact.checkbox.isChecked = state.silentNotContact
silentNotContact.isVisible = state.threadId == 0L
vibration.checkbox.isChecked = state.vibrationEnabled
ringtone.summary = state.ringtoneName
@@ -28,6 +28,7 @@ data class NotificationPrefsState(
val previewSummary: String = "",
val previewId: Int = Preferences.NOTIFICATION_PREVIEWS_ALL,
val wakeEnabled: Boolean = false,
val silentNotContact: Boolean = false,
val action1Summary: String = "",
val action2Summary: String = "",
val action3Summary: String = "",
@@ -79,6 +79,9 @@ class NotificationPrefsViewModel @Inject constructor(
disposables += wake.asObservable()
.subscribe { enabled -> newState { copy(wakeEnabled = enabled) } }
disposables += prefs.silentNotContact.asObservable()
.subscribe { enabled -> newState { copy(silentNotContact = enabled) } }
disposables += vibration.asObservable()
.subscribe { enabled -> newState { copy(vibrationEnabled = enabled) } }
@@ -113,6 +116,8 @@ class NotificationPrefsViewModel @Inject constructor(
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.ringtone -> view.showRingtonePicker(ringtone.get().takeIf { it.isNotEmpty() }?.let(Uri::parse))
@@ -70,7 +70,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
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
android:id="@+id/wake"
@@ -79,6 +79,14 @@
app:title="@string/settings_notification_wake_title"
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
android:id="@+id/vibration"
android:layout_width="match_parent"
@@ -245,7 +245,10 @@
<string name="settings_notification_action_2">Button 2</string>
<string name="settings_notification_action_3">Button 3</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_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_ringtone_title">Sound</string>
<string name="settings_ringtone_none">None</string>