Add block/archive notification actions, and block swipe action

Closes #1575, closes #943
This commit is contained in:
Moez Bhatti
2020-02-29 19:54:40 -05:00
parent 853acaa42c
commit e2f4b92609
20 changed files with 201 additions and 40 deletions
@@ -36,7 +36,7 @@ class QkRealmMigration @Inject constructor(
) : RealmMigration { ) : RealmMigration {
companion object { companion object {
const val SchemaVersion: Long = 9 const val SchemaVersion: Long = 10
} }
@SuppressLint("ApplySharedPref") @SuppressLint("ApplySharedPref")
@@ -193,6 +193,36 @@ class QkRealmMigration @Inject constructor(
version++ version++
} }
if (version == 9L) {
val migrateNotificationAction = { pref: Int ->
when (pref) {
1 -> Preferences.NOTIFICATION_ACTION_READ
2 -> Preferences.NOTIFICATION_ACTION_REPLY
3 -> Preferences.NOTIFICATION_ACTION_CALL
4 -> Preferences.NOTIFICATION_ACTION_DELETE
else -> pref
}
}
val migrateSwipeAction = { pref: Int ->
when (pref) {
2 -> Preferences.SWIPE_ACTION_DELETE
3 -> Preferences.SWIPE_ACTION_CALL
4 -> Preferences.SWIPE_ACTION_READ
5 -> Preferences.SWIPE_ACTION_UNREAD
else -> pref
}
}
if (prefs.notifAction1.isSet) prefs.notifAction1.set(migrateNotificationAction(prefs.notifAction1.get()))
if (prefs.notifAction2.isSet) prefs.notifAction2.set(migrateNotificationAction(prefs.notifAction2.get()))
if (prefs.notifAction3.isSet) prefs.notifAction3.set(migrateNotificationAction(prefs.notifAction3.get()))
if (prefs.swipeLeft.isSet) prefs.swipeLeft.set(migrateSwipeAction(prefs.swipeLeft.get()))
if (prefs.swipeRight.isSet) prefs.swipeRight.set(migrateSwipeAction(prefs.swipeRight.get()))
version++
}
check(version >= newVersion) { "Migration missing from v$oldVersion to v$newVersion" } check(version >= newVersion) { "Migration missing from v$oldVersion to v$newVersion" }
} }
@@ -0,0 +1,52 @@
/*
* 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 com.moez.QKSMS.receiver
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.moez.QKSMS.blocking.BlockingClient
import com.moez.QKSMS.interactor.MarkBlocked
import com.moez.QKSMS.repository.ConversationRepository
import com.moez.QKSMS.util.Preferences
import dagger.android.AndroidInjection
import javax.inject.Inject
class BlockThreadReceiver : BroadcastReceiver() {
@Inject lateinit var blockingClient: BlockingClient
@Inject lateinit var conversationRepo: ConversationRepository
@Inject lateinit var markBlocked: MarkBlocked
@Inject lateinit var prefs: Preferences
override fun onReceive(context: Context, intent: Intent) {
AndroidInjection.inject(this, context)
val pendingResult = goAsync()
val threadId = intent.getLongExtra("threadId", 0)
val conversation = conversationRepo.getConversation(threadId)!!
val blockingManager = prefs.blockingManager.get()
blockingClient
.block(conversation.recipients.map { it.address })
.andThen(markBlocked.buildObservable(MarkBlocked.Params(listOf(threadId), blockingManager, null)))
.subscribe { pendingResult.finish() }
}
}
@@ -0,0 +1,40 @@
/*
* 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 com.moez.QKSMS.receiver
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.moez.QKSMS.interactor.MarkArchived
import dagger.android.AndroidInjection
import javax.inject.Inject
class MarkArchivedReceiver : BroadcastReceiver() {
@Inject lateinit var markArchived: MarkArchived
override fun onReceive(context: Context, intent: Intent) {
AndroidInjection.inject(this, context)
val pendingResult = goAsync()
val threadId = intent.getLongExtra("threadId", 0)
markArchived.execute(listOf(threadId)) { pendingResult.finish() }
}
}
@@ -52,10 +52,12 @@ class Preferences @Inject constructor(
const val NOTIFICATION_PREVIEWS_NONE = 2 const val NOTIFICATION_PREVIEWS_NONE = 2
const val NOTIFICATION_ACTION_NONE = 0 const val NOTIFICATION_ACTION_NONE = 0
const val NOTIFICATION_ACTION_READ = 1 const val NOTIFICATION_ACTION_ARCHIVE = 1
const val NOTIFICATION_ACTION_REPLY = 2 const val NOTIFICATION_ACTION_DELETE = 2
const val NOTIFICATION_ACTION_CALL = 3 const val NOTIFICATION_ACTION_BLOCK = 3
const val NOTIFICATION_ACTION_DELETE = 4 const val NOTIFICATION_ACTION_CALL = 4
const val NOTIFICATION_ACTION_READ = 5
const val NOTIFICATION_ACTION_REPLY = 6
const val SEND_DELAY_NONE = 0 const val SEND_DELAY_NONE = 0
const val SEND_DELAY_SHORT = 1 const val SEND_DELAY_SHORT = 1
@@ -65,9 +67,10 @@ class Preferences @Inject constructor(
const val SWIPE_ACTION_NONE = 0 const val SWIPE_ACTION_NONE = 0
const val SWIPE_ACTION_ARCHIVE = 1 const val SWIPE_ACTION_ARCHIVE = 1
const val SWIPE_ACTION_DELETE = 2 const val SWIPE_ACTION_DELETE = 2
const val SWIPE_ACTION_CALL = 3 const val SWIPE_ACTION_BLOCK = 3
const val SWIPE_ACTION_READ = 4 const val SWIPE_ACTION_CALL = 4
const val SWIPE_ACTION_UNREAD = 5 const val SWIPE_ACTION_READ = 5
const val SWIPE_ACTION_UNREAD = 6
const val BLOCKING_MANAGER_QKSMS = 0 const val BLOCKING_MANAGER_QKSMS = 0
const val BLOCKING_MANAGER_CC = 1 const val BLOCKING_MANAGER_CC = 1
@@ -149,6 +149,8 @@
<receiver <receiver
android:name=".receiver.MmsReceivedReceiver" android:name=".receiver.MmsReceivedReceiver"
android:taskAffinity="com.klinker.android.messaging.MMS_RECEIVED" /> android:taskAffinity="com.klinker.android.messaging.MMS_RECEIVED" />
<receiver android:name=".receiver.MarkArchivedReceiver" />
<receiver android:name=".receiver.BlockThreadReceiver" />
<receiver android:name=".receiver.MarkSeenReceiver" /> <receiver android:name=".receiver.MarkSeenReceiver" />
<receiver android:name=".receiver.MarkReadReceiver" /> <receiver android:name=".receiver.MarkReadReceiver" />
<receiver android:name=".receiver.RemoteMessagingReceiver" /> <receiver android:name=".receiver.RemoteMessagingReceiver" />
@@ -45,7 +45,9 @@ import com.moez.QKSMS.feature.compose.ComposeActivity
import com.moez.QKSMS.feature.qkreply.QkReplyActivity import com.moez.QKSMS.feature.qkreply.QkReplyActivity
import com.moez.QKSMS.manager.PermissionManager import com.moez.QKSMS.manager.PermissionManager
import com.moez.QKSMS.mapper.CursorToPartImpl import com.moez.QKSMS.mapper.CursorToPartImpl
import com.moez.QKSMS.receiver.BlockThreadReceiver
import com.moez.QKSMS.receiver.DeleteMessagesReceiver import com.moez.QKSMS.receiver.DeleteMessagesReceiver
import com.moez.QKSMS.receiver.MarkArchivedReceiver
import com.moez.QKSMS.receiver.MarkReadReceiver import com.moez.QKSMS.receiver.MarkReadReceiver
import com.moez.QKSMS.receiver.MarkSeenReceiver import com.moez.QKSMS.receiver.MarkSeenReceiver
import com.moez.QKSMS.receiver.RemoteMessagingReceiver import com.moez.QKSMS.receiver.RemoteMessagingReceiver
@@ -227,9 +229,36 @@ class NotificationManagerImpl @Inject constructor(
.distinct() .distinct()
.mapNotNull { action -> .mapNotNull { action ->
when (action) { when (action) {
Preferences.NOTIFICATION_ACTION_ARCHIVE -> {
val intent = Intent(context, MarkArchivedReceiver::class.java).putExtra("threadId", threadId)
val pi = PendingIntent.getBroadcast(context, threadId.toInt() + 30000, intent,
PendingIntent.FLAG_UPDATE_CURRENT)
NotificationCompat.Action.Builder(R.drawable.ic_archive_white_24dp, actionLabels[action], pi)
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_ARCHIVE).build()
}
Preferences.NOTIFICATION_ACTION_DELETE -> {
val messageIds = messages.map { it.id }.toLongArray()
val intent = Intent(context, DeleteMessagesReceiver::class.java)
.putExtra("threadId", threadId)
.putExtra("messageIds", messageIds)
val pi = PendingIntent.getBroadcast(context, threadId.toInt() + 40000, intent,
PendingIntent.FLAG_UPDATE_CURRENT)
NotificationCompat.Action.Builder(R.drawable.ic_delete_white_24dp, actionLabels[action], pi)
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_DELETE).build()
}
Preferences.NOTIFICATION_ACTION_BLOCK -> {
val intent = Intent(context, BlockThreadReceiver::class.java).putExtra("threadId", threadId)
val pi = PendingIntent.getBroadcast(context, threadId.toInt() + 50000, intent,
PendingIntent.FLAG_UPDATE_CURRENT)
NotificationCompat.Action.Builder(R.drawable.ic_block_white_24dp, actionLabels[action], pi)
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_MUTE).build()
}
Preferences.NOTIFICATION_ACTION_READ -> { Preferences.NOTIFICATION_ACTION_READ -> {
val intent = Intent(context, MarkReadReceiver::class.java).putExtra("threadId", threadId) val intent = Intent(context, MarkReadReceiver::class.java).putExtra("threadId", threadId)
val pi = PendingIntent.getBroadcast(context, threadId.toInt() + 30000, intent, val pi = PendingIntent.getBroadcast(context, threadId.toInt() + 60000, intent,
PendingIntent.FLAG_UPDATE_CURRENT) PendingIntent.FLAG_UPDATE_CURRENT)
NotificationCompat.Action.Builder(R.drawable.ic_check_white_24dp, actionLabels[action], pi) NotificationCompat.Action.Builder(R.drawable.ic_check_white_24dp, actionLabels[action], pi)
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_MARK_AS_READ).build() .setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_MARK_AS_READ).build()
@@ -240,7 +269,7 @@ class NotificationManagerImpl @Inject constructor(
getReplyAction(threadId) getReplyAction(threadId)
} else { } else {
val intent = Intent(context, QkReplyActivity::class.java).putExtra("threadId", threadId) val intent = Intent(context, QkReplyActivity::class.java).putExtra("threadId", threadId)
val pi = PendingIntent.getActivity(context, threadId.toInt() + 40000, intent, val pi = PendingIntent.getActivity(context, threadId.toInt() + 70000, intent,
PendingIntent.FLAG_UPDATE_CURRENT) PendingIntent.FLAG_UPDATE_CURRENT)
NotificationCompat.Action NotificationCompat.Action
.Builder(R.drawable.ic_reply_white_24dp, actionLabels[action], pi) .Builder(R.drawable.ic_reply_white_24dp, actionLabels[action], pi)
@@ -252,23 +281,12 @@ class NotificationManagerImpl @Inject constructor(
val address = conversation.recipients[0]?.address val address = conversation.recipients[0]?.address
val intentAction = if (permissions.hasCalling()) Intent.ACTION_CALL else Intent.ACTION_DIAL val intentAction = if (permissions.hasCalling()) Intent.ACTION_CALL else Intent.ACTION_DIAL
val intent = Intent(intentAction, Uri.parse("tel:$address")) val intent = Intent(intentAction, Uri.parse("tel:$address"))
val pi = PendingIntent.getActivity(context, threadId.toInt() + 50000, intent, val pi = PendingIntent.getActivity(context, threadId.toInt() + 80000, intent,
PendingIntent.FLAG_UPDATE_CURRENT) PendingIntent.FLAG_UPDATE_CURRENT)
NotificationCompat.Action.Builder(R.drawable.ic_call_white_24dp, actionLabels[action], pi) NotificationCompat.Action.Builder(R.drawable.ic_call_white_24dp, actionLabels[action], pi)
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_CALL).build() .setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_CALL).build()
} }
Preferences.NOTIFICATION_ACTION_DELETE -> {
val messageIds = messages.map { it.id }.toLongArray()
val intent = Intent(context, DeleteMessagesReceiver::class.java)
.putExtra("threadId", threadId)
.putExtra("messageIds", messageIds)
val pi = PendingIntent.getBroadcast(context, threadId.toInt() + 60000, intent,
PendingIntent.FLAG_UPDATE_CURRENT)
NotificationCompat.Action.Builder(R.drawable.ic_delete_white_24dp, actionLabels[action], pi)
.setSemanticAction(NotificationCompat.Action.SEMANTIC_ACTION_DELETE).build()
}
else -> null else -> null
} }
} }
@@ -147,8 +147,9 @@ class ConversationItemTouchCallback @Inject constructor(
private fun iconForAction(action: Int, tint: Int): Bitmap? { private fun iconForAction(action: Int, tint: Int): Bitmap? {
val res = when (action) { val res = when (action) {
Preferences.SWIPE_ACTION_ARCHIVE -> R.drawable.ic_archive_black_24dp Preferences.SWIPE_ACTION_ARCHIVE -> R.drawable.ic_archive_white_24dp
Preferences.SWIPE_ACTION_DELETE -> R.drawable.ic_delete_white_24dp Preferences.SWIPE_ACTION_DELETE -> R.drawable.ic_delete_white_24dp
Preferences.SWIPE_ACTION_BLOCK -> R.drawable.ic_block_white_24dp
Preferences.SWIPE_ACTION_CALL -> R.drawable.ic_call_white_24dp Preferences.SWIPE_ACTION_CALL -> R.drawable.ic_call_white_24dp
Preferences.SWIPE_ACTION_READ -> R.drawable.ic_check_white_24dp Preferences.SWIPE_ACTION_READ -> R.drawable.ic_check_white_24dp
Preferences.SWIPE_ACTION_UNREAD -> R.drawable.ic_markunread_black_24dp Preferences.SWIPE_ACTION_UNREAD -> R.drawable.ic_markunread_black_24dp
@@ -423,6 +423,7 @@ class MainViewModel @Inject constructor(
when (action) { when (action) {
Preferences.SWIPE_ACTION_ARCHIVE -> markArchived.execute(listOf(threadId)) { view.showArchivedSnackbar() } Preferences.SWIPE_ACTION_ARCHIVE -> markArchived.execute(listOf(threadId)) { view.showArchivedSnackbar() }
Preferences.SWIPE_ACTION_DELETE -> view.showDeleteDialog(listOf(threadId)) Preferences.SWIPE_ACTION_DELETE -> view.showDeleteDialog(listOf(threadId))
Preferences.SWIPE_ACTION_BLOCK -> view.showBlockingDialog(listOf(threadId), true)
Preferences.SWIPE_ACTION_CALL -> conversationRepo.getConversation(threadId)?.recipients?.firstOrNull()?.address?.let(navigator::makePhoneCall) Preferences.SWIPE_ACTION_CALL -> conversationRepo.getConversation(threadId)?.recipients?.firstOrNull()?.address?.let(navigator::makePhoneCall)
Preferences.SWIPE_ACTION_READ -> markRead.execute(listOf(threadId)) Preferences.SWIPE_ACTION_READ -> markRead.execute(listOf(threadId))
Preferences.SWIPE_ACTION_UNREAD -> markUnread.execute(listOf(threadId)) Preferences.SWIPE_ACTION_UNREAD -> markUnread.execute(listOf(threadId))
@@ -70,8 +70,9 @@ class SwipeActionsPresenter @Inject constructor(
@DrawableRes @DrawableRes
private fun iconForAction(action: Int) = when (action) { private fun iconForAction(action: Int) = when (action) {
Preferences.SWIPE_ACTION_ARCHIVE -> R.drawable.ic_archive_black_24dp Preferences.SWIPE_ACTION_ARCHIVE -> R.drawable.ic_archive_white_24dp
Preferences.SWIPE_ACTION_DELETE -> R.drawable.ic_delete_white_24dp Preferences.SWIPE_ACTION_DELETE -> R.drawable.ic_delete_white_24dp
Preferences.SWIPE_ACTION_BLOCK -> R.drawable.ic_block_white_24dp
Preferences.SWIPE_ACTION_CALL -> R.drawable.ic_call_white_24dp Preferences.SWIPE_ACTION_CALL -> R.drawable.ic_call_white_24dp
Preferences.SWIPE_ACTION_READ -> R.drawable.ic_check_white_24dp Preferences.SWIPE_ACTION_READ -> R.drawable.ic_check_white_24dp
Preferences.SWIPE_ACTION_UNREAD -> R.drawable.ic_markunread_black_24dp Preferences.SWIPE_ACTION_UNREAD -> R.drawable.ic_markunread_black_24dp
@@ -22,9 +22,9 @@ import androidx.annotation.DrawableRes
import com.moez.QKSMS.R import com.moez.QKSMS.R
data class SwipeActionsState( data class SwipeActionsState(
@DrawableRes val rightIcon: Int = R.drawable.ic_archive_black_24dp, @DrawableRes val rightIcon: Int = R.drawable.ic_archive_white_24dp,
val rightLabel: String = "", val rightLabel: String = "",
@DrawableRes val leftIcon: Int = R.drawable.ic_archive_black_24dp, @DrawableRes val leftIcon: Int = R.drawable.ic_archive_white_24dp,
val leftLabel: String = "" val leftLabel: String = ""
) )
@@ -20,9 +20,11 @@ package com.moez.QKSMS.injection.android
import com.moez.QKSMS.feature.widget.WidgetProvider import com.moez.QKSMS.feature.widget.WidgetProvider
import com.moez.QKSMS.injection.scope.ActivityScope import com.moez.QKSMS.injection.scope.ActivityScope
import com.moez.QKSMS.receiver.BlockThreadReceiver
import com.moez.QKSMS.receiver.BootReceiver import com.moez.QKSMS.receiver.BootReceiver
import com.moez.QKSMS.receiver.DefaultSmsChangedReceiver import com.moez.QKSMS.receiver.DefaultSmsChangedReceiver
import com.moez.QKSMS.receiver.DeleteMessagesReceiver import com.moez.QKSMS.receiver.DeleteMessagesReceiver
import com.moez.QKSMS.receiver.MarkArchivedReceiver
import com.moez.QKSMS.receiver.MarkReadReceiver import com.moez.QKSMS.receiver.MarkReadReceiver
import com.moez.QKSMS.receiver.MarkSeenReceiver import com.moez.QKSMS.receiver.MarkSeenReceiver
import com.moez.QKSMS.receiver.MmsReceivedReceiver import com.moez.QKSMS.receiver.MmsReceivedReceiver
@@ -42,6 +44,10 @@ import dagger.android.ContributesAndroidInjector
@Module @Module
abstract class BroadcastReceiverBuilderModule { abstract class BroadcastReceiverBuilderModule {
@ActivityScope
@ContributesAndroidInjector()
abstract fun bindBlockThreadReceiver(): BlockThreadReceiver
@ActivityScope @ActivityScope
@ContributesAndroidInjector() @ContributesAndroidInjector()
abstract fun bindBootReceiver(): BootReceiver abstract fun bindBootReceiver(): BootReceiver
@@ -54,6 +60,10 @@ abstract class BroadcastReceiverBuilderModule {
@ContributesAndroidInjector() @ContributesAndroidInjector()
abstract fun bindDeleteMessagesReceiver(): DeleteMessagesReceiver abstract fun bindDeleteMessagesReceiver(): DeleteMessagesReceiver
@ActivityScope
@ContributesAndroidInjector
abstract fun bindMarkArchivedReceiver(): MarkArchivedReceiver
@ActivityScope @ActivityScope
@ContributesAndroidInjector() @ContributesAndroidInjector()
abstract fun bindMarkReadReceiver(): MarkReadReceiver abstract fun bindMarkReadReceiver(): MarkReadReceiver
@@ -22,6 +22,6 @@
android:viewportWidth="24.0" android:viewportWidth="24.0"
android:viewportHeight="24.0"> android:viewportHeight="24.0">
<path <path
android:fillColor="#FF000000" android:fillColor="#FFFFFFFF"
android:pathData="M20.54,5.23l-1.39,-1.68C18.88,3.21 18.47,3 18,3H6c-0.47,0 -0.88,0.21 -1.16,0.55L3.46,5.23C3.17,5.57 3,6.02 3,6.5V19c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V6.5c0,-0.48 -0.17,-0.93 -0.46,-1.27zM12,17.5L6.5,12H10v-2h4v2h3.5L12,17.5zM5.12,5l0.81,-1h12l0.94,1H5.12z" /> android:pathData="M20.54,5.23l-1.39,-1.68C18.88,3.21 18.47,3 18,3H6c-0.47,0 -0.88,0.21 -1.16,0.55L3.46,5.23C3.17,5.57 3,6.02 3,6.5V19c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V6.5c0,-0.48 -0.17,-0.93 -0.46,-1.27zM12,17.5L6.5,12H10v-2h4v2h3.5L12,17.5zM5.12,5l0.81,-1h12l0.94,1H5.12z" />
</vector> </vector>
@@ -22,6 +22,6 @@
android:viewportWidth="24.0" android:viewportWidth="24.0"
android:viewportHeight="24.0"> android:viewportHeight="24.0">
<path <path
android:fillColor="#FF000000" android:fillColor="#FFFFFFFF"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-4.42 3.58,-8 8,-8 1.85,0 3.55,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4,13.85 4,12zM12,20c-1.85,0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20,10.15 20,12c0,4.42 -3.58,8 -8,8z" /> android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM4,12c0,-4.42 3.58,-8 8,-8 1.85,0 3.55,0.63 4.9,1.69L5.69,16.9C4.63,15.55 4,13.85 4,12zM12,20c-1.85,0 -3.55,-0.63 -4.9,-1.69L18.31,7.1C19.37,8.45 20,10.15 20,12c0,4.42 -3.58,8 -8,8z" />
</vector> </vector>
@@ -48,14 +48,14 @@
android:id="@+id/archive" android:id="@+id/archive"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:icon="@drawable/ic_archive_black_24dp" app:icon="@drawable/ic_archive_white_24dp"
app:title="@string/info_archive" /> app:title="@string/info_archive" />
<com.moez.QKSMS.common.widget.PreferenceView <com.moez.QKSMS.common.widget.PreferenceView
android:id="@+id/block" android:id="@+id/block"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:icon="@drawable/ic_block_black_24dp" app:icon="@drawable/ic_block_white_24dp"
app:title="@string/info_block" /> app:title="@string/info_block" />
<com.moez.QKSMS.common.widget.PreferenceView <com.moez.QKSMS.common.widget.PreferenceView
@@ -54,7 +54,7 @@
<ImageView <ImageView
android:id="@+id/archivedIcon" android:id="@+id/archivedIcon"
style="@style/DrawerIcon" style="@style/DrawerIcon"
android:src="@drawable/ic_archive_black_24dp" android:src="@drawable/ic_archive_white_24dp"
tools:tint="?android:attr/textColorSecondary" /> tools:tint="?android:attr/textColorSecondary" />
<com.moez.QKSMS.common.widget.QkTextView <com.moez.QKSMS.common.widget.QkTextView
@@ -130,7 +130,7 @@
<ImageView <ImageView
style="@style/DrawerIcon" style="@style/DrawerIcon"
android:src="@drawable/ic_block_black_24dp" android:src="@drawable/ic_block_white_24dp"
android:tint="?android:attr/textColorSecondary" /> android:tint="?android:attr/textColorSecondary" />
<com.moez.QKSMS.common.widget.QkTextView <com.moez.QKSMS.common.widget.QkTextView
@@ -232,7 +232,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:alpha="0.25" android:alpha="0.25"
app:icon="@drawable/ic_block_black_24dp" app:icon="@drawable/ic_block_white_24dp"
app:summary="@string/qksms_plus_blacklist_summary" app:summary="@string/qksms_plus_blacklist_summary"
app:title="@string/qksms_plus_blacklist_title" /> app:title="@string/qksms_plus_blacklist_title" />
@@ -104,7 +104,7 @@
app:layout_constraintStart_toStartOf="@id/rightBackground" app:layout_constraintStart_toStartOf="@id/rightBackground"
app:layout_constraintTop_toTopOf="@id/rightBackground" app:layout_constraintTop_toTopOf="@id/rightBackground"
tools:backgroundTint="@color/tools_theme" tools:backgroundTint="@color/tools_theme"
tools:src="@drawable/ic_archive_black_24dp" tools:src="@drawable/ic_archive_white_24dp"
tools:tint="@color/textPrimaryDark" /> tools:tint="@color/textPrimaryDark" />
<ImageView <ImageView
@@ -225,7 +225,7 @@
app:layout_constraintEnd_toEndOf="@id/leftBackground" app:layout_constraintEnd_toEndOf="@id/leftBackground"
app:layout_constraintTop_toTopOf="@id/leftBackground" app:layout_constraintTop_toTopOf="@id/leftBackground"
tools:backgroundTint="@color/tools_theme" tools:backgroundTint="@color/tools_theme"
tools:src="@drawable/ic_archive_black_24dp" tools:src="@drawable/ic_archive_white_24dp"
tools:tint="@color/textPrimaryDark" /> tools:tint="@color/textPrimaryDark" />
<ImageView <ImageView
@@ -29,7 +29,7 @@
<item <item
android:id="@+id/block" android:id="@+id/block"
android:icon="@drawable/ic_block_black_24dp" android:icon="@drawable/ic_block_white_24dp"
android:title="@string/main_menu_block" android:title="@string/main_menu_block"
android:visible="false" android:visible="false"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
+2 -2
View File
@@ -22,7 +22,7 @@
<item <item
android:id="@+id/archive" android:id="@+id/archive"
android:icon="@drawable/ic_archive_black_24dp" android:icon="@drawable/ic_archive_white_24dp"
android:title="@string/main_menu_archive" android:title="@string/main_menu_archive"
android:visible="false" android:visible="false"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
@@ -78,7 +78,7 @@
<item <item
android:id="@+id/block" android:id="@+id/block"
android:icon="@drawable/ic_block_black_24dp" android:icon="@drawable/ic_block_white_24dp"
android:title="@string/main_menu_block" android:title="@string/main_menu_block"
android:visible="false" android:visible="false"
app:showAsAction="ifRoom" /> app:showAsAction="ifRoom" />
+5 -2
View File
@@ -243,6 +243,7 @@
<item>None</item> <item>None</item>
<item>Archive</item> <item>Archive</item>
<item>Delete</item> <item>Delete</item>
<item>Block</item>
<item>Call</item> <item>Call</item>
<item>Mark read</item> <item>Mark read</item>
<item>Mark unread</item> <item>Mark unread</item>
@@ -379,10 +380,12 @@
<string-array name="notification_actions"> <string-array name="notification_actions">
<item>None</item> <item>None</item>
<item>Archive</item>
<item>Delete</item>
<item>Block</item>
<item>Call</item>
<item>Mark read</item> <item>Mark read</item>
<item>Reply</item> <item>Reply</item>
<item>Call</item>
<item>Delete</item>
</string-array> </string-array>
<string name="button_yes">Yes</string> <string name="button_yes">Yes</string>