From 922ae5b041266da21eaba8ea2cc6b9dad183a640 Mon Sep 17 00:00:00 2001 From: ganfra Date: Thu, 7 Jan 2021 12:21:09 +0100 Subject: [PATCH] VoIP: clean dial pad code + add close icon on bottom sheet --- .../app/features/call/VectorCallActivity.kt | 4 +-- .../call/dialpad/CallDialPadBottomSheet.kt | 3 ++ .../features/call/dialpad/DialPadFragment.kt | 4 +-- .../home/room/detail/RoomDetailFragment.kt | 1 - .../res/layout/bottom_sheet_call_dial_pad.xml | 35 ++++++++++++++----- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt b/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt index 0e560dbdb1..9a217dcd11 100644 --- a/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt +++ b/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt @@ -121,7 +121,7 @@ class VectorCallActivity : VectorBaseActivity(), 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(), 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 diff --git a/vector/src/main/java/im/vector/app/features/call/dialpad/CallDialPadBottomSheet.kt b/vector/src/main/java/im/vector/app/features/call/dialpad/CallDialPadBottomSheet.kt index 07a5320a10..4fd5e54f66 100644 --- a/vector/src/main/java/im/vector/app/features/call/dialpad/CallDialPadBottomSheet.kt +++ b/vector/src/main/java/im/vector/app/features/call/dialpad/CallDialPadBottomSheet.kt @@ -70,6 +70,9 @@ class CallDialPadBottomSheet private constructor() : VectorBaseBottomSheetDialog } else { setCallbackToFragment(callback) } + views.callDialPadClose.setOnClickListener { + dismiss() + } } override fun onDestroyView() { diff --git a/vector/src/main/java/im/vector/app/features/call/dialpad/DialPadFragment.kt b/vector/src/main/java/im/vector/app/features/call/dialpad/DialPadFragment.kt index 7bceb2e54a..b488a1af0e 100644 --- a/vector/src/main/java/im/vector/app/features/call/dialpad/DialPadFragment.kt +++ b/vector/src/main/java/im/vector/app/features/call/dialpad/DialPadFragment.kt @@ -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) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt index 988cf2fd30..0adc4fff24 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt @@ -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 diff --git a/vector/src/main/res/layout/bottom_sheet_call_dial_pad.xml b/vector/src/main/res/layout/bottom_sheet_call_dial_pad.xml index cb8c0114ab..af82f3946b 100644 --- a/vector/src/main/res/layout/bottom_sheet_call_dial_pad.xml +++ b/vector/src/main/res/layout/bottom_sheet_call_dial_pad.xml @@ -1,25 +1,42 @@ - + android:orientation="horizontal" + android:padding="8dp"> + + + + + + + android:layout_height="match_parent" />