linphone-android/app/src/main/res/layout/settings_video_fragment.xml
2021-04-17 10:04:18 +02:00

169 lines
No EOL
8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:linphone="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View"/>
<import type="android.text.InputType"/>
<variable
name="backClickListener"
type="android.view.View.OnClickListener"/>
<variable
name="viewModel"
type="org.linphone.activities.main.settings.viewmodels.VideoSettingsViewModel"/>
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/top_bar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:background="?attr/lightToolbarBackgroundColor"
android:orientation="horizontal">
<ImageView
android:id="@+id/back"
android:onClick="@{backClickListener}"
android:contentDescription="@string/content_description_go_back"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:background="?attr/button_background_drawable"
android:padding="18dp"
android:src="@drawable/back" />
<TextView
style="@style/accent_colored_title_font"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.6"
android:gravity="center"
android:singleLine="true"
android:ellipsize="end"
android:padding="15dp"
android:text="@string/settings_video_title"/>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:visibility="invisible" />
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/top_bar">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/settings_widget_switch"
linphone:title="@{@string/video_settings_enable_title}"
linphone:subtitle="@{@string/video_settings_enable_summary}"
linphone:listener="@{viewModel.enableVideoListener}"
linphone:checked="@={viewModel.enableVideo}"/>
<include
layout="@layout/settings_widget_switch"
linphone:title="@{@string/video_settings_tablet_preview_title}"
linphone:subtitle="@{@string/video_settings_tablet_preview_summary}"
linphone:listener="@{viewModel.tabletPreviewListener}"
linphone:checked="@={viewModel.tabletPreview}"
linphone:enabled="@{viewModel.enableVideo}"
android:visibility="@{viewModel.isTablet ? View.VISIBLE : View.GONE}"/>
<include
layout="@layout/settings_widget_switch"
linphone:title="@{@string/video_settings_initiate_call_title}"
linphone:subtitle="@{@string/video_settings_initiate_call_summary}"
linphone:listener="@{viewModel.initiateCallListener}"
linphone:checked="@={viewModel.initiateCall}"
linphone:enabled="@{viewModel.enableVideo}"/>
<include
layout="@layout/settings_widget_switch"
linphone:title="@{@string/video_settings_automatically_accept_title}"
linphone:subtitle="@{@string/video_settings_automatically_accept_summary}"
linphone:listener="@{viewModel.autoAcceptListener}"
linphone:checked="@={viewModel.autoAccept}"
linphone:enabled="@{viewModel.enableVideo}"/>
<include
layout="@layout/settings_widget_list"
linphone:title="@{@string/video_settings_camera_device_title}"
linphone:subtitle="@{@string/video_settings_camera_device_summary}"
linphone:listener="@{viewModel.cameraDeviceListener}"
linphone:selectedIndex="@{viewModel.cameraDeviceIndex}"
linphone:labels="@{viewModel.cameraDeviceLabels}"
linphone:enabled="@{viewModel.enableVideo}"/>
<include
layout="@layout/settings_widget_list"
linphone:title="@{@string/video_settings_video_size_title}"
linphone:subtitle="@{@string/video_settings_video_size_summary}"
linphone:listener="@{viewModel.videoSizeListener}"
linphone:selectedIndex="@{viewModel.videoSizeIndex}"
linphone:labels="@{viewModel.videoSizeLabels}"
linphone:enabled="@{viewModel.enableVideo}"/>
<include
layout="@layout/settings_widget_list"
linphone:title="@{@string/video_settings_video_preset_title}"
linphone:subtitle="@{@string/video_settings_video_preset_summary}"
linphone:listener="@{viewModel.videoPresetListener}"
linphone:selectedIndex="@{viewModel.videoPresetIndex}"
linphone:labels="@{viewModel.videoPresetLabels}"
linphone:enabled="@{viewModel.enableVideo}"/>
<include
layout="@layout/settings_widget_list"
linphone:title="@{@string/video_settings_preferred_fps_title}"
linphone:subtitle="@{@string/video_settings_preferred_fps_summary}"
linphone:listener="@{viewModel.preferredFpsListener}"
linphone:selectedIndex="@{viewModel.preferredFpsIndex}"
linphone:labels="@{viewModel.preferredFpsLabels}"
linphone:enabled="@{viewModel.enableVideo}"
android:visibility="@{viewModel.videoPresetIndex == 2 ? View.VISIBLE : View.GONE}"/>
<include
layout="@layout/settings_widget_text"
linphone:title="@{@string/video_settings_bandwidth_limit_title}"
linphone:subtitle="@{@string/video_settings_bandwidth_limit_summary}"
linphone:listener="@{viewModel.bandwidthLimitListener}"
linphone:defaultValue="@{viewModel.bandwidthLimit.toString()}"
linphone:inputType="@{InputType.TYPE_CLASS_NUMBER}"
linphone:enabled="@{viewModel.enableVideo}"
android:visibility="@{viewModel.videoPresetIndex == 2 ? View.VISIBLE : View.GONE}"/>
<TextView
style="@style/settings_category_font"
android:id="@+id/pref_video_codecs_header"
android:text="@string/video_settings_codecs_title"
android:paddingTop="15dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
linphone:entries="@{viewModel.videoCodecs}"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
</layout>