VoIP: clean dial pad code + add close icon on bottom sheet

This commit is contained in:
ganfra 2021-01-07 12:21:09 +01:00
parent 201a346d41
commit 922ae5b041
5 changed files with 32 additions and 15 deletions

View file

@ -121,7 +121,7 @@ class VectorCallActivity : VectorBaseActivity<ActivityCallBinding>(), CallContro
if (intent.getStringExtra(EXTRA_MODE) == INCOMING_RINGING) {
turnScreenOnAndKeyguardOff()
}
if(savedInstanceState != null) {
if (savedInstanceState != null) {
(supportFragmentManager.findFragmentByTag(FRAGMENT_DIAL_PAD_TAG) as? CallDialPadBottomSheet)?.callback = dialPadCallback
}
configureCallViews()
@ -220,7 +220,7 @@ class VectorCallActivity : VectorBaseActivity<ActivityCallBinding>(), CallContro
if (callArgs.isVideoCall) {
views.callVideoGroup.isVisible = true
views.callInfoGroup.isVisible = false
//views.pip_video_view.isVisible = !state.isVideoCaptureInError
// views.pip_video_view.isVisible = !state.isVideoCaptureInError
} else {
views.callVideoGroup.isInvisible = true
views.callInfoGroup.isVisible = true

View file

@ -70,6 +70,9 @@ class CallDialPadBottomSheet private constructor() : VectorBaseBottomSheetDialog
} else {
setCallbackToFragment(callback)
}
views.callDialPadClose.setOnClickListener {
dismiss()
}
}
override fun onDestroyView() {

View file

@ -23,7 +23,6 @@ import android.view.View
import android.view.ViewGroup
import androidx.core.view.isVisible
import androidx.core.widget.ImageViewCompat
import androidx.core.widget.addTextChangedListener
import androidx.fragment.app.Fragment
import com.android.dialer.dialpadview.DialpadView
import com.android.dialer.dialpadview.DigitsEditText
@ -120,7 +119,6 @@ class DialPadFragment : Fragment() {
return view
}
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
outState.putString(EXTRA_REGION_CODE, regionCode)
@ -133,7 +131,7 @@ class DialPadFragment : Fragment() {
outState.putBoolean(EXTRA_CURSOR_VISIBLE, cursorVisible)
}
private fun initArgs(savedInstanceState: Bundle?){
private fun initArgs(savedInstanceState: Bundle?) {
val args = savedInstanceState ?: arguments
if (args != null) {
regionCode = args.getString(EXTRA_REGION_CODE, DEFAULT_REGION_CODE)

View file

@ -123,7 +123,6 @@ import im.vector.app.features.attachments.toGroupedContentAttachmentData
import im.vector.app.features.call.SharedActiveCallViewModel
import im.vector.app.features.call.VectorCallActivity
import im.vector.app.features.call.conference.JitsiCallViewModel
import im.vector.app.features.call.webrtc.WebRtcCallManager
import im.vector.app.features.command.Command
import im.vector.app.features.crypto.keysbackup.restore.KeysBackupRestoreActivity
import im.vector.app.features.crypto.util.toImageRes

View file

@ -1,25 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/callDialPad"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?riotx_bottom_sheet_background"
android:orientation="vertical">
<TextView
android:id="@+id/callDialPadTitle"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="8dp"
android:textColor="?riotx_text_primary"
android:textSize="16sp"
android:layout_marginBottom="24dp"
android:text="@string/call_dial_pad_title" />
android:orientation="horizontal"
android:padding="8dp">
<TextView
android:id="@+id/callDialPadTitle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="@string/call_dial_pad_title"
android:textColor="?riotx_text_primary"
android:textSize="20sp" />
<ImageView
android:id="@+id/callDialPadClose"
android:layout_width="@dimen/layout_touch_size"
android:layout_height="@dimen/layout_touch_size"
android:scaleType="center"
app:tint="?riotx_text_primary"
android:foreground="?selectableItemBackground"
android:src="@drawable/ic_cross" />
</LinearLayout>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/callDialPadFragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
</LinearLayout>