add floating lower hand button

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2023-02-15 14:59:21 +01:00
parent 96dce63e20
commit f2b312a118
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
3 changed files with 29 additions and 1 deletions

View File

@ -415,6 +415,14 @@ public class CallActivity extends CallBaseActivity {
raiseHandViewModel = new ViewModelProvider(this, viewModelFactory).get((RaiseHandViewModel.class));
raiseHandViewModel.setData(roomToken, isBreakoutRoom);
raiseHandViewModel.getViewState().observe(this, viewState -> {
if (viewState instanceof RaiseHandViewModel.RaisedHandState) {
binding.lowerHandButton.setVisibility(View.VISIBLE);
} else if (viewState instanceof RaiseHandViewModel.LoweredHandState) {
binding.lowerHandButton.setVisibility(View.GONE);
}
});
callRecordingViewModel = new ViewModelProvider(this, viewModelFactory).get((CallRecordingViewModel.class));
callRecordingViewModel.setData(roomToken);
callRecordingViewModel.setRecordingState(extras.getInt(KEY_RECORDING_STATE));
@ -584,6 +592,10 @@ public class CallActivity extends CallBaseActivity {
Toast.makeText(context, context.getResources().getString(R.string.record_active_info), Toast.LENGTH_LONG).show();
}
});
binding.lowerHandButton.setOnClickListener(l -> {
raiseHandViewModel.lowerHand();
});
}
private void createCameraEnumerator() {

View File

@ -54,7 +54,7 @@ class RaiseHandViewModel @Inject constructor(private val repository: RequestAssi
}
}
private fun lowerHand() {
fun lowerHand() {
_viewState.value = LoweredHandState
if (isBreakoutRoom) {
repository.withdrawRequestAssistance(roomToken)

View File

@ -159,6 +159,22 @@
android:layout_height="wrap_content"
android:layout_alignTop="@id/verticalCenter"
android:layout_marginTop="-50dp" />
<ImageButton
android:id="@+id/lower_hand_button"
android:layout_width="@dimen/min_size_clickable_area"
android:layout_height="@dimen/min_size_clickable_area"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="150dp"
android:layout_marginEnd="20dp"
android:contentDescription="@string/lower_hand"
android:background="@drawable/shape_oval"
android:backgroundTint="@color/call_buttons_background"
android:visibility="gone"
tools:visibility="visible"
app:srcCompat="@drawable/ic_baseline_do_not_touch_24" />
</RelativeLayout>
</LinearLayout>