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