From 75fb4cbea14b5dae205f167f0674df3656d0baf7 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Sun, 24 Jun 2018 21:31:50 +0200 Subject: [PATCH] Fix crashing bugs Signed-off-by: Mario Danic --- .../CallNotificationController.java | 14 ++++++++++ .../layout/controller_call_notification.xml | 27 ++++++++++--------- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java index 66c372c76..8fc56ad72 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java @@ -52,6 +52,7 @@ import com.nextcloud.talk.models.json.participants.ParticipantsOverall; import com.nextcloud.talk.models.json.rooms.Room; import com.nextcloud.talk.models.json.rooms.RoomsOverall; import com.nextcloud.talk.utils.ApiUtils; +import com.nextcloud.talk.utils.MagicFlipView; import com.nextcloud.talk.utils.bundle.BundleKeys; import com.nextcloud.talk.utils.glide.GlideApp; import com.nextcloud.talk.utils.preferences.AppPreferences; @@ -88,6 +89,13 @@ public class CallNotificationController extends BaseController { @BindView(R.id.avatarImageView) ImageView avatarImageView; + + @BindView(R.id.callAnswerVoiceOnlyView) + MagicFlipView callAnswerVoiceOnlyView; + + @BindView(R.id.callAnswerCameraView) + MagicFlipView callAnswerCameraView; + private List disposablesList = new ArrayList<>(); private Bundle originalBundle; private String roomId; @@ -114,6 +122,11 @@ public class CallNotificationController extends BaseController { return inflater.inflate(R.layout.controller_call_notification, container, false); } + private void showAnswerControls() { + callAnswerCameraView.setVisibility(View.VISIBLE); + callAnswerVoiceOnlyView.setVisibility(View.VISIBLE); + } + @OnClick(R.id.callControlHangupView) void hangup() { leavingScreen = true; @@ -212,6 +225,7 @@ public class CallNotificationController extends BaseController { conversationNameTextView.setText(room.getDisplayName()); loadAvatar(); checkIfAnyParticipantsRemainInRoom(); + showAnswerControls(); break; } } diff --git a/app/src/main/res/layout/controller_call_notification.xml b/app/src/main/res/layout/controller_call_notification.xml index 592a60673..b91f6e649 100644 --- a/app/src/main/res/layout/controller_call_notification.xml +++ b/app/src/main/res/layout/controller_call_notification.xml @@ -19,11 +19,11 @@ ~ along with this program. If not, see . --> + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/grey950"> + app:layout_constraintTop_toTopOf="parent"/> + tools:text="Victor Gregorius Magnus"/> + tools:src="@color/white"/> + + app:frontImage="@drawable/ic_mic_white_24px"/> - + app:frontImage="@drawable/ic_videocam_white_24px"/> + app:frontImage="@drawable/ic_call_end_white_24px"/>