Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Simple-Sms
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangchengbo
Simple-Sms
Commits
9f95a89f
Commit
9f95a89f
authored
Jun 16, 2025
by
zhangchengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:添加跳转通讯录
parent
5c80d891
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
Activity.kt
app/src/main/kotlin/com/secspace/sms/extensions/Activity.kt
+17
-5
No files found.
app/src/main/kotlin/com/secspace/sms/extensions/Activity.kt
View file @
9f95a89f
...
@@ -5,14 +5,25 @@ import android.content.ActivityNotFoundException
...
@@ -5,14 +5,25 @@ import android.content.ActivityNotFoundException
import
android.content.Intent
import
android.content.Intent
import
android.net.Uri
import
android.net.Uri
import
android.provider.ContactsContract
import
android.provider.ContactsContract
import
com.secspace.sms.activities.SimpleActivity
import
com.simplemobiletools.commons.extensions.*
import
com.simplemobiletools.commons.extensions.*
import
com.simplemobiletools.commons.helpers.CONTACT_ID
import
com.simplemobiletools.commons.helpers.*
import
com.simplemobiletools.commons.helpers.IS_PRIVATE
import
com.simplemobiletools.commons.helpers.SimpleContactsHelper
import
com.simplemobiletools.commons.helpers.ensureBackgroundThread
import
com.simplemobiletools.commons.models.SimpleContact
import
com.simplemobiletools.commons.models.SimpleContact
import
java.util.Locale
import
java.util.Locale
fun
SimpleActivity
.
addNumberToContact
(
recipient
:
String
)
{
Intent
().
apply
{
action
=
Intent
.
ACTION_EDIT
type
=
"vnd.android.cursor.item/contact"
putExtra
(
KEY_PHONE
,
recipient
)
launchActivityIntent
(
this
)
}
}
fun
SimpleActivity
.
startCallIntent
(
recipient
:
String
)
{
launchCallIntent
(
recipient
,
null
)
}
fun
Activity
.
dialNumber
(
phoneNumber
:
String
,
callback
:
(()
->
Unit
)?
=
null
)
{
fun
Activity
.
dialNumber
(
phoneNumber
:
String
,
callback
:
(()
->
Unit
)?
=
null
)
{
hideKeyboard
()
hideKeyboard
()
Intent
(
Intent
.
ACTION_DIAL
).
apply
{
Intent
(
Intent
.
ACTION_DIAL
).
apply
{
...
@@ -52,7 +63,7 @@ fun Activity.launchViewIntent(uri: Uri, mimetype: String, filename: String) {
...
@@ -52,7 +63,7 @@ fun Activity.launchViewIntent(uri: Uri, mimetype: String, filename: String) {
}
}
fun
Activity
.
startContactDetailsIntent
(
contact
:
SimpleContact
)
{
fun
Activity
.
startContactDetailsIntent
(
contact
:
SimpleContact
)
{
val
simpleContacts
=
"com.secspace.contacts"
val
simpleContacts
=
Const
.
PACKAGE_CONTACTS
if
(
contact
.
rawId
>
1000000
&&
contact
.
contactId
>
1000000
&&
contact
.
rawId
==
contact
.
contactId
&&
if
(
contact
.
rawId
>
1000000
&&
contact
.
contactId
>
1000000
&&
contact
.
rawId
==
contact
.
contactId
&&
(
isPackageInstalled
(
simpleContacts
))
(
isPackageInstalled
(
simpleContacts
))
)
{
)
{
...
@@ -74,4 +85,5 @@ fun Activity.startContactDetailsIntent(contact: SimpleContact) {
...
@@ -74,4 +85,5 @@ fun Activity.startContactDetailsIntent(contact: SimpleContact) {
}
}
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment