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
60bc5c42
Commit
60bc5c42
authored
Dec 10, 2024
by
zhangchengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修复通讯录跳转发送短信-手机号未展示问题
parent
9ae1dc6a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
5 deletions
+29
-5
NewConversationActivity.kt
...in/com/secspace/sms/activities/NewConversationActivity.kt
+3
-1
ThreadActivity.kt
...main/kotlin/com/secspace/sms/activities/ThreadActivity.kt
+25
-3
BaseSimpleActivity.kt
...implemobiletools/commons/activities/BaseSimpleActivity.kt
+1
-1
No files found.
app/src/main/kotlin/com/secspace/sms/activities/NewConversationActivity.kt
View file @
60bc5c42
...
...
@@ -7,6 +7,7 @@ import android.view.WindowManager
import
android.widget.Toast
import
com.google.gson.Gson
import
com.reddit.indicatorfastscroll.FastScrollItemIndicator
import
com.secspace.log.Log
import
com.secspace.sms.R
import
com.secspace.sms.adapters.ContactsAdapter
import
com.secspace.sms.databinding.ActivityNewConversationBinding
...
...
@@ -262,12 +263,13 @@ class NewConversationActivity : SimpleActivity() {
val
text
=
intent
.
getStringExtra
(
Intent
.
EXTRA_TEXT
)
?:
intent
.
getStringExtra
(
"sms_body"
)
?:
""
val
numbers
=
phoneNumber
.
split
(
";"
).
toSet
()
val
number
=
if
(
numbers
.
size
==
1
)
phoneNumber
else
Gson
().
toJson
(
numbers
)
Log
.
d
(
"shuju"
,
"--NewConversationActivity--phoneNumber:$phoneNumber threadId:${getThreadId(numbers)} numbers:${numbers} text:$text "
)
Intent
(
this
,
ThreadActivity
::
class
.
java
).
apply
{
putExtra
(
THREAD_ID
,
getThreadId
(
numbers
))
putExtra
(
THREAD_TITLE
,
name
)
putExtra
(
THREAD_TEXT
,
text
)
putExtra
(
THREAD_NUMBER
,
number
)
if
(
intent
.
action
==
Intent
.
ACTION_SEND
&&
intent
.
extras
?.
containsKey
(
Intent
.
EXTRA_STREAM
)
==
true
)
{
val
uri
=
intent
.
getParcelableExtra
<
Uri
>(
Intent
.
EXTRA_STREAM
)
putExtra
(
THREAD_ATTACHMENT_URI
,
uri
?.
toString
())
...
...
app/src/main/kotlin/com/secspace/sms/activities/ThreadActivity.kt
View file @
60bc5c42
...
...
@@ -43,6 +43,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
com.google.gson.Gson
import
com.google.gson.reflect.TypeToken
import
com.secspace.log.Log
import
com.secspace.sms.R
import
com.secspace.sms.adapters.AttachmentsAdapter
import
com.secspace.sms.adapters.AutoCompleteTextViewAdapter
...
...
@@ -64,6 +65,7 @@ import com.simplemobiletools.commons.helpers.*
import
com.simplemobiletools.commons.models.PhoneNumber
import
com.simplemobiletools.commons.models.RadioItem
import
com.simplemobiletools.commons.models.SimpleContact
import
com.simplemobiletools.commons.util.GsonUtil
import
com.simplemobiletools.commons.views.MyRecyclerView
import
org.greenrobot.eventbus.EventBus
import
org.greenrobot.eventbus.Subscribe
...
...
@@ -140,6 +142,7 @@ class ThreadActivity : SimpleActivity() {
isRecycleBin
=
intent
.
getBooleanExtra
(
IS_RECYCLE_BIN
,
false
)
wasProtectionHandled
=
intent
.
getBooleanExtra
(
WAS_PROTECTION_HANDLED
,
false
)
// Log.d("shuju","----收到跳转信息---threadId:$threadId THREAD_TITLE:${intent.getStringExtra(THREAD_TITLE)} isRecycleBin:$isRecycleBin wasProtectionHandled:$wasProtectionHandled number:$number")
bus
=
EventBus
.
getDefault
()
bus
!!
.
register
(
this
)
...
...
@@ -179,9 +182,12 @@ class ThreadActivity : SimpleActivity() {
notificationManager
.
cancel
(
threadId
.
hashCode
())
ensureBackgroundThread
{
val
newConv
=
conversationsDB
.
getConversationWithThreadId
(
threadId
)
val
newConv
:
Conversation
?
=
conversationsDB
.
getConversationWithThreadId
(
threadId
)
if
(
newConv
!=
null
)
{
conversation
=
newConv
runOnUiThread
{
setupThreadTitle
()
}
}
}
...
...
@@ -336,7 +342,7 @@ class ThreadActivity : SimpleActivity() {
window
.
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_ALWAYS_VISIBLE
)
binding
.
messageHolder
.
threadTypeMessage
.
requestFocus
()
}
setupThreadTitle
()
setupSIMSelector
()
updateMessageType
()
callback
()
...
...
@@ -398,7 +404,6 @@ class ThreadActivity : SimpleActivity() {
finish
()
return
@ensureBackgroundThread
}
val
phoneNumber
=
PhoneNumber
(
number
,
0
,
""
,
number
)
val
contact
=
SimpleContact
(
0
,
0
,
name
,
""
,
arrayListOf
(
phoneNumber
),
ArrayList
(),
ArrayList
())
participants
.
add
(
contact
)
...
...
@@ -413,11 +418,28 @@ class ThreadActivity : SimpleActivity() {
setupAttachmentSizes
()
setupAdapter
()
runOnUiThread
{
setupThreadTitle
()
setupSIMSelector
()
}
}
}
private
fun
setupThreadTitle
()
{
val
title
=
conversation
?.
phoneNumber
binding
.
threadToolbar
.
title
=
if
(!
title
.
isNullOrEmpty
())
{
Log
.
d
(
"shuju"
,
"--ThreadActivity--setupThreadTitle---1 THREAD_NUMBER:$title"
)
title
}
else
{
Log
.
d
(
"shuju"
,
"--ThreadActivity--setupThreadTitle---2 THREAD_NUMBER:${intent.getStringExtra(THREAD_NUMBER)}"
)
val
phoneNUmber
=
intent
.
getStringExtra
(
THREAD_NUMBER
)
phoneNUmber
?.
let
{
binding
.
threadToolbar
.
title
=
it
.
replace
(
" "
,
""
)
}
// participants.getThreadTitle()
phoneNUmber
?.
replace
(
" "
,
""
)
}
}
private
fun
getOrCreateThreadAdapter
():
ThreadAdapter
{
var
currAdapter
=
binding
.
threadMessagesList
.
adapter
if
(
currAdapter
==
null
)
{
...
...
commons/src/main/kotlin/com/simplemobiletools/commons/activities/BaseSimpleActivity.kt
View file @
60bc5c42
...
...
@@ -379,7 +379,7 @@ abstract class BaseSimpleActivity : AppCompatActivity() {
}
}
fun
updateRecentsAppIcon
()
{
private
fun
updateRecentsAppIcon
()
{
if
(
baseConfig
.
isUsingModifiedAppIcon
)
{
val
appIconIDs
=
getAppIconIDs
()
val
currentAppIconColorIndex
=
getCurrentAppIconColorIndex
()
...
...
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