mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-21 05:28:08 +00:00
Fixed various issues
This commit is contained in:
parent
3452e641bd
commit
b4696502aa
6 changed files with 25 additions and 8 deletions
|
|
@ -62,7 +62,11 @@ class DialerViewModel : LogsUploadViewModel() {
|
|||
val onKeyClick: NumpadDigitListener = object : NumpadDigitListener {
|
||||
override fun handleClick(key: Char) {
|
||||
val sb: StringBuilder = StringBuilder(enteredUri.value)
|
||||
sb.insert(enteredUriCursorPosition, key.toString())
|
||||
try {
|
||||
sb.insert(enteredUriCursorPosition, key.toString())
|
||||
} catch (ioobe: IndexOutOfBoundsException) {
|
||||
sb.insert(sb.length, key.toString())
|
||||
}
|
||||
enteredUri.value = sb.toString()
|
||||
|
||||
if (coreContext.core.callsNb == 0) {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,14 @@ class AccountSettingsFragment : GenericFragment<SettingsAccountFragmentBinding>(
|
|||
return
|
||||
}
|
||||
|
||||
viewModel = ViewModelProvider(this, AccountSettingsViewModelFactory(identity)).get(AccountSettingsViewModel::class.java)
|
||||
try {
|
||||
viewModel = ViewModelProvider(this, AccountSettingsViewModelFactory(identity)).get(
|
||||
AccountSettingsViewModel::class.java)
|
||||
} catch (nsee: NoSuchElementException) {
|
||||
Log.e("[Account Settings] Failed to find Account object, aborting!")
|
||||
findNavController().navigateUp()
|
||||
return
|
||||
}
|
||||
binding.viewModel = viewModel
|
||||
|
||||
binding.setBackClickListener { findNavController().popBackStack() }
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ open class Contact : Comparable<Contact> {
|
|||
if (bm == null) IconCompat.createWithResource(
|
||||
coreContext.context,
|
||||
R.drawable.avatar
|
||||
) else IconCompat.createWithAdaptiveBitmap(bm)
|
||||
) else IconCompat.createWithBitmap(bm)
|
||||
if (icon != null) {
|
||||
personBuilder.setIcon(icon)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class NativeContact(val nativeId: String, private val lookupKey: String? = null)
|
|||
if (bm == null) IconCompat.createWithResource(
|
||||
coreContext.context,
|
||||
R.drawable.avatar
|
||||
) else IconCompat.createWithAdaptiveBitmap(bm)
|
||||
) else IconCompat.createWithBitmap(bm)
|
||||
if (icon != null) {
|
||||
personBuilder.setIcon(icon)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ class NotificationsManager(private val context: Context) {
|
|||
val builder = Person.Builder().setName(displayName)
|
||||
val userIcon =
|
||||
if (picture != null) {
|
||||
IconCompat.createWithAdaptiveBitmap(picture)
|
||||
IconCompat.createWithBitmap(picture)
|
||||
} else {
|
||||
IconCompat.createWithResource(context, R.drawable.avatar)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,11 +71,17 @@ class AppUtils {
|
|||
|
||||
for (i in split.indices) {
|
||||
if (split[i].isNotEmpty()) {
|
||||
if (emoji?.hasEmojiGlyph(split[i]) == true) {
|
||||
initials += emoji.process(split[i])
|
||||
} else {
|
||||
try {
|
||||
if (emoji?.hasEmojiGlyph(split[i]) == true) {
|
||||
initials += emoji.process(split[i])
|
||||
} else {
|
||||
initials += split[i][0]
|
||||
}
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e("[App Utils] Can't call hasEmojiGlyph: $ise")
|
||||
initials += split[i][0]
|
||||
}
|
||||
|
||||
characters += 1
|
||||
if (characters >= limit) break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue