Commit aa9b6599 authored by Christophe Deschamps's avatar Christophe Deschamps
Browse files

Tablet view for device editing improvements

No related merge requests found
Showing with 240 additions and 47 deletions
......@@ -43,17 +43,32 @@
android:layout_weight="1"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:layout_marginStart="60dp"
android:layout_marginEnd="30dp"
backgoundcolor='@{"color_c"}'
android:layout_gravity="top"
tools:context=".ui.assistant.loginlinhome.LoginLinhomeAccountFragment">
<TextView
android:id="@+id/your_device"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
style='@{"section_title"}'
app:layout_constraintVertical_chainStyle="spread"
text='@{"your_device"}'
/>
<org.linhome.ui.widgets.LTextInput
android:id="@+id/name"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
app:layout_constraintVertical_chainStyle="spread"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toTopOf="@id/your_device"
app:layout_constraintBottom_toTopOf="@id/address"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......@@ -65,9 +80,8 @@
<org.linhome.ui.widgets.LTextInput
android:id="@+id/address"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:layout_constraintTop_toBottomOf="@id/name"
app:layout_constraintBottom_toTopOf="@id/select_type_section_title"
app:layout_constraintEnd_toEndOf="parent"
......@@ -81,7 +95,7 @@
<TextView
android:id="@+id/select_type_section_title"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:layout_constraintTop_toBottomOf="@id/address"
......@@ -95,7 +109,7 @@
<org.linhome.ui.widgets.LSpinner
android:id="@+id/devicetype"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:layout_constraintTop_toBottomOf="@id/select_type_section_title"
......@@ -110,16 +124,20 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginStart="30dp"
android:layout_marginEnd="60dp"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:paddingTop="18dp"
backgoundcolor='@{"color_c"}'
android:layout_gravity="top"
tools:context=".ui.assistant.loginlinhome.LoginLinhomeAccountFragment">
<TextView
android:id="@+id/select_method_section_title"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="22dp"
app:layout_constraintTop_toTopOf="parent"
......@@ -133,9 +151,9 @@
<org.linhome.ui.widgets.LSpinner
android:id="@+id/method"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginTop="15dp"
app:layout_constraintTop_toBottomOf="@id/select_method_section_title"
app:layout_constraintBottom_toTopOf="@id/actions"
app:layout_constraintEnd_toEndOf="parent"
......@@ -147,7 +165,7 @@
<LinearLayout
android:id="@+id/actions"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical"
......@@ -163,40 +181,39 @@
android:id="@+id/addaction"
android:clickable="true"
android:focusable="true"
android:layout_width="180dp"
android:layout_width="220dp"
android:layout_height="40dp"
android:layout_marginTop="27dp"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/actions"
app:layout_constraintBottom_toTopOf="@id/delete"
app:layout_constraintBottom_toTopOf="parent"
primary='@{false}'
text='@{"device_action_add"}'
icon='@{"icons/more"}'
/>
<org.linhome.ui.widgets.LRoundRectButton
android:id="@+id/delete"
android:clickable="true"
android:focusable="true"
android:layout_width="320dp"
android:layout_height="40dp"
android:layout_marginTop="37dp"
android:layout_marginBottom="23dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/addaction"
app:layout_constraintBottom_toBottomOf="parent"
primary='@{true}'
text='@{"delete_device"}'
android:visibility='@{model.device != null ? View.VISIBLE : View.GONE}'
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</ScrollView>
<org.linhome.ui.widgets.LRoundRectButton
android:id="@+id/delete"
android:clickable="true"
android:focusable="true"
android:layout_width="320dp"
android:layout_height="40dp"
android:layout_marginTop="37dp"
android:layout_marginBottom="23dp"
primary='@{true}'
text='@{"delete_device"}'
android:layout_centerInParent="true"
android:layout_alignParentBottom="true"
android:visibility='@{model.device != null ? View.VISIBLE : View.GONE}'
/>
</RelativeLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="android.view.View"/>
<import type="android.text.InputType"/>
<variable name="model" type="org.linhome.ui.devices.edit.DeviceEditorViewModel" />
<variable name="validators" type="org.linhome.ui.validators.ValidatorFactory.Companion" />
</data>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
backgoundcolor='@{"color_c"}'
tools:context=".ui.assistant.loginlinhome.LoginLinhomeAccountFragment">
<TextView
android:id="@+id/title"
android:layout_width="600dp"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
app:layout_constraintBottom_toTopOf="@id/name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
style='@{"view_main_title"}'
app:layout_constraintVertical_chainStyle="spread"
android:text='@{model.device != null ? model.device.name : model.getText("new_device")}'
/>
<org.linhome.ui.widgets.LTextInput
android:id="@+id/name"
android:layout_width="600dp"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintBottom_toTopOf="@id/address"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
title='@{"device_name"}'
liveString="@{model.name.first}"
liveValidity="@{model.name.second}"
validator="@{validators.nonEmptyStringValidator}"
android:inputType="@{InputType.TYPE_CLASS_TEXT |InputType.TYPE_TEXT_VARIATION_NORMAL}"/>
<org.linhome.ui.widgets.LTextInput
android:id="@+id/address"
android:layout_width="600dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:layout_constraintTop_toBottomOf="@id/name"
app:layout_constraintBottom_toTopOf="@id/select_type_section_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
title='@{"device_address"}'
hint='@{"device_address_hint"}'
liveString="@{model.address.first}"
liveValidity="@{model.address.second}"
validator="@{validators.sipUri}"
android:inputType="@{InputType.TYPE_TEXT_VARIATION_URI}"/>
<TextView
android:id="@+id/select_type_section_title"
android:layout_width="600dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:layout_constraintTop_toBottomOf="@id/address"
app:layout_constraintBottom_toTopOf="@id/devicetype"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
style='@{"section_title"}'
app:layout_constraintVertical_chainStyle="spread"
text='@{"device_type_select"}'
/>
<org.linhome.ui.widgets.LSpinner
android:id="@+id/devicetype"
android:layout_width="600dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
app:layout_constraintTop_toBottomOf="@id/select_type_section_title"
app:layout_constraintBottom_toTopOf="@id/select_method_section_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
listener="@{model.deviceTypeListener}"
initialIndex="@{model.deviceType}"
items="@{model.availableDeviceTypes}"
/>
<TextView
android:id="@+id/select_method_section_title"
android:layout_width="600dp"
android:layout_height="wrap_content"
android:layout_marginTop="22dp"
app:layout_constraintTop_toBottomOf="@id/devicetype"
app:layout_constraintBottom_toTopOf="@id/method"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
style='@{"section_title"}'
app:layout_constraintVertical_chainStyle="spread"
text='@{"method_type_select"}'
/>
<org.linhome.ui.widgets.LSpinner
android:id="@+id/method"
android:layout_width="600dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@id/select_method_section_title"
app:layout_constraintBottom_toTopOf="@id/actions"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
items="@{model.availableMethodTypes}"
initialIndex="@{model.actionsMethod}"
listener="@{model.actionsMethodListener}"
titlekey='@{"action_method"}' />
<LinearLayout
android:id="@+id/actions"
android:layout_width="600dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/method"
app:layout_constraintBottom_toTopOf="@id/addaction"
items="@{model.actionBindings}"
refreshOn="@{model.refreshActions}"
/>
<org.linhome.ui.widgets.LRoundRectButtonWithIcon
android:id="@+id/addaction"
android:clickable="true"
android:focusable="true"
android:layout_width="180dp"
android:layout_height="40dp"
android:layout_marginTop="27dp"
android:enabled="@{model.refreshActions &amp;&amp; model.actionBindings.size() &lt; 3}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/actions"
app:layout_constraintBottom_toTopOf="@id/delete"
primary='@{false}'
text='@{"device_action_add"}'
icon='@{"icons/more"}'
/>
<org.linhome.ui.widgets.LRoundRectButton
android:id="@+id/delete"
android:clickable="true"
android:focusable="true"
android:layout_width="600dp"
android:layout_height="40dp"
android:layout_marginTop="37dp"
android:layout_marginBottom="23dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/addaction"
app:layout_constraintBottom_toBottomOf="parent"
primary='@{true}'
text='@{"delete_device"}'
android:visibility='@{model.device != null ? View.VISIBLE : View.GONE}'
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</layout>
\ No newline at end of file
......@@ -8,18 +8,18 @@
<variable name="validators" type="org.linhome.ui.validators.ValidatorFactory.Companion" />
</data>
<RelativeLayout
<LinearLayout
android:id="@+id/list_item"
android:orientation="vertical"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="40dp"
android:gravity="center_vertical">
android:gravity="top">
<org.linhome.ui.widgets.LSpinner
android:id="@+id/type"
android:layout_width="230dp"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
items="@{actionmodel.owningViewModel.availableActionTypes}"
missingText='@{"action_type_missing"}'
showMissingText = "@{!TextUtils.isEmpty(actionmodel.code.first) &amp;&amp; actionmodel.type== 0}"
......@@ -33,7 +33,6 @@
android:layout_width="54dp"
android:layout_height="wrap_content"
android:layout_marginStart="7dp"
android:layout_toEndOf="@+id/type"
title='@{"action_code"}'
android:inputType="@{InputType.TYPE_CLASS_PHONE}"
liveString="@{actionmodel.code.first}"
......@@ -42,12 +41,10 @@
/>
<ImageView
android:layout_marginTop="32dp"
android:layout_height="20dp"
android:id="@+id/trash"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_toEndOf="@+id/code"
android:layout_centerVertical="true"
android:layout_marginBottom="10dp"
android:layout_marginStart="10dp"
foreground_selection_effect='@{"primary_color"}'
src='@{"icons/delete"}'
......@@ -55,5 +52,5 @@
>
</ImageView>
</RelativeLayout>
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -36,7 +36,7 @@
<TextView
android:id="@+id/error"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
style='@{"text_input_error"}'
......
......@@ -15,14 +15,14 @@
<TextView
android:id="@+id/title"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style='@{"form_input_title"}'
/>
<org.linhome.ui.widgets.LEditText
android:id="@+id/text"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:lines="1"
......@@ -37,7 +37,7 @@
<TextView
android:id="@+id/error"
android:layout_width="320dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
style='@{"text_input_error"}'
......
Subproject commit 5bdbe192c3ebddb6ffd0a4c9e4fd3bec2e1504e1
Subproject commit dd748cb6f4a86b8566af3097d9426ecd77abf453
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment