Show / hide call views according to call type.
This commit is contained in:
parent
79f804b2d4
commit
24cea5110e
|
@ -28,6 +28,7 @@ import android.os.Parcelable
|
|||
import android.view.View
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.isVisible
|
||||
import butterknife.BindView
|
||||
import com.airbnb.mvrx.MvRx
|
||||
import com.airbnb.mvrx.viewModel
|
||||
|
@ -130,10 +131,7 @@ class VectorCallActivity : VectorBaseActivity() {
|
|||
finish()
|
||||
}
|
||||
|
||||
iv_end_call.setOnClickListener {
|
||||
callViewModel.handle(VectorCallViewActions.EndCall)
|
||||
finish()
|
||||
}
|
||||
configureCallViews()
|
||||
|
||||
callViewModel.viewEvents
|
||||
.observe()
|
||||
|
@ -148,6 +146,23 @@ class VectorCallActivity : VectorBaseActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun configureCallViews() {
|
||||
if (callArgs.isVideoCall) {
|
||||
iv_call_speaker.isVisible = false
|
||||
iv_call_flip_camera.isVisible = true
|
||||
iv_call_videocam_off.isVisible = true
|
||||
} else {
|
||||
iv_call_speaker.isVisible = true
|
||||
iv_call_flip_camera.isVisible = false
|
||||
iv_call_videocam_off.isVisible = false
|
||||
}
|
||||
|
||||
iv_end_call.setOnClickListener {
|
||||
callViewModel.handle(VectorCallViewActions.EndCall)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
|
||||
if (requestCode == CAPTURE_PERMISSION_REQUEST_CODE && allGranted(grantResults)) {
|
||||
start()
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
android:id="@+id/layout_call_actions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginBottom="48dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
Loading…
Reference in New Issue