linphone-android/app/src/main/res/layout/settings_contacts_fragment.xml
2022-06-28 17:02:45 +02:00

141 lines
No EOL
6.5 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"/>
<variable
name="viewModel"
type="org.linphone.activities.main.settings.viewmodels.ContactsSettingsViewModel"/>
<variable
name="sharedMainViewModel"
type="org.linphone.activities.main.viewmodels.SharedMainViewModel" />
</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="@dimen/main_activity_top_bar_size"
android:layout_gravity="center_horizontal"
android:background="?attr/lightToolbarBackgroundColor"
android:orientation="horizontal">
<ImageView
android:id="@+id/back"
android:visibility="@{sharedMainViewModel.isSlidingPaneSlideable ? View.VISIBLE : View.GONE}"
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_contacts_title"/>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:visibility="@{sharedMainViewModel.isSlidingPaneSlideable ? View.INVISIBLE : View.GONE}" />
</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/contacts_settings_friendlist_subscribe_title}"
linphone:listener="@{viewModel.friendListSubscribeListener}"
linphone:checked="@={viewModel.friendListSubscribe}"
linphone:enabled="@{viewModel.readContactsPermissionGranted &amp;&amp; viewModel.rlsAddressAvailable}"/>
<include
layout="@layout/settings_widget_switch"
linphone:title="@{@string/contacts_settings_show_new_contact_account_dialog_title}"
linphone:subtitle="@{@string/contacts_settings_show_new_contact_account_dialog_summary}"
linphone:listener="@{viewModel.showNewContactAccountDialogListener}"
linphone:checked="@={viewModel.showNewContactAccountDialog}"
linphone:enabled="@{viewModel.readContactsPermissionGranted}"/>
<include
layout="@layout/settings_widget_switch"
linphone:title="@{@string/contacts_settings_native_presence_title}"
linphone:subtitle="@{@string/contacts_settings_native_presence_summary}"
linphone:listener="@{viewModel.nativePresenceListener}"
linphone:checked="@={viewModel.nativePresence}"
linphone:enabled="@{viewModel.readContactsPermissionGranted &amp;&amp; viewModel.friendListSubscribe}"/>
<include
layout="@layout/settings_widget_switch"
linphone:title="@{@string/contacts_settings_show_organization_title}"
linphone:listener="@{viewModel.showOrganizationListener}"
linphone:checked="@={viewModel.showOrganization}"
linphone:enabled="@{viewModel.readContactsPermissionGranted}"/>
<include
layout="@layout/settings_widget_switch"
android:visibility="gone"
linphone:title="@{@string/contacts_settings_launcher_shortcuts_title}"
linphone:subtitle="@{@string/contacts_settings_launcher_shortcuts_summary}"
linphone:listener="@{viewModel.launcherShortcutsListener}"
linphone:checked="@={viewModel.launcherShortcuts}"
linphone:enabled="@{viewModel.readContactsPermissionGranted}"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="@{viewModel.ldapAvailable ? View.VISIBLE : View.GONE}"
android:orientation="vertical">
<TextView
style="@style/settings_category_font"
android:text="@string/contacts_settings_ldap_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.ldapConfigurations}"
linphone:layout="@{@layout/settings_ldap_cell}"/>
<include
layout="@layout/settings_widget_basic"
linphone:listener="@{viewModel.ldapNewSettingsListener}"
linphone:title="@{@string/contacts_settings_create_new_ldap_config_title}" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
</layout>