mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
updating commons and min SDK to 23
This commit is contained in:
@@ -14,7 +14,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.simplemobiletools.smsmessenger"
|
applicationId "com.simplemobiletools.smsmessenger"
|
||||||
minSdkVersion 22
|
minSdkVersion 23
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode 67
|
versionCode 67
|
||||||
versionName "5.16.6"
|
versionName "5.16.6"
|
||||||
@@ -63,7 +63,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:0b7d7267b4'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:e87747e2d5'
|
||||||
implementation 'org.greenrobot:eventbus:3.3.1'
|
implementation 'org.greenrobot:eventbus:3.3.1'
|
||||||
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
||||||
implementation 'com.github.tibbi:android-smsmms:33fcaf94d9'
|
implementation 'com.github.tibbi:android-smsmms:33fcaf94d9'
|
||||||
|
@@ -47,16 +47,19 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.MainActivity"
|
android:name=".activities.MainActivity"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ThreadActivity"
|
android:name=".activities.ThreadActivity"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:parentActivityName=".activities.MainActivity"
|
android:parentActivityName=".activities.MainActivity"
|
||||||
android:windowSoftInputMode="adjustResize" />
|
android:windowSoftInputMode="adjustResize" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SearchActivity"
|
android:name=".activities.SearchActivity"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label=""
|
android:label=""
|
||||||
android:parentActivityName=".activities.MainActivity"
|
android:parentActivityName=".activities.MainActivity"
|
||||||
@@ -73,6 +76,7 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.NewConversationActivity"
|
android:name=".activities.NewConversationActivity"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:parentActivityName=".activities.MainActivity">
|
android:parentActivityName=".activities.MainActivity">
|
||||||
|
|
||||||
@@ -107,6 +111,7 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SettingsActivity"
|
android:name=".activities.SettingsActivity"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:label="@string/settings"
|
android:label="@string/settings"
|
||||||
android:parentActivityName=".activities.MainActivity">
|
android:parentActivityName=".activities.MainActivity">
|
||||||
@@ -119,30 +124,35 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.simplemobiletools.commons.activities.AboutActivity"
|
android:name="com.simplemobiletools.commons.activities.AboutActivity"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="@string/about"
|
android:label="@string/about"
|
||||||
android:parentActivityName=".activities.MainActivity" />
|
android:parentActivityName=".activities.MainActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
|
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="@string/customize_colors"
|
android:label="@string/customize_colors"
|
||||||
android:parentActivityName=".activities.SettingsActivity" />
|
android:parentActivityName=".activities.SettingsActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.simplemobiletools.commons.activities.ManageBlockedNumbersActivity"
|
android:name="com.simplemobiletools.commons.activities.ManageBlockedNumbersActivity"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="@string/blocked_numbers"
|
android:label="@string/blocked_numbers"
|
||||||
android:parentActivityName=".activities.SettingsActivity" />
|
android:parentActivityName=".activities.SettingsActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.VCardViewerActivity"
|
android:name=".activities.VCardViewerActivity"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="@string/contact_details"
|
android:label="@string/contact_details"
|
||||||
android:parentActivityName=".activities.ThreadActivity" />
|
android:parentActivityName=".activities.ThreadActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.ConversationDetailsActivity"
|
android:name=".activities.ConversationDetailsActivity"
|
||||||
|
android:configChanges="orientation"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="@string/conversation_details"
|
android:label="@string/conversation_details"
|
||||||
android:parentActivityName=".activities.ThreadActivity" />
|
android:parentActivityName=".activities.ThreadActivity" />
|
||||||
|
@@ -679,26 +679,18 @@ fun Context.updateUnreadCountBadge(conversations: List<Conversation>) {
|
|||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
fun Context.getThreadId(address: String): Long {
|
fun Context.getThreadId(address: String): Long {
|
||||||
return if (isMarshmallowPlus()) {
|
return try {
|
||||||
try {
|
Threads.getOrCreateThreadId(this, address)
|
||||||
Threads.getOrCreateThreadId(this, address)
|
} catch (e: Exception) {
|
||||||
} catch (e: Exception) {
|
|
||||||
0L
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
0L
|
0L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
fun Context.getThreadId(addresses: Set<String>): Long {
|
fun Context.getThreadId(addresses: Set<String>): Long {
|
||||||
return if (isMarshmallowPlus()) {
|
return try {
|
||||||
try {
|
Threads.getOrCreateThreadId(this, addresses)
|
||||||
Threads.getOrCreateThreadId(this, addresses)
|
} catch (e: Exception) {
|
||||||
} catch (e: Exception) {
|
|
||||||
0L
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
0L
|
0L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -896,12 +888,7 @@ fun Context.clearAllMessagesIfNeeded() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Context.subscriptionManagerCompat(): SubscriptionManager {
|
fun Context.subscriptionManagerCompat(): SubscriptionManager {
|
||||||
return if (isMarshmallowPlus()) {
|
return getSystemService(SubscriptionManager::class.java)
|
||||||
getSystemService(SubscriptionManager::class.java)
|
|
||||||
} else {
|
|
||||||
@Suppress("DEPRECATION")
|
|
||||||
SubscriptionManager.from(this)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.renameConversation(conversation: Conversation, newTitle: String): Conversation {
|
fun Context.renameConversation(conversation: Conversation, newTitle: String): Conversation {
|
||||||
|
@@ -9,7 +9,6 @@ import com.klinker.android.send_message.Settings
|
|||||||
import com.klinker.android.send_message.Transaction
|
import com.klinker.android.send_message.Transaction
|
||||||
import com.klinker.android.send_message.Utils
|
import com.klinker.android.send_message.Utils
|
||||||
import com.simplemobiletools.commons.extensions.showErrorToast
|
import com.simplemobiletools.commons.extensions.showErrorToast
|
||||||
import com.simplemobiletools.commons.helpers.isMarshmallowPlus
|
|
||||||
import com.simplemobiletools.smsmessenger.R
|
import com.simplemobiletools.smsmessenger.R
|
||||||
import com.simplemobiletools.smsmessenger.extensions.config
|
import com.simplemobiletools.smsmessenger.extensions.config
|
||||||
import com.simplemobiletools.smsmessenger.extensions.isPlainTextMimeType
|
import com.simplemobiletools.smsmessenger.extensions.isPlainTextMimeType
|
||||||
@@ -81,11 +80,7 @@ fun Context.getScheduleSendPendingIntent(message: Message): PendingIntent {
|
|||||||
intent.putExtra(THREAD_ID, message.threadId)
|
intent.putExtra(THREAD_ID, message.threadId)
|
||||||
intent.putExtra(SCHEDULED_MESSAGE_ID, message.id)
|
intent.putExtra(SCHEDULED_MESSAGE_ID, message.id)
|
||||||
|
|
||||||
var flags = PendingIntent.FLAG_UPDATE_CURRENT
|
val flags = PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
if (isMarshmallowPlus()) {
|
|
||||||
flags = flags or PendingIntent.FLAG_IMMUTABLE
|
|
||||||
}
|
|
||||||
|
|
||||||
return PendingIntent.getBroadcast(this, message.id.toInt(), intent, flags)
|
return PendingIntent.getBroadcast(this, message.id.toInt(), intent, flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,11 +94,7 @@ fun Context.scheduleMessage(message: Message) {
|
|||||||
|
|
||||||
fun Context.cancelScheduleSendPendingIntent(messageId: Long) {
|
fun Context.cancelScheduleSendPendingIntent(messageId: Long) {
|
||||||
val intent = Intent(this, ScheduledMessageReceiver::class.java)
|
val intent = Intent(this, ScheduledMessageReceiver::class.java)
|
||||||
var flags = PendingIntent.FLAG_UPDATE_CURRENT
|
val flags = PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
if (isMarshmallowPlus()) {
|
|
||||||
flags = flags or PendingIntent.FLAG_IMMUTABLE
|
|
||||||
}
|
|
||||||
|
|
||||||
PendingIntent.getBroadcast(this, messageId.toInt(), intent, flags).cancel()
|
PendingIntent.getBroadcast(this, messageId.toInt(), intent, flags).cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,7 +13,9 @@
|
|||||||
android:id="@+id/conversation_holder"
|
android:id="@+id/conversation_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/small_margin"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin"
|
||||||
|
android:paddingEnd="@dimen/normal_margin"
|
||||||
android:paddingBottom="@dimen/activity_margin">
|
android:paddingBottom="@dimen/activity_margin">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -40,8 +42,9 @@
|
|||||||
android:id="@+id/pin_indicator"
|
android:id="@+id/pin_indicator"
|
||||||
android:layout_width="@dimen/pin_icon_size"
|
android:layout_width="@dimen/pin_icon_size"
|
||||||
android:layout_height="@dimen/pin_icon_size"
|
android:layout_height="@dimen/pin_icon_size"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:src="@drawable/ic_pin" />
|
android:src="@drawable/ic_pin_filled_vector" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@@ -45,12 +45,12 @@
|
|||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/cab_pin_conversation"
|
android:id="@+id/cab_pin_conversation"
|
||||||
android:icon="@drawable/ic_pin"
|
android:icon="@drawable/ic_pin_filled_vector"
|
||||||
android:title="@string/pin_conversation"
|
android:title="@string/pin_conversation"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/cab_unpin_conversation"
|
android:id="@+id/cab_unpin_conversation"
|
||||||
android:icon="@drawable/ic_unpin"
|
android:icon="@drawable/ic_pin_filled_vector"
|
||||||
android:title="@string/unpin_conversation"
|
android:title="@string/unpin_conversation"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
<item
|
<item
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
android:id="@+id/cab_delete"
|
android:id="@+id/cab_delete"
|
||||||
android:icon="@drawable/ic_delete_vector"
|
android:icon="@drawable/ic_delete_vector"
|
||||||
android:title="@string/delete"
|
android:title="@string/delete"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="always" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/cab_save_as"
|
android:id="@+id/cab_save_as"
|
||||||
android:icon="@drawable/ic_save_vector"
|
android:icon="@drawable/ic_save_vector"
|
||||||
|
@@ -20,9 +20,9 @@
|
|||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/more_apps_from_us"
|
android:id="@+id/more_apps_from_us"
|
||||||
android:showAsAction="never"
|
android:icon="@drawable/ic_google_play_vector"
|
||||||
android:title="@string/more_apps_from_us"
|
android:title="@string/more_apps_from_us"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="always" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/settings"
|
android:id="@+id/settings"
|
||||||
android:icon="@drawable/ic_settings_cog_vector"
|
android:icon="@drawable/ic_settings_cog_vector"
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
android:id="@+id/rename_conversation"
|
android:id="@+id/rename_conversation"
|
||||||
android:icon="@drawable/ic_edit_vector"
|
android:icon="@drawable/ic_edit_vector"
|
||||||
android:title="@string/rename_conversation"
|
android:title="@string/rename_conversation"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="always" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/conversation_details"
|
android:id="@+id/conversation_details"
|
||||||
android:icon="@drawable/ic_info_vector"
|
android:icon="@drawable/ic_info_vector"
|
||||||
|
Reference in New Issue
Block a user