mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-18 03:48:08 +00:00
Fixed conference layouts not visible + trying to improve navigation
This commit is contained in:
parent
e994edbf0a
commit
2824c1a3f8
3 changed files with 79 additions and 62 deletions
|
|
@ -52,7 +52,7 @@ import org.linphone.core.tools.Log
|
|||
import org.linphone.databinding.MainActivityBinding
|
||||
import org.linphone.ui.GenericActivity
|
||||
import org.linphone.ui.assistant.AssistantActivity
|
||||
import org.linphone.ui.main.help.fragment.DebugFragmentDirections
|
||||
import org.linphone.ui.main.chat.fragment.ConversationsListFragmentDirections
|
||||
import org.linphone.ui.main.viewmodel.MainViewModel
|
||||
import org.linphone.ui.main.viewmodel.SharedMainViewModel
|
||||
import org.linphone.ui.welcome.WelcomeActivity
|
||||
|
|
@ -347,7 +347,20 @@ class MainActivity : GenericActivity() {
|
|||
try {
|
||||
Log.i("$TAG Trying to go to Conversations fragment")
|
||||
val args = intent.extras
|
||||
findNavController().navigate(R.id.conversationsListFragment, args)
|
||||
val localSipUri = args?.getString("LocalSipUri", "")
|
||||
val remoteSipUri = args?.getString("RemoteSipUri", "")
|
||||
if (remoteSipUri.isNullOrEmpty() || localSipUri.isNullOrEmpty()) {
|
||||
Log.w("$TAG Found [Chat] extra but no local and/or remote SIP URI!")
|
||||
} else {
|
||||
Log.i(
|
||||
"$TAG Found [Chat] extra with local [$localSipUri] and peer [$remoteSipUri] addresses"
|
||||
)
|
||||
val pair = Pair(localSipUri, remoteSipUri)
|
||||
sharedViewModel.showConversationEvent.value = Event(pair)
|
||||
}
|
||||
|
||||
val action = ConversationsListFragmentDirections.actionGlobalConversationsListFragment()
|
||||
findNavController().navigate(action)
|
||||
} catch (ise: IllegalStateException) {
|
||||
Log.e("$TAG Can't navigate to Conversations fragment: $ise")
|
||||
}
|
||||
|
|
@ -362,10 +375,15 @@ class MainActivity : GenericActivity() {
|
|||
try {
|
||||
val navOptionsBuilder = NavOptions.Builder()
|
||||
navOptionsBuilder.setPopUpTo(R.id.contactsListFragment, true)
|
||||
navOptionsBuilder.setLaunchSingleTop(true)
|
||||
val navOptions = navOptionsBuilder.build()
|
||||
when (defaultFragmentId) {
|
||||
HISTORY_FRAGMENT_ID -> {
|
||||
findNavController().navigate(R.id.historyListFragment, args, navOptions)
|
||||
findNavController().navigate(
|
||||
R.id.historyListFragment,
|
||||
args,
|
||||
navOptions
|
||||
)
|
||||
}
|
||||
CHAT_FRAGMENT_ID -> {
|
||||
findNavController().navigate(
|
||||
|
|
@ -458,9 +476,6 @@ class MainActivity : GenericActivity() {
|
|||
)
|
||||
sharedViewModel.showConversationEvent.value = Event(pair)
|
||||
}
|
||||
|
||||
val action = DebugFragmentDirections.actionDebugFragmentToConversationsListFragment()
|
||||
findNavController().navigate(action)
|
||||
} else {
|
||||
val pair = parseShortcutIfAny(intent)
|
||||
if (pair != null) {
|
||||
|
|
@ -469,11 +484,12 @@ class MainActivity : GenericActivity() {
|
|||
Log.i(
|
||||
"$TAG Navigating to conversation with local [$localSipUri] and peer [$remoteSipUri] addresses, computed from shortcut ID"
|
||||
)
|
||||
intent.putExtra("LocalSipUri", localSipUri)
|
||||
intent.putExtra("RemoteSipUri", remoteSipUri)
|
||||
sharedViewModel.showConversationEvent.value = Event(pair)
|
||||
}
|
||||
findNavController().navigate(R.id.conversationsListFragment)
|
||||
}
|
||||
|
||||
val action = ConversationsListFragmentDirections.actionGlobalConversationsListFragment()
|
||||
findNavController().navigate(action)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,59 +46,6 @@
|
|||
android:layout_height="match_parent"
|
||||
android:background="@color/gray_900">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_300"
|
||||
android:id="@+id/waiting_for_others"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:text="@string/conference_call_empty"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="22sp"
|
||||
android:gravity="center"
|
||||
android:visibility="@{conferenceViewModel.participantDevices.size() > 1 ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_600"
|
||||
android:id="@+id/share_conference_link"
|
||||
android:onClick="@{shareConferenceClickListener}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:background="@drawable/shape_squircle_main2_400_border"
|
||||
android:text="@string/conference_share_link_title"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/gray_main2_400"
|
||||
android:visibility="@{conferenceViewModel.participantDevices.size() > 1 || viewModel.pipMode ? View.GONE : View.VISIBLE}"
|
||||
android:drawableStart="@drawable/share_network"
|
||||
android:drawablePadding="8dp"
|
||||
app:drawableTint="@color/gray_main2_400"
|
||||
app:layout_constraintTop_toBottomOf="@id/waiting_for_others"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/conference_layout_nav_host_fragment"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="@{viewModel.fullScreenMode || viewModel.pipMode ? @dimen/zero : @dimen/call_main_actions_menu_margin, default=@dimen/call_main_actions_menu_margin}"
|
||||
android:visibility="@{conferenceViewModel.participantDevices.size() > 1 ? View.VISIBLE : View.GONE}"
|
||||
app:navGraph="@navigation/conference_nav_graph"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/media_encryption_icon"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/header_info_visibility"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
@ -232,6 +179,59 @@
|
|||
app:layout_constraintStart_toEndOf="@id/media_encryption_icon"
|
||||
app:layout_constraintTop_toBottomOf="@id/conference_subject"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_300"
|
||||
android:id="@+id/waiting_for_others"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:text="@string/conference_call_empty"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="22sp"
|
||||
android:gravity="center"
|
||||
android:visibility="@{conferenceViewModel.participantDevices.size() > 1 ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_600"
|
||||
android:id="@+id/share_conference_link"
|
||||
android:onClick="@{shareConferenceClickListener}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:background="@drawable/shape_squircle_main2_400_border"
|
||||
android:text="@string/conference_share_link_title"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/gray_main2_400"
|
||||
android:visibility="@{conferenceViewModel.participantDevices.size() > 1 || viewModel.pipMode ? View.GONE : View.VISIBLE}"
|
||||
android:drawableStart="@drawable/share_network"
|
||||
android:drawablePadding="8dp"
|
||||
app:drawableTint="@color/gray_main2_400"
|
||||
app:layout_constraintTop_toBottomOf="@id/waiting_for_others"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/conference_layout_nav_host_fragment"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="@{viewModel.fullScreenMode || viewModel.pipMode ? @dimen/zero : @dimen/call_main_actions_menu_margin, default=@dimen/call_main_actions_menu_margin}"
|
||||
android:visibility="@{conferenceViewModel.participantDevices.size() > 1 ? View.VISIBLE : View.GONE}"
|
||||
app:navGraph="@navigation/conference_nav_graph"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/media_encryption_icon"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/recording"
|
||||
android:layout_width="@dimen/icon_size"
|
||||
|
|
|
|||
|
|
@ -333,6 +333,7 @@
|
|||
<action
|
||||
android:id="@+id/action_fileViewerFragment_to_conversationsListFragment"
|
||||
app:destination="@id/conversationsListFragment"
|
||||
app:launchSingleTop="true"
|
||||
app:popUpTo="@id/conversationsListFragment"
|
||||
app:popUpToInclusive="true"/>
|
||||
</fragment>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue