diff --git a/app/src/main/java/org/linphone/ui/contacts/ContactsFragment.kt b/app/src/main/java/org/linphone/ui/contacts/ContactsFragment.kt
index 6af3fb76b..6aad4b172 100644
--- a/app/src/main/java/org/linphone/ui/contacts/ContactsFragment.kt
+++ b/app/src/main/java/org/linphone/ui/contacts/ContactsFragment.kt
@@ -26,6 +26,7 @@ import android.view.ViewGroup
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import androidx.fragment.app.Fragment
+import androidx.navigation.fragment.findNavController
import androidx.navigation.navGraphViewModels
import org.linphone.R
import org.linphone.databinding.ContactsFragmentBinding
@@ -38,8 +39,11 @@ class ContactsFragment : Fragment() {
)
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)
+ if (findNavController().currentDestination?.id == R.id.newContactFragment) {
+ // Holds fragment in place while new contact fragment slides over it
+ return AnimationUtils.loadAnimation(activity, R.anim.hold)
+ }
+ return super.onCreateAnimation(transit, enter, nextAnim)
}
override fun onCreateView(
@@ -58,5 +62,25 @@ class ContactsFragment : Fragment() {
binding.viewModel = listViewModel
// postponeEnterTransition()
+
+ binding.setOnNewContactClicked {
+ if (findNavController().currentDestination?.id == R.id.contactsFragment) {
+ findNavController().navigate(
+ R.id.action_contactsFragment_to_newContactFragment
+ )
+ }
+ }
+
+ binding.setOnConversationsClicked {
+ if (findNavController().currentDestination?.id == R.id.contactsFragment) {
+ findNavController().navigate(
+ R.id.action_contactsFragment_to_conversationsFragment
+ )
+ }
+ }
+
+ /*(view.parent as? ViewGroup)?.doOnPreDraw {
+ startPostponedEnterTransition()
+ }*/
}
}
diff --git a/app/src/main/java/org/linphone/ui/contacts/NewContactFragment.kt b/app/src/main/java/org/linphone/ui/contacts/NewContactFragment.kt
new file mode 100644
index 000000000..c4a6329dc
--- /dev/null
+++ b/app/src/main/java/org/linphone/ui/contacts/NewContactFragment.kt
@@ -0,0 +1,65 @@
+/*
+ * 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 androidx.fragment.app.Fragment
+import org.linphone.databinding.NewContactFragmentBinding
+
+class NewContactFragment : Fragment() {
+ private lateinit var binding: NewContactFragmentBinding
+
+ override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? {
+ /*if (findNavController().currentDestination?.id == R.id.contactFragment) {
+ // Holds fragment in place while created contact fragment slides over it
+ return AnimationUtils.loadAnimation(activity, R.anim.hold)
+ }*/
+ return super.onCreateAnimation(transit, enter, nextAnim)
+ }
+
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View {
+ binding = NewContactFragmentBinding.inflate(layoutInflater)
+ return binding.root
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+
+ binding.lifecycleOwner = viewLifecycleOwner
+
+ // postponeEnterTransition()
+
+ binding.setCancelClickListener {
+ requireActivity().onBackPressedDispatcher.onBackPressed()
+ }
+
+ /*(view.parent as? ViewGroup)?.doOnPreDraw {
+ startPostponedEnterTransition()
+ }*/
+ }
+}
diff --git a/app/src/main/java/org/linphone/ui/conversations/ConversationsFragment.kt b/app/src/main/java/org/linphone/ui/conversations/ConversationsFragment.kt
index 9f6d11000..9e5be380a 100644
--- a/app/src/main/java/org/linphone/ui/conversations/ConversationsFragment.kt
+++ b/app/src/main/java/org/linphone/ui/conversations/ConversationsFragment.kt
@@ -61,8 +61,13 @@ class ConversationsFragment : Fragment() {
}
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)
+ if (findNavController().currentDestination?.id == R.id.newConversationFragment ||
+ findNavController().currentDestination?.id == R.id.conversationFragment
+ ) {
+ // Holds fragment in place while (new) conversation fragment slides over it
+ return AnimationUtils.loadAnimation(activity, R.anim.hold)
+ }
+ return super.onCreateAnimation(transit, enter, nextAnim)
}
override fun onDestroyView() {
diff --git a/app/src/main/res/drawable/check.xml b/app/src/main/res/drawable/check.xml
new file mode 100644
index 000000000..fcf6bcba5
--- /dev/null
+++ b/app/src/main/res/drawable/check.xml
@@ -0,0 +1,13 @@
+
+
+
diff --git a/app/src/main/res/drawable/shape_gray_background.xml b/app/src/main/res/drawable/shape_gray_background.xml
index 2cb2df90e..54695a07c 100644
--- a/app/src/main/res/drawable/shape_gray_background.xml
+++ b/app/src/main/res/drawable/shape_gray_background.xml
@@ -1,5 +1,5 @@
-
-
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/bottom_nav_bar.xml b/app/src/main/res/layout/bottom_nav_bar.xml
index e2c12846a..c21d222d1 100644
--- a/app/src/main/res/layout/bottom_nav_bar.xml
+++ b/app/src/main/res/layout/bottom_nav_bar.xml
@@ -5,6 +5,9 @@
+
-
+
+
@@ -160,6 +163,7 @@
app:layout_constraintTop_toBottomOf="@id/no_contacts_image" />
-
-
+
+
+
+
+
+
+ android:layout_height="wrap_content"
+ android:layout_marginTop="30dp"
+ android:layout_marginStart="30dp"
+ android:layout_marginEnd="30dp"
+ android:padding="10dp"
+ android:drawableStart="@drawable/search"
+ android:drawablePadding="10dp"
+ android:background="@drawable/shape_search_round_background"
+ android:hint="Rechercher un contact, une conversation..."
+ android:textSize="14sp"
+ android:inputType="textPersonName|textNoSuggestions"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toBottomOf="@id/title" />
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
+
+ app:backgroundTint="@color/white"
+ app:layout_constraintBottom_toTopOf="@id/bottom_nav_bar"
+ app:layout_constraintEnd_toEndOf="parent"/>
-
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/new_contact_fragment.xml b/app/src/main/res/layout/new_contact_fragment.xml
new file mode 100644
index 000000000..c00c64443
--- /dev/null
+++ b/app/src/main/res/layout/new_contact_fragment.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 af83bb03a..90e87e585 100644
--- a/app/src/main/res/navigation/main_nav_graph.xml
+++ b/app/src/main/res/navigation/main_nav_graph.xml
@@ -51,6 +51,22 @@
android:id="@+id/contactsFragment"
android:name="org.linphone.ui.contacts.ContactsFragment"
android:label="ContactsFragment"
- tools:layout="@layout/contacts_fragment" />
+ tools:layout="@layout/contacts_fragment">
+
+
+
+
\ No newline at end of file