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
9a26ec88
Commit
9a26ec88
authored
Jun 20, 2025
by
zhangchengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加[保存至已有联系人]功能
parent
565ed28f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
9 deletions
+37
-9
ConversationsAdapter.kt
.../kotlin/com/secspace/sms/adapters/ConversationsAdapter.kt
+0
-9
ThreadAdapter.kt
...rc/main/kotlin/com/secspace/sms/adapters/ThreadAdapter.kt
+3
-0
Activity.kt
app/src/main/kotlin/com/secspace/sms/extensions/Activity.kt
+9
-0
TipPopup.kt
app/src/main/kotlin/com/secspace/sms/popup/TipPopup.kt
+6
-0
d_ui_tips_popup.xml
app/src/main/res/layout/d_ui_tips_popup.xml
+19
-0
No files found.
app/src/main/kotlin/com/secspace/sms/adapters/ConversationsAdapter.kt
View file @
9a26ec88
...
@@ -249,15 +249,6 @@ class ConversationsAdapter(
...
@@ -249,15 +249,6 @@ class ConversationsAdapter(
}
}
}
}
private
fun
addNumberToContact
()
{
val
conversation
=
getSelectedItems
().
firstOrNull
()
?:
return
Intent
().
apply
{
action
=
Intent
.
ACTION_INSERT_OR_EDIT
type
=
"vnd.android.cursor.item/contact"
putExtra
(
KEY_PHONE
,
conversation
.
phoneNumber
)
activity
.
launchActivityIntent
(
this
)
}
}
private
fun
pinConversation
(
pin
:
Boolean
)
{
private
fun
pinConversation
(
pin
:
Boolean
)
{
val
conversations
=
getSelectedItems
()
val
conversations
=
getSelectedItems
()
...
...
app/src/main/kotlin/com/secspace/sms/adapters/ThreadAdapter.kt
View file @
9a26ec88
...
@@ -75,6 +75,9 @@ class ThreadAdapter(
...
@@ -75,6 +75,9 @@ class ThreadAdapter(
5
->{
5
->{
activity
.
addNumberToContact
(
phoneNumber
)
activity
.
addNumberToContact
(
phoneNumber
)
}
}
6
->{
activity
.
addNumberOrEditToContact
(
phoneNumber
)
}
}
}
}
}
}
}
...
...
app/src/main/kotlin/com/secspace/sms/extensions/Activity.kt
View file @
9a26ec88
...
@@ -11,6 +11,15 @@ import com.simplemobiletools.commons.helpers.*
...
@@ -11,6 +11,15 @@ import com.simplemobiletools.commons.helpers.*
import
com.simplemobiletools.commons.models.SimpleContact
import
com.simplemobiletools.commons.models.SimpleContact
import
java.util.Locale
import
java.util.Locale
fun
SimpleActivity
.
addNumberOrEditToContact
(
phoneNumber
:
String
)
{
Intent
().
apply
{
action
=
Intent
.
ACTION_INSERT_OR_EDIT
type
=
"vnd.android.cursor.item/contact"
putExtra
(
KEY_PHONE
,
phoneNumber
)
launchActivityIntent
(
this
)
}
}
fun
SimpleActivity
.
addNumberToContact
(
recipient
:
String
)
{
fun
SimpleActivity
.
addNumberToContact
(
recipient
:
String
)
{
Intent
().
apply
{
Intent
().
apply
{
action
=
Intent
.
ACTION_EDIT
action
=
Intent
.
ACTION_EDIT
...
...
app/src/main/kotlin/com/secspace/sms/popup/TipPopup.kt
View file @
9a26ec88
...
@@ -19,8 +19,10 @@ class TipPopup(mContext: Context, private val sureResult: (Int,String) -> Unit)
...
@@ -19,8 +19,10 @@ class TipPopup(mContext: Context, private val sureResult: (Int,String) -> Unit)
private
val
tvSendSms
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_send_sms
)
}
private
val
tvSendSms
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_send_sms
)
}
private
val
tvCopy
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_copy_phone_number
)
}
private
val
tvCopy
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_copy_phone_number
)
}
private
val
tvAddContacts
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_add_contacts
)
}
private
val
tvAddContacts
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_add_contacts
)
}
private
val
tvSaveContacts
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_save_contacts
)
}
private
val
tvCancel
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_cancel_pop
)
}
private
val
tvCancel
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_cancel_pop
)
}
private
var
phoneNumbers
:
String
=
""
private
var
phoneNumbers
:
String
=
""
init
{
init
{
setContentView
(
R
.
layout
.
d_ui_tips_popup
)
setContentView
(
R
.
layout
.
d_ui_tips_popup
)
...
@@ -55,6 +57,10 @@ class TipPopup(mContext: Context, private val sureResult: (Int,String) -> Unit)
...
@@ -55,6 +57,10 @@ class TipPopup(mContext: Context, private val sureResult: (Int,String) -> Unit)
sureResult
.
invoke
(
5
,
phoneNumbers
)
sureResult
.
invoke
(
5
,
phoneNumbers
)
dismiss
()
dismiss
()
}
}
tvSaveContacts
.
setOnClickListener
{
sureResult
.
invoke
(
6
,
phoneNumbers
)
dismiss
()
}
}
}
fun
setPhoneNumberData
(
phoneNumber
:
String
)
{
fun
setPhoneNumberData
(
phoneNumber
:
String
)
{
...
...
app/src/main/res/layout/d_ui_tips_popup.xml
View file @
9a26ec88
...
@@ -105,6 +105,25 @@
...
@@ -105,6 +105,25 @@
android:textColor=
"@color/md_grey_black"
android:textColor=
"@color/md_grey_black"
android:textSize=
"16sp"
/>
android:textSize=
"16sp"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/divider_height"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"15dp"
android:background=
"@color/divider_grey"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_save_contacts"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"5dp"
android:minHeight=
"30dp"
android:text=
"保存至已有联系人"
android:textColor=
"@color/md_grey_black"
android:textSize=
"16sp"
/>
<androidx.appcompat.widget.AppCompatTextView
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_cancel_pop"
android:id=
"@+id/tv_cancel_pop"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
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