Renamed some views, replaced caret by handle for in call bottom sheet

This commit is contained in:
Sylvain Berfini 2023-11-09 16:20:29 +01:00
parent 3507117cff
commit c1d76bbd29
19 changed files with 57 additions and 56 deletions

View file

@ -261,22 +261,6 @@ class ActiveCallFragment : GenericCallFragment() {
}
}
}
actionsBottomSheetBehavior.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
override fun onStateChanged(bottomSheet: View, newState: Int) {
when (newState) {
BottomSheetBehavior.STATE_COLLAPSED, BottomSheetBehavior.STATE_HIDDEN -> {
callViewModel.isActionsMenuExpanded.value = false
}
BottomSheetBehavior.STATE_EXPANDED -> {
callViewModel.isActionsMenuExpanded.value = true
}
else -> {}
}
}
override fun onSlide(bottomSheet: View, slideOffset: Float) {}
})
}
@SuppressLint("ClickableViewAccessibility")

View file

@ -98,22 +98,6 @@ class ActiveConferenceCallFragment : GenericCallFragment() {
sharedViewModel.toggleFullScreenEvent.value = Event(hide)
}
actionsBottomSheetBehavior.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
override fun onStateChanged(bottomSheet: View, newState: Int) {
when (newState) {
BottomSheetBehavior.STATE_COLLAPSED, BottomSheetBehavior.STATE_HIDDEN -> {
callViewModel.isActionsMenuExpanded.value = false
}
BottomSheetBehavior.STATE_EXPANDED -> {
callViewModel.isActionsMenuExpanded.value = true
}
else -> {}
}
}
override fun onSlide(bottomSheet: View, slideOffset: Float) {}
})
binding.setCallsListClickListener {
Log.i("$TAG Going to calls list fragment")
val action = ActiveConferenceCallFragmentDirections.actionActiveConferenceCallFragmentToCallsListFragment()

View file

@ -140,8 +140,6 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
// Extras actions
val isActionsMenuExpanded = MutableLiveData<Boolean>()
val toggleExtraActionsBottomSheetEvent: MutableLiveData<Event<Boolean>> by lazy {
MutableLiveData<Event<Boolean>>()
}
@ -377,7 +375,6 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
isVideoEnabled.value = false
isMicrophoneMuted.value = false
fullScreenMode.value = false
isActionsMenuExpanded.value = false
coreContext.postOnCoreThread { core ->
core.addListener(coreListener)

View file

@ -483,6 +483,26 @@ class ConversationViewModel @UiThread constructor() : ViewModel() {
}
}
@UiThread
fun startVoiceMessageRecording() {
}
@UiThread
fun stopVoiceMessageRecording() {
}
@UiThread
fun cancelVoiceMessageRecording() {
}
@UiThread
fun playVoiceMessageRecording() {
}
@UiThread
fun pauseVoiceMessageRecording() {
}
@WorkerThread
private fun configureChatRoom() {
scrollingPosition = SCROLLING_POSITION_NOT_SET

View file

@ -207,13 +207,14 @@ class MainViewModel @UiThread constructor() : ViewModel() {
}
callsStatus.postValue(LinphoneUtils.callStateToString(currentCall.state))
}
Log.i("$TAG At least a call, asking fragment to change status bar color")
changeSystemTopBarColorEvent.postValue(Event(IN_CALL))
} else {
callLabel.postValue(
AppUtils.getFormattedString(R.string.calls_count_label, core.callsNb)
)
callsStatus.postValue("") // TODO: improve ?
}
Log.i("$TAG At least a call, asking fragment to change status bar color")
changeSystemTopBarColorEvent.postValue(Event(IN_CALL))
}
}

View file

@ -25,14 +25,14 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="@dimen/call_all_actions_menu_height"
android:background="@color/gray_900"
android:background="@drawable/shape_call_bottom_sheet_background"
app:behavior_hideable="false"
app:behavior_peekHeight="@dimen/call_main_actions_menu_height"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<include
android:id="@+id/main_actions"
layout="@layout/call_main_actions"
layout="@layout/call_common_actions"
android:layout_width="0dp"
android:layout_height="@dimen/call_main_actions_menu_height"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -22,14 +22,14 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="@dimen/call_all_actions_menu_height"
android:background="@color/gray_900"
android:background="@drawable/shape_call_bottom_sheet_background"
app:behavior_hideable="false"
app:behavior_peekHeight="@dimen/call_main_actions_menu_height"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<include
android:id="@+id/main_actions"
layout="@layout/call_main_actions"
layout="@layout/call_common_actions"
android:layout_width="0dp"
android:layout_height="@dimen/call_main_actions_menu_height"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -208,7 +208,7 @@
<include
android:id="@+id/bottom_bar"
android:visibility="@{viewModel.fullScreenMode || viewModel.pipMode ? View.INVISIBLE : View.VISIBLE}"
layout="@layout/call_extra_conference_actions"
layout="@layout/call_conference_actions_bottom_sheet"
bind:viewModel="@{viewModel}"
bind:callsViewModel="@{callsViewModel}"
bind:participantsListClickListener="@{participantsListClickListener}"

