Improved code & README
This commit is contained in:
parent
f09c0904d0
commit
e18ae8dcc6
3 changed files with 17 additions and 12 deletions
|
@ -91,7 +91,7 @@ LinphoneSdkBuildDir=/home/<username>/linphone-sdk/build/
|
|||
- If you encounter the `couldn't find "libc++_shared.so"` crash when the app starts, simply clean the project in Android Studio (under Build menu) and build again.
|
||||
Also check you have built the SDK for the right CPU architecture using the `-DLINPHONESDK_ANDROID_ARCHS=armv7,arm64,x86,x86_64` cmake parameter.
|
||||
|
||||
- If during the build you have `DataBinderMapperImpl.java error: cannot find symbol`, try building again.
|
||||
- If during the build you have `DataBinderMapperImpl.java error: cannot find symbol` or `Could not find accessor org.linphone.activities.main.chat.viewmodels.ChatRoomsListViewModel.chatRooms` with `Could not find accessor org.linphone.activities.main.settings.viewmodels.NetworkSettingsViewModel.sipPort`, try building again. It is merely a build failure from Android Studio that happens sometimes.
|
||||
|
||||
- Push notification might not work when app has been started by Android Studio consecutively to an install. Remove the app from the recent activity view and start it again using the launcher icon to resolve this.
|
||||
|
||||
|
|
|
@ -93,16 +93,6 @@ class TabsFragment : GenericFragment<TabsFragmentBinding>(), NavController.OnDes
|
|||
destination: NavDestination,
|
||||
arguments: Bundle?
|
||||
) {
|
||||
viewModel.historySelected.value = false
|
||||
viewModel.contactsSelected.value = false
|
||||
viewModel.dialerSelected.value = false
|
||||
viewModel.chatSelected.value = false
|
||||
|
||||
when (destination.id) {
|
||||
R.id.masterCallLogsFragment -> viewModel.historySelected.value = true
|
||||
R.id.masterContactsFragment -> viewModel.contactsSelected.value = true
|
||||
R.id.dialerFragment -> viewModel.dialerSelected.value = true
|
||||
R.id.masterChatRoomsFragment -> viewModel.chatSelected.value = true
|
||||
}
|
||||
viewModel.updateTabSelection(destination.id)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.ViewModel
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.R
|
||||
import org.linphone.core.*
|
||||
|
||||
class TabsViewModel : ViewModel() {
|
||||
|
@ -85,4 +86,18 @@ class TabsViewModel : ViewModel() {
|
|||
fun updateUnreadChatCount() {
|
||||
unreadMessagesCount.value = coreContext.core.unreadChatMessageCountFromActiveLocals
|
||||
}
|
||||
|
||||
fun updateTabSelection(destinationId: Int) {
|
||||
historySelected.value = false
|
||||
contactsSelected.value = false
|
||||
dialerSelected.value = false
|
||||
chatSelected.value = false
|
||||
|
||||
when (destinationId) {
|
||||
R.id.masterCallLogsFragment -> historySelected.value = true
|
||||
R.id.masterContactsFragment -> contactsSelected.value = true
|
||||
R.id.dialerFragment -> dialerSelected.value = true
|
||||
R.id.masterChatRoomsFragment -> chatSelected.value = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue