mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-12 15:24:09 +01:00
add floating lower hand button
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
96dce63e20
commit
f2b312a118
@ -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() {
|
||||
|
@ -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)
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user