fix: 修改工程目录名称
This commit is contained in:
parent
d7c0b03a01
commit
4e0acd5335
@ -4,10 +4,10 @@
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2024-12-08T08:09:52.665646200Z">
|
||||
<DropdownSelection timestamp="2025-01-12T10:56:59.354494800Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="Default" identifier="serial=10.71.207.251:5555;connection=d2528536" />
|
||||
<DeviceId pluginId="Default" identifier="serial=192.168.31.133:5555;connection=6cfb0bcf" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
|
@ -42,6 +42,7 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.KChatAndroid"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:hardwareAccelerated="true"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".ui.activity.QrCodeActivity"
|
||||
|
@ -1,27 +0,0 @@
|
||||
package com.kaixed.kchat.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.util.TypedValue
|
||||
|
||||
/**
|
||||
* @Author: kaixed
|
||||
* @Date: 2024/12/29 22:49
|
||||
*/
|
||||
object ScreenUtils {
|
||||
private lateinit var appContext: Context
|
||||
|
||||
fun init(context: Context) {
|
||||
appContext = context
|
||||
}
|
||||
|
||||
fun getScreenWidth(): Int = appContext.resources.displayMetrics.widthPixels
|
||||
|
||||
fun getScreenHeight(): Int = appContext.resources.displayMetrics.heightPixels
|
||||
|
||||
fun dp2px(dp: Int): Int =
|
||||
TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
dp.toFloat(),
|
||||
appContext.resources.displayMetrics
|
||||
).toInt()
|
||||
}
|
@ -7,7 +7,7 @@ import com.kaixed.kchat.data.model.friend.FriendRequestItem
|
||||
import com.kaixed.kchat.data.model.search.SearchUser
|
||||
import com.kaixed.kchat.network.ApiCall.apiCall
|
||||
import com.kaixed.kchat.network.RetrofitClient
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.utils.Pinyin4jUtil
|
||||
import com.kaixed.kchat.utils.handle.ContactUtil
|
||||
import io.objectbox.Box
|
@ -10,7 +10,7 @@ import com.kaixed.kchat.network.ApiCall.apiCall
|
||||
import com.kaixed.kchat.network.RetrofitClient
|
||||
import com.kaixed.kchat.utils.Constants.MMKV_USER_SESSION
|
||||
import com.kaixed.kchat.utils.Constants.NICKNAME_KEY
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.tencent.mmkv.MMKV
|
||||
import okhttp3.MultipartBody
|
||||
|
@ -10,8 +10,8 @@ import com.kaixed.kchat.data.local.entity.Conversation
|
||||
import com.kaixed.kchat.data.local.entity.Conversation_
|
||||
import com.kaixed.kchat.data.local.entity.Messages
|
||||
import com.kaixed.kchat.data.local.entity.Messages_
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getCurrentContactId
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getCurrentContactId
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
/**
|
@ -6,9 +6,9 @@ package com.kaixed.kchat.network
|
||||
*/
|
||||
object NetworkInterface {
|
||||
|
||||
private const val URL = "app.kaixed.com/kchat"
|
||||
|
||||
// private const val URL = "app.kaixed.com/kchat"
|
||||
// private const val URL = "192.168.45.209:6196/kchat"
|
||||
private const val URL = "49.233.105.103:6000"
|
||||
const val SERVER_URL = "https://$URL"
|
||||
const val WEBSOCKET_SERVER_URL = "wss://$URL"
|
||||
const val WEBSOCKET = "/websocket/single/"
|
@ -14,8 +14,9 @@ import retrofit2.converter.gson.GsonConverterFactory
|
||||
*/
|
||||
object RetrofitClient {
|
||||
|
||||
private const val BASE_URL = "https://app.kaixed.com/kchat/"
|
||||
// private const val BASE_URL = "https://app.kaixed.com/kchat/"
|
||||
// private const val BASE_URL = "http://192.168.45.209:6196/"
|
||||
private const val BASE_URL = "http://49.233.105.103:6000/"
|
||||
|
||||
private val loggingInterceptor = HttpLoggingInterceptor().apply {
|
||||
level = HttpLoggingInterceptor.Level.BODY
|
@ -17,7 +17,7 @@ import com.kaixed.kchat.network.NetworkInterface.WEBSOCKET_SERVER_URL
|
||||
import com.kaixed.kchat.network.OkhttpHelper
|
||||
import com.kaixed.kchat.processor.MessageProcessor
|
||||
import com.kaixed.kchat.utils.Constants.MMKV_COMMON_DATA
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.utils.SingleLiveEvent
|
||||
import com.tencent.mmkv.MMKV
|
||||
import io.objectbox.Box
|
||||
@ -127,8 +127,6 @@ class WebSocketService : Service() {
|
||||
override fun onMessage(webSocket: WebSocket, text: String) {
|
||||
val messages = Gson().fromJson(text, Messages::class.java)
|
||||
|
||||
Log.d(TAG, "Message received: $messages")
|
||||
|
||||
serviceScope.launch {
|
||||
if ("ack" == messages.type) {
|
||||
val existingMessage = messagesBox.get(messages.msgLocalId)
|
@ -8,7 +8,7 @@ import androidx.activity.enableEdgeToEdge
|
||||
import androidx.activity.viewModels
|
||||
import com.kaixed.kchat.databinding.ActivityApproveContactRequestBinding
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.viewmodel.ContactViewModel
|
||||
|
||||
class ApproveContactRequestActivity : BaseActivity<ActivityApproveContactRequestBinding>() {
|
@ -48,8 +48,8 @@ import com.kaixed.kchat.ui.widget.LoadingDialogFragment
|
||||
import com.kaixed.kchat.utils.Constants.CURRENT_CONTACT_ID
|
||||
import com.kaixed.kchat.utils.Constants.KEYBOARD_HEIGHT_RATIO
|
||||
import com.kaixed.kchat.utils.Constants.MMKV_USER_SESSION
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getKeyboardHeight
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getKeyboardHeight
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.utils.ImageEngines
|
||||
import com.kaixed.kchat.utils.ImageSpanUtil.insertEmoji
|
||||
import com.kaixed.kchat.viewmodel.FileViewModel
|
||||
@ -392,9 +392,9 @@ class ChatActivity : BaseActivity<ActivityChatBinding>(), OnItemClickListener,
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
contactId = intent?.getStringExtra("contactId").toString()
|
||||
contactNickname = intent?.getStringExtra("contactNickname")
|
||||
isSearchHistory = intent?.getBooleanExtra("isSearchHistory", false) == true
|
||||
contactId = intent.getStringExtra("contactId").toString()
|
||||
contactNickname = intent.getStringExtra("contactNickname")
|
||||
isSearchHistory = intent.getBooleanExtra("isSearchHistory", false) == true
|
||||
msgLocalId = intent.getLongExtra("msgLocalId", 0)
|
||||
|
||||
binding.ctb.setTitleName(contactNickname!!)
|
||||
@ -454,6 +454,7 @@ class ChatActivity : BaseActivity<ActivityChatBinding>(), OnItemClickListener,
|
||||
jsonObject2.put("msgLocalId", id)
|
||||
jsonObject.put("type", if (type == "4") "image" else "text")
|
||||
jsonObject.put("body", jsonObject2)
|
||||
|
||||
webSocketService!!.sendMessage(jsonObject.toString(), id)
|
||||
webSocketService!!.storeOwnerMsg(messages)
|
||||
|
@ -8,7 +8,7 @@ import com.kaixed.kchat.databinding.ActivityContactRequestListBinding
|
||||
import com.kaixed.kchat.data.model.friend.FriendRequestItem
|
||||
import com.kaixed.kchat.ui.adapter.ContactRequestListAdapter
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.viewmodel.ContactViewModel
|
||||
|
||||
class ContactRequestListActivity : BaseActivity<ActivityContactRequestListBinding>() {
|
@ -11,9 +11,9 @@ import com.kaixed.kchat.data.local.entity.Contact
|
||||
import com.kaixed.kchat.data.local.entity.Contact_
|
||||
import com.kaixed.kchat.databinding.ActivityContactsDetailBinding
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getAvatarUrl
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getNickName
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getAvatarUrl
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getNickName
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
|
||||
class ContactsDetailActivity : BaseActivity<ActivityContactsDetailBinding>() {
|
||||
|
@ -9,7 +9,7 @@ import com.kaixed.kchat.databinding.ActivityDataSettingBinding
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.ui.widget.DeleteContactDialogFragment
|
||||
import com.kaixed.kchat.ui.widget.LoadingDialogFragment
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.viewmodel.ContactViewModel
|
||||
|
||||
class DataSettingActivity : BaseActivity<ActivityDataSettingBinding>(),
|
@ -18,10 +18,9 @@ import com.kaixed.kchat.data.model.dynamic.FriendCircleItem
|
||||
import com.kaixed.kchat.databinding.ActivityFriendCircleBinding
|
||||
import com.kaixed.kchat.ui.adapter.FriendCircleAdapter
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.utils.ConstantsUtil
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getAvatarUrl
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getNickName
|
||||
import com.kaixed.kchat.utils.ScreenUtils
|
||||
import com.kaixed.kchat.utils.ConstantsUtils
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getAvatarUrl
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getNickName
|
||||
import com.kaixed.kchat.utils.ScreenUtils.dp2px
|
||||
import com.kaixed.kchat.utils.TextUtil
|
||||
import kotlin.math.max
|
||||
@ -95,10 +94,10 @@ class FriendCircleActivity : BaseActivity<ActivityFriendCircleBinding>() {
|
||||
setContent()
|
||||
binding.clTool.apply {
|
||||
updateLayoutParams {
|
||||
height = ConstantsUtil.getStatusBarHeight() + dp2px(45)
|
||||
height = ConstantsUtils.getStatusBarHeight() + dp2px(45)
|
||||
}
|
||||
updatePadding(
|
||||
top = ConstantsUtil.getStatusBarHeight()
|
||||
top = ConstantsUtils.getStatusBarHeight()
|
||||
)
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import com.kaixed.kchat.R
|
||||
import com.kaixed.kchat.data.LocalDatabase
|
||||
import com.kaixed.kchat.databinding.ActivityLoginBinding
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.utils.Constants.KEYBOARD_HEIGHT
|
||||
import com.kaixed.kchat.utils.Constants.KEYBOARD_HEIGHT_RATIO
|
||||
import com.kaixed.kchat.utils.Constants.MMKV_COMMON_DATA
|
||||
import com.kaixed.kchat.utils.DrawableUtil.createDrawable
|
||||
@ -67,7 +68,7 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {
|
||||
|
||||
private fun login(username: String, password: String) {
|
||||
if (!loginByUsername) {
|
||||
if(etUsername.text.toString().length != 11){
|
||||
if (etUsername.text.toString().length != 11) {
|
||||
toast("请输入正确的手机号码")
|
||||
return
|
||||
}
|
||||
@ -136,8 +137,8 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {
|
||||
if (keypadHeight != previousKeyboardHeight) {
|
||||
previousKeyboardHeight = keypadHeight
|
||||
|
||||
val kv = MMKV.mmkvWithID(MMKV_COMMON_DATA)
|
||||
kv.encode("keyboardHeight", keypadHeight)
|
||||
val kv = MMKV.defaultMMKV()
|
||||
kv.encode(KEYBOARD_HEIGHT, keypadHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -148,15 +149,13 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
||||
override fun afterTextChanged(s: Editable) {
|
||||
|
||||
val isInputValid =
|
||||
etUsername.text.isNotEmpty() && etPassword.text.isNotEmpty()
|
||||
val isInputValid = etUsername.text.isNotEmpty() && etPassword.text.isNotEmpty()
|
||||
|
||||
binding.tvLogin.apply {
|
||||
setTextColor(
|
||||
if (isInputValid) {
|
||||
ContextCompat.getColor(
|
||||
this@LoginActivity,
|
||||
R.color.white
|
||||
this@LoginActivity, R.color.white
|
||||
)
|
||||
} else {
|
||||
Color.parseColor("#B4B4B4")
|
||||
@ -165,13 +164,11 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {
|
||||
background = createDrawable(
|
||||
if (isInputValid) {
|
||||
ContextCompat.getColor(
|
||||
this@LoginActivity,
|
||||
R.color.green
|
||||
this@LoginActivity, R.color.green
|
||||
)
|
||||
} else {
|
||||
Color.parseColor("#E1E1E1")
|
||||
},
|
||||
dp2px(8)
|
||||
}, dp2px(8)
|
||||
)
|
||||
}
|
||||
}
|
@ -30,9 +30,9 @@ import com.kaixed.kchat.ui.fragment.DiscoveryFragment
|
||||
import com.kaixed.kchat.ui.fragment.HomeFragment
|
||||
import com.kaixed.kchat.ui.fragment.MineFragment
|
||||
import com.kaixed.kchat.ui.widget.LoadingDialogFragment
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getAvatarUrl
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.isFirstLaunchApp
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getAvatarUrl
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.isFirstLaunchApp
|
||||
import com.kaixed.kchat.viewmodel.ContactViewModel
|
||||
import io.objectbox.Box
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@ -109,17 +109,21 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
val errorCode =
|
||||
data.getIntExtra(ScanUtil.RESULT_CODE, ScanUtil.SUCCESS)
|
||||
|
||||
if (errorCode == ScanUtil.ERROR_NO_READ_PERMISSION) {
|
||||
ContextCompat.checkSelfPermission(
|
||||
this,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
)
|
||||
}
|
||||
|
||||
if (errorCode == ScanUtil.SUCCESS) {
|
||||
val hmsScan: HmsScan? = data.getParcelableExtra(ScanUtil.RESULT)
|
||||
hmsScan?.let {
|
||||
handleResult(it.showResult)
|
||||
when(errorCode) {
|
||||
ScanUtil.SUCCESS -> {
|
||||
val hmsScan: HmsScan? = data.getParcelableExtra(ScanUtil.RESULT)
|
||||
hmsScan?.let {
|
||||
handleResult(it.showResult)
|
||||
}
|
||||
}
|
||||
ScanUtil.ERROR_NO_READ_PERMISSION -> {
|
||||
ContextCompat.checkSelfPermission(
|
||||
this,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
Toast.makeText(this, "扫描失败", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -161,9 +165,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
}
|
||||
contactViewModel.searchContactResult.observe(this@MainActivity) { result ->
|
||||
result.onSuccess {
|
||||
Intent(this, ApplyFriendsDetailActivity::class.java).apply {
|
||||
val intent = Intent(this, ApplyFriendsDetailActivity::class.java).apply {
|
||||
putExtra("user", it)
|
||||
}
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
result.onFailure {
|
||||
@ -175,7 +180,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
override fun initData() {
|
||||
if (isFirstLaunchApp()) {
|
||||
lifecycleScope.launch(Dispatchers.Main) {
|
||||
delay(400)
|
||||
delay(200)
|
||||
loadingDialogFragment.showLoading(supportFragmentManager)
|
||||
|
||||
contactViewModel.loadFriendList(getUsername())
|
@ -22,7 +22,7 @@ import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.ui.widget.LoadingDialogFragment
|
||||
import com.kaixed.kchat.utils.Constants.AVATAR_URL
|
||||
import com.kaixed.kchat.utils.Constants.MMKV_USER_SESSION
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.utils.TextUtil.extractDimensionsAndPrefix
|
||||
import com.kaixed.kchat.viewmodel.UserViewModel
|
||||
import com.tencent.mmkv.MMKV
|
@ -14,9 +14,9 @@ import com.huawei.hms.ml.scan.HmsScan
|
||||
import com.kaixed.kchat.R
|
||||
import com.kaixed.kchat.databinding.ActivityQrCodeBinding
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getAvatarUrl
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getNickName
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getAvatarUrl
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getNickName
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.utils.ScreenUtils
|
||||
|
||||
class QrCodeActivity : BaseActivity<ActivityQrCodeBinding>() {
|
@ -12,8 +12,8 @@ import com.kaixed.kchat.databinding.ActivityRenameBinding
|
||||
import com.kaixed.kchat.data.model.request.UserRequest
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.ui.widget.LoadingDialogFragment
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getNickName
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getNickName
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.viewmodel.UserViewModel
|
||||
import io.objectbox.Box
|
||||
|
@ -17,7 +17,7 @@ import com.kaixed.kchat.data.model.search.ChatHistoryItem
|
||||
import com.kaixed.kchat.databinding.ActivitySearchChatHistoryBinding
|
||||
import com.kaixed.kchat.ui.adapter.ChatHistoryAdapter
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import io.objectbox.Box
|
||||
|
||||
class SearchChatHistory : BaseActivity<ActivitySearchChatHistoryBinding>() {
|
@ -17,7 +17,7 @@ import com.kaixed.kchat.data.model.search.SearchUser
|
||||
import com.kaixed.kchat.databinding.ActivitySearchFriendsBinding
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.ui.widget.LoadingDialogFragment
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.viewmodel.ContactViewModel
|
||||
|
||||
class SearchFriendsActivity : BaseActivity<ActivitySearchFriendsBinding>() {
|
@ -18,7 +18,7 @@ import com.kaixed.kchat.data.local.entity.Contact
|
||||
import com.kaixed.kchat.databinding.ActivitySetRemarkAndLabelBinding
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.ui.widget.LoadingDialogFragment
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.viewmodel.ContactViewModel
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
@ -10,7 +10,7 @@ import com.kaixed.kchat.data.model.request.UpdatePasswordRequest
|
||||
import com.kaixed.kchat.databinding.ActivityUpdatePasswordBinding
|
||||
import com.kaixed.kchat.ui.base.BaseActivity
|
||||
import com.kaixed.kchat.ui.widget.LoadingDialogFragment
|
||||
import com.kaixed.kchat.utils.ConstantsUtil
|
||||
import com.kaixed.kchat.utils.ConstantsUtils
|
||||
import com.kaixed.kchat.viewmodel.UserViewModel
|
||||
|
||||
class UpdatePasswordActivity : BaseActivity<ActivityUpdatePasswordBinding>() {
|
||||
@ -54,7 +54,7 @@ class UpdatePasswordActivity : BaseActivity<ActivityUpdatePasswordBinding>() {
|
||||
} else {
|
||||
loadingDialog.showLoading(supportFragmentManager)
|
||||
val updatePassword = UpdatePasswordRequest(
|
||||
ConstantsUtil.getUsername(), oldPassword, newPassword
|
||||
ConstantsUtils.getUsername(), oldPassword, newPassword
|
||||
)
|
||||
userViewModel.updatePassword(updatePassword)
|
||||
}
|
||||
@ -79,7 +79,7 @@ class UpdatePasswordActivity : BaseActivity<ActivityUpdatePasswordBinding>() {
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
binding.tvKid.text = ConstantsUtil.getUsername()
|
||||
binding.tvKid.text = ConstantsUtils.getUsername()
|
||||
addEdittextFilter()
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ import com.kaixed.kchat.databinding.ChatRecycleItemCustomNormalBinding
|
||||
import com.kaixed.kchat.databinding.ChatRecycleItemImageNormalBinding
|
||||
import com.kaixed.kchat.databinding.ChatRecycleItemTipBinding
|
||||
import com.kaixed.kchat.manager.MessagesManager
|
||||
import com.kaixed.kchat.utils.ConstantsUtil
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.utils.PopWindowUtil.showPopupWindow
|
||||
import com.kaixed.kchat.utils.TextUtil.extractDimensionsAndPrefix
|
||||
import com.kaixed.kchat.utils.ViewUtil.changeTimerVisibility
|
||||
@ -152,7 +152,7 @@ class ChatAdapter(
|
||||
contentId = binding.tvMsgContent.id,
|
||||
contentMineId = binding.tvMsgContentMine.id
|
||||
)
|
||||
val avatarUrl = if (sender) ConstantsUtil.getAvatarUrl() else message.avatarUrl
|
||||
val avatarUrl = if (sender) ConstantsUtils.getAvatarUrl() else message.avatarUrl
|
||||
Glide.with(binding.root.context).load(avatarUrl)
|
||||
.into(if (sender) binding.ifvAvatarMine else binding.ifvAvatar)
|
||||
|
||||
@ -171,7 +171,7 @@ class ChatAdapter(
|
||||
RecyclerView.ViewHolder(binding.root), IHasTimer {
|
||||
fun bindData(message: Messages) {
|
||||
val sender = message.senderId == getUsername()
|
||||
val avatarUrl = if (sender) ConstantsUtil.getAvatarUrl() else message.avatarUrl
|
||||
val avatarUrl = if (sender) ConstantsUtils.getAvatarUrl() else message.avatarUrl
|
||||
Glide.with(binding.root.context).load(avatarUrl)
|
||||
.into(if (sender) binding.ifvAvatarMine else binding.ifvAvatar)
|
||||
|
@ -13,7 +13,7 @@ import com.drake.spannable.span.HighlightSpan
|
||||
import com.kaixed.kchat.data.model.search.ChatHistoryItem
|
||||
import com.kaixed.kchat.databinding.ChatHistoryRecycleItemBinding
|
||||
import com.kaixed.kchat.ui.activity.ChatActivity
|
||||
import com.kaixed.kchat.utils.ConstantsUtil
|
||||
import com.kaixed.kchat.utils.ConstantsUtils
|
||||
import com.kaixed.kchat.utils.TextUtil
|
||||
|
||||
/**
|
||||
@ -57,9 +57,9 @@ class ChatHistoryAdapter(
|
||||
highlightSpan
|
||||
}
|
||||
bind.tvNickname.text =
|
||||
if (chatHistoryItem.isMine) ConstantsUtil.getNickName() else contactNickname
|
||||
if (chatHistoryItem.isMine) ConstantsUtils.getNickName() else contactNickname
|
||||
val avatarUrl =
|
||||
if (chatHistoryItem.isMine) ConstantsUtil.getAvatarUrl() else contactAvatarUrl
|
||||
if (chatHistoryItem.isMine) ConstantsUtils.getAvatarUrl() else contactAvatarUrl
|
||||
Glide.with(bind.root.context).load(avatarUrl).into(bind.ifvAvatar)
|
||||
bind.root.postDelayed({
|
||||
val intent = Intent(context, ChatActivity::class.java).apply {
|
@ -7,7 +7,7 @@ import android.view.ViewGroup
|
||||
import androidx.core.view.updatePadding
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getStatusBarHeight
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getStatusBarHeight
|
||||
|
||||
/**
|
||||
* @Author: kaixed
|
@ -15,7 +15,7 @@ import com.kaixed.kchat.data.local.entity.Contact
|
||||
import com.kaixed.kchat.databinding.FragmentContactBinding
|
||||
import com.kaixed.kchat.ui.adapter.FriendListAdapter
|
||||
import com.kaixed.kchat.ui.base.BaseFragment
|
||||
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
|
||||
import com.kaixed.kchat.utils.ConstantsUtils.getUsername
|
||||
import com.kaixed.kchat.viewmodel.ContactViewModel
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user