diff --git a/.idea/gradle.xml b/.idea/gradle.xml index a0de2a152..ae388c2a5 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -7,7 +7,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 773fe0fbd..0ad17cbd3 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,7 @@ + - + diff --git a/app/src/main/java/org/linphone/ui/contacts/ContactsFragment.kt b/app/src/main/java/org/linphone/ui/contacts/ContactsFragment.kt new file mode 100644 index 000000000..6af3fb76b --- /dev/null +++ b/app/src/main/java/org/linphone/ui/contacts/ContactsFragment.kt @@ -0,0 +1,62 @@ +/* + * 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 . + */ +package org.linphone.ui.contacts + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.view.animation.Animation +import android.view.animation.AnimationUtils +import androidx.fragment.app.Fragment +import androidx.navigation.navGraphViewModels +import org.linphone.R +import org.linphone.databinding.ContactsFragmentBinding +import org.linphone.ui.contacts.viewmodel.ContactsListViewModel + +class ContactsFragment : Fragment() { + private lateinit var binding: ContactsFragmentBinding + private val listViewModel: ContactsListViewModel by navGraphViewModels( + R.id.contactsFragment + ) + + override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? { + // Holds fragment in place while new fragment slides over it + return AnimationUtils.loadAnimation(activity, R.anim.hold) + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + binding = ContactsFragmentBinding.inflate(layoutInflater) + return binding.root + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + binding.lifecycleOwner = viewLifecycleOwner + binding.viewModel = listViewModel + + // postponeEnterTransition() + } +} diff --git a/app/src/main/java/org/linphone/ui/contacts/viewmodel/ContactsListViewModel.kt b/app/src/main/java/org/linphone/ui/contacts/viewmodel/ContactsListViewModel.kt new file mode 100644 index 000000000..3504f70cb --- /dev/null +++ b/app/src/main/java/org/linphone/ui/contacts/viewmodel/ContactsListViewModel.kt @@ -0,0 +1,45 @@ +/* + * 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 . + */ +package org.linphone.ui.contacts.viewmodel + +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel + +class ContactsListViewModel : ViewModel() { + val searchBarVisible = MutableLiveData() + + val searchFilter = MutableLiveData() + + init { + searchBarVisible.value = false + } + + fun openSearchBar() { + searchBarVisible.value = true + } + + fun closeSearchBar() { + searchBarVisible.value = false + } + + fun clearFilter() { + searchFilter.value = "" + } +} diff --git a/app/src/main/res/drawable/calls.xml b/app/src/main/res/drawable/calls.xml new file mode 100644 index 000000000..b41091e2a --- /dev/null +++ b/app/src/main/res/drawable/calls.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/close.xml b/app/src/main/res/drawable/close.xml new file mode 100644 index 000000000..485cf87c7 --- /dev/null +++ b/app/src/main/res/drawable/close.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/contacts.xml b/app/src/main/res/drawable/contacts.xml new file mode 100644 index 000000000..01783a668 --- /dev/null +++ b/app/src/main/res/drawable/contacts.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/conversations.xml b/app/src/main/res/drawable/conversations.xml new file mode 100644 index 000000000..fe1c58548 --- /dev/null +++ b/app/src/main/res/drawable/conversations.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/illu.xml b/app/src/main/res/drawable/illu.xml new file mode 100644 index 000000000..2cd70cfa3 --- /dev/null +++ b/app/src/main/res/drawable/illu.xml @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/meetings.xml b/app/src/main/res/drawable/meetings.xml new file mode 100644 index 000000000..bac6848af --- /dev/null +++ b/app/src/main/res/drawable/meetings.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/search.xml b/app/src/main/res/drawable/search.xml index a578ece79..ad6ae3ab6 100644 --- a/app/src/main/res/drawable/search.xml +++ b/app/src/main/res/drawable/search.xml @@ -1,14 +1,13 @@ + android:width="24dp" + android:height="25dp" + android:viewportWidth="24" + android:viewportHeight="25"> + android:pathData="M 15.5 14.5 L 14.71 14.5 L 14.43 14.23 C 15.41 13.09 16 11.61 16 10 C 16 6.41 13.09 3.5 9.5 3.5 C 5.91 3.5 3 6.41 3 10 C 3 13.59 5.91 16.5 9.5 16.5 C 11.11 16.5 12.59 15.91 13.73 14.93 L 14 15.21 L 14 16 L 19 20.99 L 20.49 19.5 L 15.5 14.5 Z M 9.5 14.5 C 7.01 14.5 5 12.49 5 10 C 5 7.51 7.01 5.5 9.5 5.5 C 11.99 5.5 14 7.51 14 10 C 14 12.49 11.99 14.5 9.5 14.5 Z" + android:fillColor="#ffffff" + android:strokeWidth="1"/> diff --git a/app/src/main/res/layout/bottom_nav_bar.xml b/app/src/main/res/layout/bottom_nav_bar.xml new file mode 100644 index 000000000..e2c12846a --- /dev/null +++ b/app/src/main/res/layout/bottom_nav_bar.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/contacts_fragment.xml b/app/src/main/res/layout/contacts_fragment.xml new file mode 100644 index 000000000..50634fa65 --- /dev/null +++ b/app/src/main/res/layout/contacts_fragment.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/main_nav_graph.xml b/app/src/main/res/navigation/main_nav_graph.xml index be40508e5..af83bb03a 100644 --- a/app/src/main/res/navigation/main_nav_graph.xml +++ b/app/src/main/res/navigation/main_nav_graph.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main_nav_graph" - app:startDestination="@id/conversationsFragment"> + app:startDestination="@id/contactsFragment"> + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 251cbc74e..9665245d9 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -17,5 +17,7 @@ #4E4E4E #EDEDED #F9F9F9 + #364860 + #4E6074 #E5E5EA \ No newline at end of file