diff --git a/app/src/main/java/org/linphone/ui/main/model/AccountModel.kt b/app/src/main/java/org/linphone/ui/main/model/AccountModel.kt index cc9174f47..e09afef90 100644 --- a/app/src/main/java/org/linphone/ui/main/model/AccountModel.kt +++ b/app/src/main/java/org/linphone/ui/main/model/AccountModel.kt @@ -57,6 +57,8 @@ class AccountModel @WorkerThread constructor( val showTrust = MutableLiveData() + val notificationsCount = MutableLiveData() + private val accountListener = object : AccountListenerStub() { @WorkerThread override fun onRegistrationStateChanged( @@ -137,6 +139,7 @@ class AccountModel @WorkerThread constructor( } isDefault.postValue(coreContext.core.defaultAccount == account) + notificationsCount.postValue(account.unreadChatMessageCount + account.missedCallsCount) val state = account.state registrationState.postValue(state) diff --git a/app/src/main/res/drawable/shape_red_round.xml b/app/src/main/res/drawable/shape_red_round.xml new file mode 100644 index 000000000..f8bd6c05d --- /dev/null +++ b/app/src/main/res/drawable/shape_red_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/bottom_nav_bar.xml b/app/src/main/res/layout-land/bottom_nav_bar.xml index 3326adb6b..cd7ae7d76 100644 --- a/app/src/main/res/layout-land/bottom_nav_bar.xml +++ b/app/src/main/res/layout-land/bottom_nav_bar.xml @@ -67,7 +67,7 @@ android:layout_width="24dp" android:layout_height="24dp" android:gravity="center" - android:background="@drawable/shape_orange_round" + android:background="@drawable/shape_red_round" android:text="@{String.valueOf(viewModel.missedCallsCount), default=`1`}" android:textColor="@color/white" android:textSize="13sp" diff --git a/app/src/main/res/layout-land/call_extra_actions.xml b/app/src/main/res/layout-land/call_extra_actions.xml index 769866bf9..bc59ee999 100644 --- a/app/src/main/res/layout-land/call_extra_actions.xml +++ b/app/src/main/res/layout-land/call_extra_actions.xml @@ -87,17 +87,18 @@ @@ -207,8 +208,8 @@ app:layout_constraintTop_toBottomOf="@id/chat" /> + +