mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-29 17:59:22 +00:00
Added empty start call fragment
This commit is contained in:
parent
464e8b4899
commit
627a0d6f9e
6 changed files with 131 additions and 3 deletions
|
|
@ -58,7 +58,7 @@ class CallsListFragment : GenericFragment() {
|
|||
private lateinit var adapter: CallsListAdapter
|
||||
|
||||
override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? {
|
||||
if (findNavController().currentDestination?.id == R.id.newContactFragment) {
|
||||
if (findNavController().currentDestination?.id == R.id.startCallFragment) {
|
||||
// Holds fragment in place while new contact fragment slides over it
|
||||
return AnimationUtils.loadAnimation(activity, R.anim.hold)
|
||||
}
|
||||
|
|
@ -133,6 +133,10 @@ class CallsListFragment : GenericFragment() {
|
|||
binding.setMenuClickListener {
|
||||
showPopupMenu()
|
||||
}
|
||||
|
||||
binding.setStartCallClickListener {
|
||||
findNavController().navigate(R.id.action_global_startCallFragment)
|
||||
}
|
||||
}
|
||||
|
||||
private fun copyNumberOrAddressToClipboard(value: String) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,37 @@
|
|||
*/
|
||||
package org.linphone.ui.main.calls.fragment
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import org.linphone.databinding.CallStartFragmentBinding
|
||||
import org.linphone.ui.main.fragment.GenericFragment
|
||||
|
||||
class StartCallFragment : Fragment()
|
||||
class StartCallFragment : GenericFragment() {
|
||||
private lateinit var binding: CallStartFragmentBinding
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
binding = CallStartFragmentBinding.inflate(layoutInflater)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun goBack() {
|
||||
findNavController().popBackStack()
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
binding.setCancelClickListener {
|
||||
goBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@
|
|||
<variable
|
||||
name="menuClickListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="startCallClickListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.ui.main.calls.viewmodel.CallsListViewModel" />
|
||||
|
|
@ -96,6 +99,7 @@
|
|||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:onClick="@{startCallClickListener}"
|
||||
android:id="@+id/new_call"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
|||
72
app/src/main/res/layout/call_start_fragment.xml
Normal file
72
app/src/main/res/layout/call_start_fragment.xml
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
<variable
|
||||
name="cancelClickListener"
|
||||
type="View.OnClickListener" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:onClick="@{cancelClickListener}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/back"
|
||||
android:drawableTint="@color/primary_color"
|
||||
app:layout_constraintBottom_toBottomOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/title" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_800"
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="New call"
|
||||
android:textColor="@color/primary_color"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/back"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@color/gray_7"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -14,6 +14,9 @@
|
|||
<variable
|
||||
name="menuClickListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="startCallClickListener"
|
||||
type="View.OnClickListener" />
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.ui.main.calls.viewmodel.CallsListViewModel" />
|
||||
|
|
@ -96,6 +99,7 @@
|
|||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:onClick="@{startCallClickListener}"
|
||||
android:id="@+id/new_call"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
|||
|
|
@ -11,4 +11,17 @@
|
|||
android:label="CallsListFragment"
|
||||
tools:layout="@layout/calls_list_fragment"/>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/startCallFragment"
|
||||
android:name="org.linphone.ui.main.calls.fragment.StartCallFragment"
|
||||
android:label="StartCallFragment"
|
||||
tools:layout="@layout/call_start_fragment" />
|
||||
|
||||
<action
|
||||
android:id="@+id/action_global_startCallFragment"
|
||||
app:destination="@id/startCallFragment"
|
||||
app:enterAnim="@anim/slide_in"
|
||||
app:popExitAnim="@anim/slide_out"
|
||||
app:launchSingleTop="true"/>
|
||||
|
||||
</navigation>
|
||||
Loading…
Add table
Reference in a new issue