mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Code small improvements
This commit is contained in:
parent
77b933c5a8
commit
2a9ef440b7
18 changed files with 28 additions and 159 deletions
|
|
@ -1209,7 +1209,7 @@ class NotificationsManager
|
|||
.setContentIntent(pendingIntent)
|
||||
.build()
|
||||
|
||||
accountsErrorNotificationsMap.put(identity, notificationId)
|
||||
accountsErrorNotificationsMap[identity] = notificationId
|
||||
Log.i("$TAG Showing account registration error notification with ID [$notificationId] for [$identity]")
|
||||
notify(notificationId, notification, ACCOUNT_ERROR_TAG)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,15 +46,8 @@ class TelecomCallControlCallback(
|
|||
) {
|
||||
companion object {
|
||||
private const val TAG = "[Telecom Call Control Callback]"
|
||||
|
||||
private const val DELAY_BEFORE_RELOADING_SOUND_DEVICES_MS = 100L
|
||||
}
|
||||
|
||||
private var availableEndpoints: List<CallEndpointCompat> = arrayListOf()
|
||||
private var currentEndpoint = CallEndpointCompat.TYPE_UNKNOWN
|
||||
private var endpointUpdateRequestFromLinphone: Boolean = false
|
||||
private var latestLinphoneRequestedEndpoint: CallEndpointCompat? = null
|
||||
|
||||
private var mutedByTelecomManager = false
|
||||
|
||||
private val callListener = object : CallListenerStub() {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class ConferenceParticipantsListAdapter :
|
|||
(holder as ViewHolder).bind(getItem(position))
|
||||
}
|
||||
|
||||
inner class ViewHolder(
|
||||
class ViewHolder(
|
||||
val binding: CallConferenceParticipantListCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@UiThread
|
||||
|
|
|
|||
|
|
@ -332,9 +332,8 @@ class TransferCallFragment : GenericCallFragment() {
|
|||
model.confirmEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
coreContext.postOnCoreThread {
|
||||
val address = toAddress
|
||||
Log.i("$TAG Transferring (blind) call to [${address.asStringUriOnly()}]")
|
||||
callViewModel.blindTransferCallTo(address)
|
||||
Log.i("$TAG Transferring (blind) call to [${toAddress.asStringUriOnly()}]")
|
||||
callViewModel.blindTransferCallTo(toAddress)
|
||||
}
|
||||
|
||||
dialog.dismiss()
|
||||
|
|
|
|||
|
|
@ -130,8 +130,7 @@ class FileViewModel
|
|||
val extension = FileUtils.getExtensionFromFileName(file)
|
||||
val mime = FileUtils.getMimeTypeFromExtension(extension)
|
||||
mimeType.postValue(mime)
|
||||
val mimeType = FileUtils.getMimeType(mime)
|
||||
when (mimeType) {
|
||||
when (val mimeType = FileUtils.getMimeType(mime)) {
|
||||
FileUtils.MimeType.Pdf -> {
|
||||
Log.d("$TAG File [$file] seems to be a PDF")
|
||||
loadPdf()
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class ConversationsContactsAndSuggestionsListAdapter :
|
|||
}
|
||||
}
|
||||
|
||||
inner class ConversationViewHolder(
|
||||
class ConversationViewHolder(
|
||||
val binding: GenericAddressPickerConversationListCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@UiThread
|
||||
|
|
@ -198,7 +198,7 @@ class ConversationsContactsAndSuggestionsListAdapter :
|
|||
}
|
||||
}
|
||||
|
||||
inner class SuggestionViewHolder(
|
||||
class SuggestionViewHolder(
|
||||
val binding: GenericAddressPickerSuggestionListCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@UiThread
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ class ConversationEventAdapter :
|
|||
}
|
||||
}
|
||||
|
||||
inner class IncomingBubbleViewHolder(
|
||||
class IncomingBubbleViewHolder(
|
||||
val binding: ChatBubbleIncomingBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(message: MessageModel) {
|
||||
|
|
@ -217,7 +217,7 @@ class ConversationEventAdapter :
|
|||
}
|
||||
}
|
||||
|
||||
inner class OutgoingBubbleViewHolder(
|
||||
class OutgoingBubbleViewHolder(
|
||||
val binding: ChatBubbleOutgoingBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(message: MessageModel) {
|
||||
|
|
@ -232,7 +232,7 @@ class ConversationEventAdapter :
|
|||
}
|
||||
}
|
||||
|
||||
inner class EventViewHolder(
|
||||
class EventViewHolder(
|
||||
val binding: ChatConversationEventBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(event: EventModel) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class ConversationParticipantsAdapter : ListAdapter<ParticipantModel, RecyclerVi
|
|||
(holder as ViewHolder).bind(getItem(position))
|
||||
}
|
||||
|
||||
inner class ViewHolder(
|
||||
class ViewHolder(
|
||||
val binding: ChatParticipantListCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@UiThread
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class ConversationsFilesAdapter :
|
|||
}
|
||||
}
|
||||
|
||||
inner class MediaFileViewHolder(
|
||||
class MediaFileViewHolder(
|
||||
val binding: ChatMediaContentGridCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@UiThread
|
||||
|
|
@ -127,7 +127,7 @@ class ConversationsFilesAdapter :
|
|||
}
|
||||
}
|
||||
|
||||
inner class DocumentFileViewHolder(
|
||||
class DocumentFileViewHolder(
|
||||
val binding: ChatBubbleSingleFileContentBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@UiThread
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class MessageBottomSheetAdapter : ListAdapter<MessageBottomSheetParticipantModel
|
|||
(holder as ViewHolder).bind(getItem(position))
|
||||
}
|
||||
|
||||
inner class ViewHolder(
|
||||
class ViewHolder(
|
||||
val binding: ChatMessageBottomSheetListCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@UiThread
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class ContactHistoryListAdapter : ListAdapter<CallLogHistoryModel, RecyclerView.
|
|||
(holder as ViewHolder).bind(getItem(position))
|
||||
}
|
||||
|
||||
inner class ViewHolder(
|
||||
class ViewHolder(
|
||||
val binding: HistoryCallListCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@UiThread
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class MeetingParticipantsAdapter : ListAdapter<ParticipantModel, RecyclerView.Vi
|
|||
(holder as ViewHolder).bind(getItem(position))
|
||||
}
|
||||
|
||||
inner class ViewHolder(
|
||||
class ViewHolder(
|
||||
val binding: MeetingParticipantListCellBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@UiThread
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class MeetingsListAdapter :
|
|||
}
|
||||
}
|
||||
|
||||
inner class TodayIndicatorViewHolder(
|
||||
class TodayIndicatorViewHolder(
|
||||
val binding: MeetingListTodayIndicatorBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
@UiThread
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class WelcomeActivity : GenericActivity() {
|
|||
startActivity(intent)
|
||||
}
|
||||
|
||||
private inner class ScreenSlidePagerAdapter(fa: FragmentActivity) : FragmentStateAdapter(fa) {
|
||||
private class ScreenSlidePagerAdapter(fa: FragmentActivity) : FragmentStateAdapter(fa) {
|
||||
override fun getItemCount(): Int = PAGES
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ import org.linphone.databinding.DialogConfirmTurningOnVfsBinding
|
|||
import org.linphone.databinding.DialogContactConfirmTrustCallBinding
|
||||
import org.linphone.databinding.DialogContactTrustProcessBinding
|
||||
import org.linphone.databinding.DialogDeleteContactBinding
|
||||
import org.linphone.databinding.DialogDeleteMeetingBinding
|
||||
import org.linphone.databinding.DialogKickFromConferenceBinding
|
||||
import org.linphone.databinding.DialogManageAccountInternationalPrefixHelpBinding
|
||||
import org.linphone.databinding.DialogMergeCallsIntoConferenceBinding
|
||||
|
|
@ -534,22 +533,6 @@ class DialogUtils {
|
|||
return getDialog(context, binding)
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun getDeleteMeetingDialog(
|
||||
context: Context,
|
||||
viewModel: ConfirmationDialogModel
|
||||
): Dialog {
|
||||
val binding: DialogDeleteMeetingBinding = DataBindingUtil.inflate(
|
||||
LayoutInflater.from(context),
|
||||
R.layout.dialog_delete_meeting,
|
||||
null,
|
||||
false
|
||||
)
|
||||
binding.viewModel = viewModel
|
||||
|
||||
return getDialog(context, binding)
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun getHowToDeleteMessageDialog(
|
||||
context: Context,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import java.util.regex.Pattern
|
|||
class PatternClickableSpan {
|
||||
private var patterns: ArrayList<SpannablePatternItem> = ArrayList()
|
||||
|
||||
inner class SpannablePatternItem(
|
||||
class SpannablePatternItem(
|
||||
var pattern: Pattern,
|
||||
var listener: SpannableClickedListener
|
||||
)
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ class ShortcutUtils {
|
|||
.setIsConversation()
|
||||
.setLongLived(Version.sdkAboveOrEqual(Version.API30_ANDROID_11))
|
||||
.setLocusId(LocusIdCompat(id))
|
||||
|
||||
// See https://developer.android.com/training/sharing/direct-share-targets#track-shortcut-usage-comms-apps
|
||||
if (isGroup) {
|
||||
builder.addCapabilityBinding("actions.intent.SEND_MESSAGE", "message.recipient.@type", listOf("Audience"))
|
||||
|
|
|
|||
|
|
@ -1,106 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.utils.ConfirmationDialogModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:onClick="@{() -> viewModel.dismiss()}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dialog_background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:src="@drawable/shape_dialog_background"
|
||||
android:contentDescription="@null"
|
||||
app:layout_constraintWidth_max="@dimen/dialog_max_width"
|
||||
app:layout_constraintBottom_toBottomOf="@id/anchor"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/section_header_style"
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:paddingTop="@dimen/dialog_top_bottom_margin"
|
||||
android:text="@string/meeting_schedule_delete_dialog_title"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintBottom_toTopOf="@id/message"
|
||||
app:layout_constraintStart_toStartOf="@id/dialog_background"
|
||||
app:layout_constraintEnd_toEndOf="@id/dialog_background"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/message"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/meeting_schedule_delete_dialog_message"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/cancel"
|
||||
app:layout_constraintStart_toStartOf="@id/dialog_background"
|
||||
app:layout_constraintEnd_toEndOf="@id/dialog_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/title" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:onClick="@{() -> viewModel.confirm()}"
|
||||
style="@style/primary_dialog_button_label_style"
|
||||
android:id="@+id/confirm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:text="@string/dialog_delete"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="@id/dialog_background"
|
||||
app:layout_constraintEnd_toStartOf="@id/cancel"
|
||||
app:layout_constraintTop_toTopOf="@id/cancel"
|
||||
app:layout_constraintBottom_toBottomOf="@id/cancel"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:onClick="@{() -> viewModel.dismiss()}"
|
||||
style="@style/secondary_dialog_button_label_style"
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:text="@string/dialog_cancel"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintStart_toEndOf="@id/confirm"
|
||||
app:layout_constraintEnd_toEndOf="@id/dialog_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/message"
|
||||
app:layout_constraintBottom_toTopOf="@id/anchor"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/anchor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dialog_top_bottom_margin"
|
||||
app:layout_constraintTop_toBottomOf="@id/cancel"
|
||||
app:layout_constraintStart_toStartOf="@id/dialog_background"
|
||||
app:layout_constraintEnd_toEndOf="@id/dialog_background"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
Loading…
Add table
Reference in a new issue