mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Added in-call top bar
This commit is contained in:
parent
2181c74b3e
commit
5eb323c662
24 changed files with 285 additions and 42 deletions
|
|
@ -319,7 +319,7 @@ class CoreContext @UiThread constructor(val context: Context) : HandlerThread("C
|
|||
}
|
||||
|
||||
@UiThread
|
||||
private fun showCallActivity() {
|
||||
fun showCallActivity() {
|
||||
Log.i("$TAG Starting VoIP activity")
|
||||
val intent = Intent(context, VoipActivity::class.java)
|
||||
// This flag is required to start an Activity from a Service context
|
||||
|
|
|
|||
|
|
@ -42,14 +42,14 @@ import org.linphone.ui.main.MainActivity
|
|||
import org.linphone.ui.main.calls.adapter.CallsListAdapter
|
||||
import org.linphone.ui.main.calls.model.ConfirmationDialogModel
|
||||
import org.linphone.ui.main.calls.viewmodel.CallsListViewModel
|
||||
import org.linphone.ui.main.fragment.GenericFragment
|
||||
import org.linphone.ui.main.fragment.AbstractTopBarFragment
|
||||
import org.linphone.utils.DialogUtils
|
||||
import org.linphone.utils.Event
|
||||
import org.linphone.utils.hideKeyboard
|
||||
import org.linphone.utils.showKeyboard
|
||||
|
||||
@UiThread
|
||||
class CallsListFragment : GenericFragment() {
|
||||
class CallsListFragment : AbstractTopBarFragment() {
|
||||
companion object {
|
||||
private const val TAG = "[Calls List Fragment]"
|
||||
}
|
||||
|
|
@ -187,18 +187,14 @@ class CallsListFragment : GenericFragment() {
|
|||
Log.i(
|
||||
"$TAG Default account changed, updating avatar in top bar & re-computing call logs"
|
||||
)
|
||||
listViewModel.updateDefaultAccount()
|
||||
listViewModel.update()
|
||||
listViewModel.applyFilter()
|
||||
}
|
||||
}
|
||||
|
||||
// TopBarFragment related
|
||||
|
||||
listViewModel.openDrawerMenuEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
(requireActivity() as MainActivity).toggleDrawerMenu()
|
||||
}
|
||||
}
|
||||
setViewModelAndTitle(listViewModel, "Calls")
|
||||
|
||||
listViewModel.searchFilter.observe(viewLifecycleOwner) { filter ->
|
||||
listViewModel.applyFilter(filter.trim())
|
||||
|
|
@ -214,8 +210,6 @@ class CallsListFragment : GenericFragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
listViewModel.title.value = "Calls"
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
|
|
|||
|
|
@ -35,16 +35,15 @@ import org.linphone.LinphoneApplication.Companion.coreContext
|
|||
import org.linphone.R
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.databinding.ContactsListFragmentBinding
|
||||
import org.linphone.ui.main.MainActivity
|
||||
import org.linphone.ui.main.contacts.adapter.ContactsListAdapter
|
||||
import org.linphone.ui.main.contacts.viewmodel.ContactsListViewModel
|
||||
import org.linphone.ui.main.fragment.GenericFragment
|
||||
import org.linphone.ui.main.fragment.AbstractTopBarFragment
|
||||
import org.linphone.utils.Event
|
||||
import org.linphone.utils.hideKeyboard
|
||||
import org.linphone.utils.showKeyboard
|
||||
|
||||
@UiThread
|
||||
class ContactsListFragment : GenericFragment() {
|
||||
class ContactsListFragment : AbstractTopBarFragment() {
|
||||
companion object {
|
||||
private const val TAG = "[Contacts List Fragment]"
|
||||
}
|
||||
|
|
@ -143,18 +142,14 @@ class ContactsListFragment : GenericFragment() {
|
|||
Log.i(
|
||||
"$TAG Default account changed, updating avatar in top bar & refreshing contacts list"
|
||||
)
|
||||
listViewModel.updateDefaultAccount()
|
||||
listViewModel.update()
|
||||
listViewModel.applyCurrentDefaultAccountFilter()
|
||||
}
|
||||
}
|
||||
|
||||
// TopBarFragment related
|
||||
|
||||
listViewModel.openDrawerMenuEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
(requireActivity() as MainActivity).toggleDrawerMenu()
|
||||
}
|
||||
}
|
||||
setViewModelAndTitle(listViewModel, "Contacts")
|
||||
|
||||
listViewModel.searchFilter.observe(viewLifecycleOwner) { filter ->
|
||||
listViewModel.applyFilter(filter.trim())
|
||||
|
|
@ -170,8 +165,6 @@ class ContactsListFragment : GenericFragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
listViewModel.title.value = "Contacts"
|
||||
}
|
||||
|
||||
private fun configureAdapter(adapter: ContactsListAdapter) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2023 Belledonne Communications SARL.
|
||||
*
|
||||
* This file is part of linphone-android
|
||||
* (see https://www.linphone.org).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.linphone.ui.main.fragment
|
||||
|
||||
import androidx.annotation.UiThread
|
||||
import androidx.core.content.ContextCompat
|
||||
import org.linphone.LinphoneApplication
|
||||
import org.linphone.R
|
||||
import org.linphone.ui.main.MainActivity
|
||||
import org.linphone.ui.main.viewmodel.AbstractTopBarViewModel
|
||||
|
||||
@UiThread
|
||||
abstract class AbstractTopBarFragment : GenericFragment() {
|
||||
fun setViewModelAndTitle(viewModel: AbstractTopBarViewModel, title: String) {
|
||||
viewModel.title.value = title
|
||||
|
||||
viewModel.openDrawerMenuEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
(requireActivity() as MainActivity).toggleDrawerMenu()
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.changeSystemTopBarColorToInCallEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { useInCallColor ->
|
||||
val color = if (useInCallColor) {
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.green_online
|
||||
)
|
||||
} else {
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.primary_color
|
||||
)
|
||||
}
|
||||
requireActivity().window.statusBarColor = color
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.goBackToCallEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
LinphoneApplication.coreContext.showCallActivity()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -20,12 +20,17 @@
|
|||
package org.linphone.ui.main.viewmodel
|
||||
|
||||
import androidx.annotation.UiThread
|
||||
import androidx.annotation.WorkerThread
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.core.Call
|
||||
import org.linphone.core.Core
|
||||
import org.linphone.core.CoreListenerStub
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.ui.main.model.AccountModel
|
||||
import org.linphone.utils.Event
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
|
||||
open class AbstractTopBarViewModel @UiThread constructor() : ViewModel() {
|
||||
companion object {
|
||||
|
|
@ -40,6 +45,12 @@ open class AbstractTopBarViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
val searchFilter = MutableLiveData<String>()
|
||||
|
||||
val atLastOneCall = MutableLiveData<Boolean>()
|
||||
|
||||
val callDisplayName = MutableLiveData<String>()
|
||||
|
||||
val callStatus = MutableLiveData<String>()
|
||||
|
||||
val focusSearchBarEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
|
@ -48,17 +59,55 @@ open class AbstractTopBarViewModel @UiThread constructor() : ViewModel() {
|
|||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
val changeSystemTopBarColorToInCallEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
val goBackToCallEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
private val coreListener = object : CoreListenerStub() {
|
||||
@WorkerThread
|
||||
override fun onLastCallEnded(core: Core) {
|
||||
Log.i("$TAG Last call ended, asking fragment to change back status bar color")
|
||||
changeSystemTopBarColorToInCallEvent.postValue(Event(false))
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
override fun onCallStateChanged(
|
||||
core: Core,
|
||||
call: Call,
|
||||
state: Call.State?,
|
||||
message: String
|
||||
) {
|
||||
if (core.callsNb > 0) {
|
||||
updateCurrentCallInfo()
|
||||
}
|
||||
atLastOneCall.postValue(core.callsNb > 0)
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
searchBarVisible.value = false
|
||||
|
||||
updateDefaultAccount()
|
||||
coreContext.postOnCoreThread { core ->
|
||||
core.addListener(coreListener)
|
||||
if (core.callsNb > 0) {
|
||||
updateCurrentCallInfo()
|
||||
}
|
||||
atLastOneCall.postValue(core.callsNb > 0)
|
||||
}
|
||||
|
||||
update()
|
||||
}
|
||||
|
||||
@UiThread
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
|
||||
coreContext.postOnCoreThread {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
core.removeListener(coreListener)
|
||||
account.value?.destroy()
|
||||
}
|
||||
}
|
||||
|
|
@ -87,15 +136,51 @@ open class AbstractTopBarViewModel @UiThread constructor() : ViewModel() {
|
|||
}
|
||||
|
||||
@UiThread
|
||||
fun updateDefaultAccount() {
|
||||
coreContext.postOnCoreThread {
|
||||
Log.i("$TAG Updating displayed default account")
|
||||
|
||||
val core = coreContext.core
|
||||
fun update() {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
if (core.accountList.isNotEmpty()) {
|
||||
Log.i("$TAG Updating displayed default account")
|
||||
val defaultAccount = core.defaultAccount ?: core.accountList.first()
|
||||
account.postValue(AccountModel(defaultAccount))
|
||||
}
|
||||
|
||||
if (core.callsNb > 0) {
|
||||
updateCurrentCallInfo()
|
||||
}
|
||||
atLastOneCall.postValue(core.callsNb > 0)
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun goBackToCall() {
|
||||
goBackToCallEvent.value = Event(true)
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun updateCurrentCallInfo() {
|
||||
val core = coreContext.core
|
||||
val currentCall = core.currentCall
|
||||
if (currentCall != null) {
|
||||
val contact = coreContext.contactsManager.findContactByAddress(
|
||||
currentCall.remoteAddress
|
||||
)
|
||||
callDisplayName.postValue(
|
||||
contact?.name ?: LinphoneUtils.getDisplayName(currentCall.remoteAddress)
|
||||
)
|
||||
callStatus.postValue(currentCall.state.name) // TODO: improve text
|
||||
} else {
|
||||
val firstCall = core.calls.firstOrNull()
|
||||
if (firstCall != null) {
|
||||
val contact = coreContext.contactsManager.findContactByAddress(
|
||||
firstCall.remoteAddress
|
||||
)
|
||||
callDisplayName.postValue(
|
||||
contact?.name ?: LinphoneUtils.getDisplayName(firstCall.remoteAddress)
|
||||
)
|
||||
callStatus.postValue(firstCall.state.name) // TODO: improve text
|
||||
}
|
||||
}
|
||||
Log.i("$TAG At least a call, asking fragment to change status bar color")
|
||||
changeSystemTopBarColorToInCallEvent.postValue(Event(true))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<size android:width="70dp" android:height="70dp" />
|
||||
<solid android:color="@color/green_disabled"/>
|
||||
</shape>
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/top_bar"
|
||||
layout="@layout/top_search_bar"
|
||||
layout="@layout/main_activity_top_bar"
|
||||
bind:viewModel="@{viewModel}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
|
|
@ -57,6 +57,17 @@
|
|||
app:layout_constraintTop_toTopOf="@id/top_bar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/top_bar" />
|
||||
|
||||
<include
|
||||
android:id="@+id/in_call_top_bar"
|
||||
layout="@layout/main_activity_in_call_top_bar"
|
||||
bind:viewModel="@{viewModel}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
android:visibility="@{viewModel.atLastOneCall ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/background"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/top_bar"
|
||||
layout="@layout/top_search_bar"
|
||||
layout="@layout/main_activity_top_bar"
|
||||
bind:viewModel="@{viewModel}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
|
|
@ -61,6 +61,17 @@
|
|||
app:layout_constraintTop_toTopOf="@id/top_bar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/top_bar" />
|
||||
|
||||
<include
|
||||
android:id="@+id/in_call_top_bar"
|
||||
layout="@layout/main_activity_in_call_top_bar"
|
||||
bind:viewModel="@{viewModel}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
android:visibility="@{viewModel.atLastOneCall ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/background"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
android:adjustViewBounds="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/caret_left"
|
||||
android:drawableTint="@color/primary_color"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
android:adjustViewBounds="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/caret_left"
|
||||
android:drawableTint="@color/primary_color"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
android:onClick="@{backClickListener}"
|
||||
android:visibility="@{viewModel.showBackButton ? View.VISIBLE : View.GONE}"
|
||||
android:src="@drawable/caret_left"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title"/>
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@
|
|||
android:layout_height="35dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:drawableTint="@color/primary_color"
|
||||
android:onClick="@{backClickListener}"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/caret_left"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/top_bar"
|
||||
layout="@layout/top_search_bar"
|
||||
layout="@layout/main_activity_top_bar"
|
||||
bind:viewModel="@{viewModel}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
|
|
@ -57,6 +57,17 @@
|
|||
app:layout_constraintTop_toTopOf="@id/top_bar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/top_bar" />
|
||||
|
||||
<include
|
||||
android:id="@+id/in_call_top_bar"
|
||||
layout="@layout/main_activity_in_call_top_bar"
|
||||
bind:viewModel="@{viewModel}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
android:visibility="@{viewModel.atLastOneCall ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/background"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
android:onClick="@{backClickListener}"
|
||||
android:visibility="@{viewModel.showBackButton ? View.VISIBLE : View.GONE}"
|
||||
android:src="@drawable/caret_left"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/invisible_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/invisible_title"/>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
android:adjustViewBounds="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/caret_left"
|
||||
android:drawableTint="@color/primary_color"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
|
@ -262,9 +262,9 @@
|
|||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:text="@={viewModel.jobTitle, default=`Android dev`}"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray_9"
|
||||
|
|
@ -272,8 +272,10 @@
|
|||
android:maxLines="1"
|
||||
android:background="@drawable/edit_text_background"
|
||||
android:inputType="text|textCapWords"
|
||||
app:layout_constraintVertical_bias="0"
|
||||
app:layout_constraintWidth_max="@dimen/text_input_max_width"
|
||||
app:layout_constraintTop_toBottomOf="@id/job_title_label"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/top_bar"
|
||||
layout="@layout/top_search_bar"
|
||||
layout="@layout/main_activity_top_bar"
|
||||
bind:viewModel="@{viewModel}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
|
|
@ -51,6 +51,17 @@
|
|||
app:layout_constraintTop_toTopOf="@id/top_bar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/top_bar" />
|
||||
|
||||
<include
|
||||
android:id="@+id/in_call_top_bar"
|
||||
layout="@layout/main_activity_in_call_top_bar"
|
||||
bind:viewModel="@{viewModel}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
android:visibility="@{viewModel.atLastOneCall ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/background"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
android:adjustViewBounds="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/caret_left"
|
||||
android:drawableTint="@color/primary_color"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
android:adjustViewBounds="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/caret_left"
|
||||
android:drawableTint="@color/primary_color"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
android:layout_marginTop="@dimen/toast_top_margin"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
app:layout_constraintWidth_max="@dimen/toast_max_width"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
|
|
|||
53
app/src/main/res/layout/main_activity_in_call_top_bar.xml
Normal file
53
app/src/main/res/layout/main_activity_in_call_top_bar.xml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?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.ui.main.viewmodel.AbstractTopBarViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
android:background="@color/green_online"
|
||||
android:onClick="@{() -> viewModel.goBackToCall()}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_800"
|
||||
android:id="@+id/call_display_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@{viewModel.callDisplayName, default=`John Doe`}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:drawableStart="@drawable/phone"
|
||||
android:drawablePadding="10dp"
|
||||
android:drawableTint="@color/white"
|
||||
app:layout_constraintEnd_toStartOf="@id/call_time"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style"
|
||||
android:id="@+id/call_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/top_bar_height"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@{viewModel.callStatus, default=`Paused`}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/call_display_name"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
android:adjustViewBounds="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/caret_left"
|
||||
android:drawableTint="@color/primary_color"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
android:adjustViewBounds="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/caret_left"
|
||||
android:drawableTint="@color/primary_color"
|
||||
app:tint="@color/gray_1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
<color name="red_disabled">#F5CCBE</color>
|
||||
<color name="green_online">#4FAE80</color>
|
||||
<color name="green_pressed">#377D71</color>
|
||||
<color name="green_disabled">#4FAE80</color>
|
||||
<color name="blue_light">#DFECF2</color>
|
||||
<color name="blue_light_disabled">#C0D1D9</color>
|
||||
<color name="blue_trusted">#4AA8FF</color>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue