mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-25 22:08:38 +00:00
Code improvements
This commit is contained in:
parent
32145980f4
commit
0105f1d669
11 changed files with 13 additions and 17 deletions
|
|
@ -30,6 +30,7 @@
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".LinphoneApplication"
|
android:name=".LinphoneApplication"
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ import org.linphone.core.MediaDirection
|
||||||
import org.linphone.core.tools.Log
|
import org.linphone.core.tools.Log
|
||||||
import org.linphone.utils.AudioUtils
|
import org.linphone.utils.AudioUtils
|
||||||
|
|
||||||
class TelecomCallControlCallback constructor(
|
class TelecomCallControlCallback(
|
||||||
private val call: Call,
|
private val call: Call,
|
||||||
private val callControl: CallControlScope,
|
private val callControl: CallControlScope,
|
||||||
private val scope: CoroutineScope
|
private val scope: CoroutineScope
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class PermissionsFragment : Fragment() {
|
||||||
private val requestPermissionLauncher = registerForActivityResult(
|
private val requestPermissionLauncher = registerForActivityResult(
|
||||||
ActivityResultContracts.RequestMultiplePermissions()
|
ActivityResultContracts.RequestMultiplePermissions()
|
||||||
) { permissions ->
|
) { permissions ->
|
||||||
permissions.entries.forEach() {
|
permissions.entries.forEach {
|
||||||
val permissionName = it.key
|
val permissionName = it.key
|
||||||
val isGranted = it.value
|
val isGranted = it.value
|
||||||
if (isGranted) {
|
if (isGranted) {
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ class ConferenceModel {
|
||||||
if (found != null) {
|
if (found != null) {
|
||||||
Log.i("$TAG Newly active speaker participant is [${found.name}]")
|
Log.i("$TAG Newly active speaker participant is [${found.name}]")
|
||||||
found.isActiveSpeaker.postValue(true)
|
found.isActiveSpeaker.postValue(true)
|
||||||
activeSpeaker.postValue(found)
|
activeSpeaker.postValue(found!!)
|
||||||
} else {
|
} else {
|
||||||
Log.i("$TAG Failed to find actively speaking participant...")
|
Log.i("$TAG Failed to find actively speaking participant...")
|
||||||
val model = ConferenceParticipantDeviceModel(participantDevice)
|
val model = ConferenceParticipantDeviceModel(participantDevice)
|
||||||
|
|
|
||||||
|
|
@ -420,7 +420,7 @@ class MainActivity : GenericActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
val list = arrayListOf<String>()
|
val list = arrayListOf<String>()
|
||||||
lifecycleScope.launch() {
|
lifecycleScope.launch {
|
||||||
val deferred = arrayListOf<Deferred<String?>>()
|
val deferred = arrayListOf<Deferred<String?>>()
|
||||||
for (uri in parcelablesUri) {
|
for (uri in parcelablesUri) {
|
||||||
deferred.add(async { FileUtils.getFilePath(this@MainActivity, uri, false) })
|
deferred.add(async { FileUtils.getFilePath(this@MainActivity, uri, false) })
|
||||||
|
|
|
||||||
|
|
@ -338,8 +338,8 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
||||||
sendMessageViewModel.configureChatRoom(viewModel.chatRoom)
|
sendMessageViewModel.configureChatRoom(viewModel.chatRoom)
|
||||||
|
|
||||||
// Wait for chat room to be ready before trying to forward a message in it
|
// Wait for chat room to be ready before trying to forward a message in it
|
||||||
sharedViewModel.messageToForwardEvent.observe(viewLifecycleOwner) {
|
sharedViewModel.messageToForwardEvent.observe(viewLifecycleOwner) { event ->
|
||||||
it.consume { toForward ->
|
event.consume { toForward ->
|
||||||
Log.i("$TAG Found message to forward")
|
Log.i("$TAG Found message to forward")
|
||||||
sendMessageViewModel.forwardMessage(toForward)
|
sendMessageViewModel.forwardMessage(toForward)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -293,11 +293,6 @@ class MessageModel @WorkerThread constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiThread
|
|
||||||
fun firstImageClicked() {
|
|
||||||
filesList.value.orEmpty().firstOrNull()?.onClick()
|
|
||||||
}
|
|
||||||
|
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
private fun computeContentsList() {
|
private fun computeContentsList() {
|
||||||
Log.d("$TAG Computing message contents list")
|
Log.d("$TAG Computing message contents list")
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ package org.linphone.ui.main.chat.view
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.text.method.LinkMovementMethod
|
import android.text.method.LinkMovementMethod
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.View.MeasureSpec.*
|
|
||||||
import androidx.annotation.UiThread
|
import androidx.annotation.UiThread
|
||||||
import androidx.appcompat.widget.AppCompatTextView
|
import androidx.appcompat.widget.AppCompatTextView
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,8 @@
|
||||||
app:layout_constraintWidth_max="@dimen/text_input_max_width"
|
app:layout_constraintWidth_max="@dimen/text_input_max_width"
|
||||||
app:layout_constraintTop_toBottomOf="@id/phone_number_label"
|
app:layout_constraintTop_toBottomOf="@id/phone_number_label"
|
||||||
app:layout_constraintStart_toEndOf="@id/prefix_caret"
|
app:layout_constraintStart_toEndOf="@id/prefix_caret"
|
||||||
app:layout_constraintEnd_toEndOf="@id/username"/>
|
app:layout_constraintEnd_toEndOf="@id/username"
|
||||||
|
bind:ignore="RtlSymmetry" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
style="@style/default_text_style_600"
|
style="@style/default_text_style_600"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
xmlns:bind="http://schemas.android.com/tools">
|
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout
|
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
|
@ -48,7 +48,8 @@
|
||||||
android:text="@{viewModel.isEdit ? @string/contact_edit_title : @string/contact_new_title, default=@string/contact_new_title}"
|
android:text="@{viewModel.isEdit ? @string/contact_edit_title : @string/contact_new_title, default=@string/contact_new_title}"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/back"
|
app:layout_constraintStart_toEndOf="@id/back"
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:ignore="RtlSymmetry" />
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:id="@+id/scrollView"
|
android:id="@+id/scrollView"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue