Fix crashing bugs

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-06-24 21:31:50 +02:00
parent a2de1bfd9d
commit 75fb4cbea1
2 changed files with 29 additions and 12 deletions

View file

@ -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<Disposable> 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;
}
}

View file

@ -36,7 +36,7 @@
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/conversationNameTextView"
@ -47,7 +47,7 @@
android:textColor="@color/white"
android:textSize="28sp"
app:layout_constraintTop_toBottomOf="@+id/incomingCallTextView"
tools:text="Victor Gregorius Magnus" />
tools:text="Victor Gregorius Magnus"/>
<ImageView
android:id="@+id/avatarImageView"
@ -58,34 +58,37 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.45"
tools:src="@color/white" />
tools:src="@color/white"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<com.nextcloud.talk.utils.MagicFlipView
android:id="@+id/callAnswerVoiceOnlyView"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_margin="24dp"
android:visibility="gone"
app:checked="false"
app:enableInitialAnimation="false"
app:frontBackgroundColor="@color/colorPrimary"
app:frontImage="@drawable/ic_mic_white_24px" />
app:frontImage="@drawable/ic_mic_white_24px"/>
<com.nextcloud.talk.utils.MagicFlipView
android:id="@+id/callAnswerCameraView"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_margin="24dp"
android:visibility="gone"
app:checked="false"
app:enableInitialAnimation="false"
app:frontBackgroundColor="@color/colorPrimary"
app:frontImage="@drawable/ic_videocam_white_24px" />
app:frontImage="@drawable/ic_videocam_white_24px"/>
<com.nextcloud.talk.utils.MagicFlipView
android:id="@+id/callControlHangupView"
@ -95,7 +98,7 @@
app:checked="false"
app:enableInitialAnimation="false"
app:frontBackgroundColor="@color/nc_darkRed"
app:frontImage="@drawable/ic_call_end_white_24px" />
app:frontImage="@drawable/ic_call_end_white_24px"/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>