linphone-android/app/src/main/res/layout/call_primary_buttons.xml
Sylvain Berfini ffbc209c69 Improved code
2021-04-17 10:05:01 +02:00

72 lines
No EOL
3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="android.view.View" />
<variable
name="viewModel"
type="org.linphone.activities.call.viewmodels.ControlsViewModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:onClick="@{() -> viewModel.toggleNumpadVisibility()}"
android:selected="@{viewModel.numpadVisibility}"
android:contentDescription="@string/content_description_show_numpad"
android:layout_width="0dp"
android:layout_height="@dimen/call_button_size"
android:layout_weight="0.25"
android:background="@drawable/button_background_dark"
android:padding="15dp"
android:src="@drawable/call_numpad" />
<ImageView
android:onClick="@{() -> viewModel.terminateCall()}"
android:contentDescription="@string/content_description_terminate_call"
android:layout_width="0dp"
android:layout_height="@dimen/call_button_size"
android:layout_weight="0.5"
android:background="@drawable/call_hangup_background"
android:padding="12dp"
android:src="@drawable/call_hangup" />
<RelativeLayout
android:onClick="@{() -> viewModel.onChatClicked()}"
android:visibility="@{viewModel.chatAllowed ? View.VISIBLE : View.GONE}"
android:layout_width="0dp"
android:layout_height="@dimen/call_button_size"
android:layout_weight="0.25"
android:background="@drawable/footer_button">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:background="@drawable/button_background_dark"
android:contentDescription="@string/content_description_go_to_chat"
android:padding="15dp"
android:src="@drawable/footer_chat" />
<TextView
android:translationY="@{viewModel.chatUnreadCountTranslateY}"
android:text="@{String.valueOf(viewModel.unreadMessagesCount)}"
android:visibility="@{viewModel.unreadMessagesCount == 0 ? View.GONE : View.VISIBLE}"
style="@style/unread_count_font"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="25dp"
android:layout_marginTop="5dp"
android:background="@drawable/unread_message_count_bg"
android:gravity="center" />
</RelativeLayout>
</LinearLayout>
</layout>