diff --git a/app/build.gradle b/app/build.gradle index 7425e45a1..333e1e737 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -53,17 +53,18 @@ android { dependencies { implementation 'androidx.core:core-ktx:1.10.1' - implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.navigation:navigation-ui-ktx:2.6.0' implementation 'androidx.gridlayout:gridlayout:1.0.0' - implementation 'androidx.recyclerview:recyclerview:1.3.1-rc01' + implementation 'androidx.recyclerview:recyclerview:1.3.1' + implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0" def nav_version = "2.6.0" implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-ui-ktx:$nav_version" - def emoji_version = "1.4.0-beta05" + def emoji_version = "1.4.0-rc01" implementation "androidx.emoji2:emoji2:$emoji_version" implementation "androidx.emoji2:emoji2-emojipicker:$emoji_version" diff --git a/app/src/main/java/org/linphone/ui/EmptyFragment.kt b/app/src/main/java/org/linphone/ui/EmptyFragment.kt new file mode 100644 index 000000000..d737b35c5 --- /dev/null +++ b/app/src/main/java/org/linphone/ui/EmptyFragment.kt @@ -0,0 +1,60 @@ +/* + * 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 + +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.fragment.findNavController +import androidx.transition.AutoTransition +import org.linphone.R +import org.linphone.databinding.EmptyFragmentBinding + +class EmptyFragment : Fragment() { + private lateinit var binding: EmptyFragmentBinding + + override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? { + 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( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + binding = EmptyFragmentBinding.inflate(layoutInflater) + sharedElementEnterTransition = AutoTransition() + return binding.root + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + binding.lifecycleOwner = viewLifecycleOwner + } +} 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 8710b86ab..5ad1c56cb 100644 --- a/app/src/main/java/org/linphone/ui/contacts/ContactsFragment.kt +++ b/app/src/main/java/org/linphone/ui/contacts/ContactsFragment.kt @@ -19,6 +19,7 @@ */ package org.linphone.ui.contacts +import android.content.res.Configuration import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -69,8 +70,8 @@ class ContactsFragment : Fragment() { binding.viewModel = listViewModel binding.root.setKeyboardInsetListener { keyboardVisible -> - // val portraitOrientation = resources.configuration.orientation != Configuration.ORIENTATION_LANDSCAPE - listViewModel.bottomNavBarVisible.value = !keyboardVisible + val portraitOrientation = resources.configuration.orientation != Configuration.ORIENTATION_LANDSCAPE + listViewModel.bottomNavBarVisible.value = !portraitOrientation || !keyboardVisible } // postponeEnterTransition() diff --git a/app/src/main/res/layout-land/bottom_nav_bar.xml b/app/src/main/res/layout-land/bottom_nav_bar.xml new file mode 100644 index 000000000..e51499a7a --- /dev/null +++ b/app/src/main/res/layout-land/bottom_nav_bar.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/contacts_fragment.xml b/app/src/main/res/layout-land/contacts_fragment.xml new file mode 100644 index 000000000..a47e731fc --- /dev/null +++ b/app/src/main/res/layout-land/contacts_fragment.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 7e7b67552..ac60ed60b 100644 --- a/app/src/main/res/layout/bottom_nav_bar.xml +++ b/app/src/main/res/layout/bottom_nav_bar.xml @@ -30,7 +30,8 @@ android:transitionName="bottom_nav_bar" android:id="@+id/bottom_nav_bar" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:background="@color/white"> - + android:layout_height="match_parent"> - + - + - + - + - + - + - + - + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/empty_fragment.xml b/app/src/main/res/layout/empty_fragment.xml new file mode 100644 index 000000000..f1e8f3c96 --- /dev/null +++ b/app/src/main/res/layout/empty_fragment.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/chat_nav_graph.xml b/app/src/main/res/navigation/chat_nav_graph.xml new file mode 100644 index 000000000..d888decfa --- /dev/null +++ b/app/src/main/res/navigation/chat_nav_graph.xml @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file