View file

@ -249,7 +249,7 @@
<include
android:id="@+id/bottom_bar"
android:visibility="@{viewModel.fullScreenMode || viewModel.pipMode ? View.INVISIBLE : View.VISIBLE}"
layout="@layout/call_extra_actions"
layout="@layout/call_actions_bottom_sheet"
bind:viewModel="@{viewModel}"
bind:callsViewModel="@{callsViewModel}"
bind:newCallClickListener="@{newCallClickListener}"
@ -258,7 +258,7 @@
<include
android:id="@+id/call_numpad"
android:visibility="@{viewModel.fullScreenMode || viewModel.pipMode ? View.INVISIBLE : View.VISIBLE}"
layout="@layout/call_numpad"
layout="@layout/call_numpad_bottom_sheet"
bind:model="@{numpadModel}"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -16,7 +16,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/call_main_actions_menu_height"
android:paddingBottom="5dp"
android:background="@color/gray_900">
android:background="@drawable/shape_call_bottom_sheet_background">
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
android:onClick="@{() -> viewModel.toggleExpandActionsMenu()}"
@ -24,11 +24,12 @@
android:id="@+id/toggle_expand"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:src="@{viewModel.isActionsMenuExpanded ? @drawable/caret_down : @drawable/caret_up, default=@drawable/caret_up}"
android:padding="11dp"
android:src="@drawable/shape_drawer_handle"
app:tint="@color/white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/hang_up" />
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:onClick="@{() -> viewModel.hangUp()}"

View file

@ -22,14 +22,14 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="@dimen/call_all_actions_menu_height"
android:background="@color/gray_900"
android:background="@drawable/shape_call_bottom_sheet_background"
app:behavior_hideable="false"
app:behavior_peekHeight="@dimen/call_main_actions_menu_height"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<include
android:id="@+id/main_actions"
layout="@layout/call_main_actions"
layout="@layout/call_common_actions"
android:layout_width="0dp"
android:layout_height="@dimen/call_main_actions_menu_height"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -12,7 +12,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_900"
android:background="@drawable/shape_call_bottom_sheet_background"
android:paddingTop="15dp"
android:paddingBottom="15dp">

View file

@ -15,7 +15,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_numpad_call_background"
android:background="@drawable/shape_call_bottom_sheet_background"
android:clickable="true"
android:focusable="true"
app:behavior_hideable="true"
@ -29,7 +29,7 @@
android:layout_height="wrap_content"
android:padding="11dp"
android:src="@drawable/shape_drawer_handle"
app:tint="@color/gray_500"
app:tint="@color/white"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

View file

@ -148,7 +148,7 @@
bind:viewModel="@{viewModel}"
bind:showExpandToggle="@{false}"
android:id="@+id/bottom_bar"
layout="@layout/call_main_actions"
layout="@layout/call_common_actions"
android:layout_width="0dp"
android:layout_height="@dimen/call_main_actions_menu_height"
app:layout_constraintStart_toStartOf="parent"

View file

@ -233,7 +233,7 @@
openFilePickerClickListener="@{openFilePickerClickListener}"
viewModel="@{viewModel}"
android:visibility="@{viewModel.isReadOnly ? View.GONE : View.VISIBLE}"
layout="@layout/chat_conversation_send_area"/>
layout="@layout/chat_conversation_send_area_bottom_sheet"/>
<include
android:id="@+id/message_bottom_sheet"

View file

@ -146,7 +146,7 @@
android:layout_width="40dp"
android:layout_height="0dp"
android:layout_marginEnd="4dp"
android:enabled="@{viewModel.textToSend.length() > 0 || viewModel.attachments.size() > 0}"
android:visibility="@{viewModel.textToSend.length() > 0 || viewModel.attachments.size() > 0 ? View.VISIBLE : View.GONE, default=gone}"
android:onClick="@{() -> viewModel.sendMessage()}"
android:padding="8dp"
android:src="@drawable/paper_plane_tilt"
@ -155,6 +155,20 @@
app:layout_constraintTop_toTopOf="@id/message_area_background"
app:tint="@color/icon_primary_color_selector" />
<ImageView
android:id="@+id/record_voice_message"
android:layout_width="40dp"
android:layout_height="0dp"
android:layout_marginEnd="4dp"
android:visibility="@{viewModel.textToSend.length() > 0 || viewModel.attachments.size() > 0 ? View.GONE : View.VISIBLE}"
android:onClick="@{() -> viewModel.startVoiceMessageRecording()}"
android:padding="8dp"
android:src="@drawable/microphone"
app:layout_constraintBottom_toBottomOf="@id/message_area_background"
app:layout_constraintEnd_toEndOf="@id/message_area_background"
app:layout_constraintTop_toTopOf="@id/message_area_background"
app:tint="@color/gray_main2_500" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View file

@ -204,7 +204,7 @@
android:id="@+id/numpad_layout"
bind:handleClickedListener="@{hideNumpadClickListener}"
bind:model="@{viewModel.numpadModel}"
layout="@layout/start_call_numpad" />
layout="@layout/start_call_numpad_bottom_sheet" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>