Commit c37ab652 by zhangchengbo

fix:手机号码更换为名称显示

parent 5f343c90
......@@ -529,7 +529,7 @@ class MainActivity : SimpleActivity() {
Intent(this, ThreadActivity::class.java).apply {
val conversation = any as Conversation
putExtra(THREAD_ID, conversation.threadId)
putExtra(THREAD_TITLE, conversation.phoneNumber)
putExtra(THREAD_TITLE, conversation.title)
putExtra(WAS_PROTECTION_HANDLED, wasProtectionHandled)
startActivity(this)
}
......
......@@ -138,6 +138,7 @@ class ThreadActivity : SimpleActivity() {
threadId = intent.getLongExtra(THREAD_ID, 0L)
intent.getStringExtra(THREAD_TITLE)?.let {
binding.threadToolbar.title = it
android.util.Log.d("shuju", "ThreadActivity OnCreate title = $it")
}
isRecycleBin = intent.getBooleanExtra(IS_RECYCLE_BIN, false)
wasProtectionHandled = intent.getBooleanExtra(WAS_PROTECTION_HANDLED, false)
......@@ -425,9 +426,11 @@ class ThreadActivity : SimpleActivity() {
}
private fun setupThreadTitle() {
val title = conversation?.phoneNumber
Log.d("shuju","--ThreadActivity--setupThreadTitle-- conversation:${Gson().toJson(conversation)}")
val title = conversation?.title
binding.threadToolbar.title = if (!title.isNullOrEmpty()) {
Log.d("shuju","--ThreadActivity--setupThreadTitle---1 THREAD_NUMBER:$title")
// "$title ${conversation?.phoneNumber}"
title
} else {
Log.d("shuju","--ThreadActivity--setupThreadTitle---2 THREAD_NUMBER:${intent.getStringExtra(THREAD_NUMBER)}")
......
......@@ -2,6 +2,7 @@ package com.secspace.sms.adapters
import android.graphics.Typeface
import android.os.Parcelable
import android.util.Log
import android.util.TypedValue
import android.view.View
import android.view.ViewGroup
......@@ -124,9 +125,8 @@ abstract class BaseConversationsAdapter(
conversationFrame.isSelected = selectedKeys.contains(conversation.hashCode())
conversationAddress.apply {
// text = conversation.title
text = conversation.phoneNumber
// Log.e("shuju", "----BaseAdapter----conversationAddress:${conversation.phoneNumber}")
text = conversation.title
Log.e("shuju", "----BaseAdapter----conversationAddress:${conversation.title} name = $${conversation.phoneNumber}")
setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize * 1.2f)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment