Improved assistant input fields

This commit is contained in:
Sylvain Berfini 2020-07-16 15:18:09 +02:00
parent 9a856f075a
commit 6394f45ef5
12 changed files with 360 additions and 434 deletions

View file

@ -110,43 +110,46 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/select_country"> android:layout_below="@id/select_country">
<TextView
android:text="@string/phone_number"
style="@style/assistant_input_field_header_font"
android:textAllCaps="true"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<EditText <com.google.android.material.textfield.TextInputLayout
assistantPhoneNumberPrefixValidation="@{true}" android:layout_width="100dp"
android:text="@={viewModel.prefix}"
android:background="@drawable/resizable_text_field"
android:textColor="@color/black_color"
android:inputType="phone"
android:layout_marginRight="10dp"
android:gravity="center"
android:layout_width="65dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/international_prefix" android:layout_marginRight="10dp"
android:maxLines="1"/> android:hint="@string/international_prefix">
<EditText <com.google.android.material.textfield.TextInputEditText
assistantPhoneNumberValidation="@{true}" assistantPhoneNumberPrefixValidation="@{true}"
errorMessage="@={viewModel.phoneNumberError}" android:text="@={viewModel.prefix}"
android:text="@={viewModel.phoneNumber}" android:imeOptions="actionDone"
android:background="@drawable/resizable_text_field" android:singleLine="true"
android:textColor="@color/black_color" android:inputType="phone"
android:inputType="phone" android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/phone_number" android:hint="@string/phone_number">
android:maxLines="1"/>
<com.google.android.material.textfield.TextInputEditText
assistantPhoneNumberValidation="@{true}"
errorMessage="@={viewModel.phoneNumberError}"
android:text="@={viewModel.phoneNumber}"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="phone"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>
@ -154,88 +157,68 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout <LinearLayout
android:visibility="@{viewModel.loginWithUsernamePassword ? View.VISIBLE: View.GONE}" android:visibility="@{viewModel.loginWithUsernamePassword ? View.VISIBLE: View.GONE}"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:paddingTop="10dp" android:paddingTop="10dp"
android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/username_desc"
style="@style/standard_small_text_font" style="@style/standard_small_text_font"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:layout_alignParentTop="true"
android:paddingTop="10dp" android:paddingTop="10dp"
android:text="@string/assistant_linphone_login_desc" /> android:text="@string/assistant_linphone_login_desc" />
<LinearLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/username_layout" android:id="@+id/username_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="10dp" android:layout_marginTop="16dp"
android:layout_below="@id/username_desc" android:hint="@string/username">
android:orientation="vertical">
<TextView <com.google.android.material.textfield.TextInputEditText
style="@style/assistant_input_field_header_font"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/username"
android:textAllCaps="true" />
<EditText
android:text="@={viewModel.username}" android:text="@={viewModel.username}"
android:layout_width="match_parent" android:imeOptions="actionDone"
android:layout_height="wrap_content" android:singleLine="true"
android:background="@drawable/resizable_text_field"
android:inputType="text|textNoSuggestions" android:inputType="text|textNoSuggestions"
android:maxLines="1" android:background="@color/transparent_color"
android:hint="@string/username" android:layout_width="match_parent"
android:textColor="@color/black_color" /> android:layout_height="wrap_content"/>
</LinearLayout> </com.google.android.material.textfield.TextInputLayout>
<LinearLayout <com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="10dp" android:hint="@string/password">
android:layout_below="@id/username_layout"
android:orientation="vertical">
<TextView <com.google.android.material.textfield.TextInputEditText
style="@style/assistant_input_field_header_font"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/password"
android:textAllCaps="true" />
<EditText
android:text="@={viewModel.password}" android:text="@={viewModel.password}"
android:layout_width="match_parent" android:imeOptions="actionDone"
android:layout_height="wrap_content" android:singleLine="true"
android:background="@drawable/resizable_text_field"
android:inputType="textPassword" android:inputType="textPassword"
android:maxLines="1" android:background="@color/transparent_color"
android:hint="@string/password" android:layout_width="match_parent"
android:textColor="@color/black_color" /> android:layout_height="wrap_content"/>
<TextView </com.google.android.material.textfield.TextInputLayout>
android:onClick="@{forgotPasswordClickListener}"
android:textColor="?attr/accentColor"
android:textSize="8sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:gravity="center"
android:paddingTop="5dp"
android:text="@string/assistant_login_forgotten_password" />
</LinearLayout> <TextView
android:onClick="@{forgotPasswordClickListener}"
android:textColor="?attr/accentColor"
android:textSize="8sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:gravity="right"
android:paddingTop="6dp"
android:text="@string/assistant_login_forgotten_password" />
</RelativeLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -31,16 +31,22 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp"> android:layout_margin="10dp">
<EditText <com.google.android.material.textfield.TextInputLayout
android:id="@+id/search_country" android:layout_toLeftOf="@id/clear_field"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/clear_field" android:hint="@string/assistant_choose_country">
android:gravity="center"
android:inputType="textPersonName" <com.google.android.material.textfield.TextInputEditText
android:hint="@string/assistant_choose_country" android:id="@+id/search_country"
android:textColor="@color/black_color" android:imeOptions="actionDone"
android:textCursorDrawable="@null" /> android:singleLine="true"
android:inputType="textPersonName"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<ImageView <ImageView
android:id="@+id/clear_field" android:id="@+id/clear_field"

View file

@ -52,128 +52,77 @@
android:paddingTop="20dp" android:paddingTop="20dp"
android:text="@string/assistant_create_account_part_email" /> android:text="@string/assistant_create_account_part_email" />
<GridLayout <com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:columnCount="1"> android:hint="@string/username">
<LinearLayout <com.google.android.material.textfield.TextInputEditText
android:layout_width="wrap_content" assistantUsernameValidation="@{true}"
android:layout_gravity="fill" errorMessage="@={viewModel.usernameError}"
android:layout_columnWeight="1" android:text="@={viewModel.username}"
android:layout_height="wrap_content" android:imeOptions="actionDone"
android:padding="10dp" android:singleLine="true"
android:orientation="vertical"> android:inputType="text|textNoSuggestions"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView </com.google.android.material.textfield.TextInputLayout>
style="@style/assistant_input_field_header_font"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/username"
android:textAllCaps="true" />
<EditText <com.google.android.material.textfield.TextInputLayout
assistantUsernameValidation="@{true}" android:layout_width="match_parent"
errorMessage="@={viewModel.usernameError}" android:layout_height="wrap_content"
android:text="@={viewModel.username}" android:hint="@string/email">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/resizable_text_field"
android:inputType="text|textNoSuggestions"
android:maxLines="1"
android:hint="@string/username"
android:textColor="@color/black_color" />
</LinearLayout> <com.google.android.material.textfield.TextInputEditText
errorMessage="@={viewModel.emailError}"
emailConfirmationValidation="@{true}"
android:text="@={viewModel.email}"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="text|textEmailAddress"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout </com.google.android.material.textfield.TextInputLayout>
android:layout_width="wrap_content"
android:layout_gravity="fill"
android:layout_columnWeight="1"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">
<TextView <com.google.android.material.textfield.TextInputLayout
style="@style/assistant_input_field_header_font" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:hint="@string/password">
android:text="@string/email"
android:textAllCaps="true" />
<EditText <com.google.android.material.textfield.TextInputEditText
errorMessage="@={viewModel.emailError}" errorMessage="@={viewModel.passwordError}"
emailConfirmationValidation="@{true}" passwordConfirmationValidation="@{passwordConfirmation}"
android:text="@={viewModel.email}" android:text="@={viewModel.password}"
android:layout_width="match_parent" android:imeOptions="actionDone"
android:layout_height="wrap_content" android:singleLine="true"
android:background="@drawable/resizable_text_field" android:inputType="textPassword"
android:inputType="text|textEmailAddress" android:background="@color/transparent_color"
android:maxLines="1" android:layout_width="match_parent"
android:hint="@string/email" android:layout_height="wrap_content"/>
android:textColor="@color/black_color" />
</LinearLayout> </com.google.android.material.textfield.TextInputLayout>
<LinearLayout <com.google.android.material.textfield.TextInputLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_gravity="fill" android:layout_height="wrap_content"
android:layout_columnWeight="1" android:hint="@string/assistant_confirm_password">
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">
<TextView <com.google.android.material.textfield.TextInputEditText
style="@style/assistant_input_field_header_font" android:id="@+id/password_confirmation"
android:layout_width="match_parent" errorMessage="@={viewModel.passwordConfirmationError}"
android:layout_height="wrap_content" android:text="@={viewModel.passwordConfirmation}"
android:text="@string/password" android:imeOptions="actionDone"
android:textAllCaps="true" /> android:singleLine="true"
android:inputType="textPassword"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<EditText </com.google.android.material.textfield.TextInputLayout>
errorMessage="@={viewModel.passwordError}"
passwordConfirmationValidation="@{passwordConfirmation}"
android:text="@={viewModel.password}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/resizable_text_field"
android:inputType="textPassword"
android:maxLines="1"
android:hint="@string/password"
android:textColor="@color/black_color" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_gravity="fill"
android:layout_columnWeight="1"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">
<TextView
style="@style/assistant_input_field_header_font"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/assistant_confirm_password"
android:textAllCaps="true" />
<EditText
android:id="@+id/password_confirmation"
errorMessage="@={viewModel.passwordConfirmationError}"
android:text="@={viewModel.passwordConfirmation}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/resizable_text_field"
android:inputType="textPassword"
android:maxLines="1"
android:hint="@string/assistant_confirm_password"
android:textColor="@color/black_color" />
</LinearLayout>
</GridLayout>
<TextView <TextView
android:onClick="@{() -> viewModel.create()}" android:onClick="@{() -> viewModel.create()}"

View file

@ -31,6 +31,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
@ -52,172 +53,120 @@
android:paddingTop="20dp" android:paddingTop="20dp"
android:text="@string/assistant_login_desc" /> android:text="@string/assistant_login_desc" />
<GridLayout <com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:columnCount="1"> android:hint="@string/username">
<LinearLayout <com.google.android.material.textfield.TextInputEditText
android:layout_width="wrap_content" android:text="@={viewModel.username}"
android:layout_gravity="fill" android:imeOptions="actionDone"
android:layout_columnWeight="1" android:singleLine="true"
android:inputType="text|textNoSuggestions"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/password">
<com.google.android.material.textfield.TextInputEditText
android:text="@={viewModel.password}"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="textPassword"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/domain">
<com.google.android.material.textfield.TextInputEditText
android:text="@={viewModel.domain}"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="textUri"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/assistant_display_name_optional">
<com.google.android.material.textfield.TextInputEditText
android:text="@={viewModel.displayName}"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="textPersonName"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="10dp" android:padding="10dp"
android:orientation="vertical"> android:gravity="center"
android:orientation="horizontal">
<TextView <TextView
style="@style/assistant_input_field_header_font" style="@style/assistant_input_field_header_font"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:text="@string/username" android:gravity="center"
android:textAllCaps="true" />
<EditText
android:text="@={viewModel.username}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/resizable_text_field"
android:inputType="text|textNoSuggestions"
android:maxLines="1"
android:hint="@string/username"
android:textColor="@color/black_color" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_gravity="fill"
android:layout_columnWeight="1"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">
<TextView
style="@style/assistant_input_field_header_font"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/password"
android:textAllCaps="true" />
<EditText
android:text="@={viewModel.password}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/resizable_text_field"
android:inputType="textPassword"
android:maxLines="1"
android:hint="@string/password"
android:textColor="@color/black_color" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_gravity="fill"
android:layout_columnWeight="1"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">
<TextView
style="@style/assistant_input_field_header_font"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/domain"
android:textAllCaps="true" />
<EditText
android:text="@={viewModel.domain}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/resizable_text_field"
android:inputType="textUri"
android:maxLines="1"
android:hint="@string/domain"
android:textColor="@color/black_color" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_gravity="fill"
android:layout_columnWeight="1"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">
<TextView
style="@style/assistant_input_field_header_font"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/assistant_display_name_optional"
android:textAllCaps="true" />
<EditText
android:text="@={viewModel.displayName}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/resizable_text_field"
android:inputType="textPersonName"
android:maxLines="1"
android:hint="@string/assistant_display_name_optional"
android:textColor="@color/black_color" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_gravity="fill"
android:layout_columnWeight="1"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">
<TextView
style="@style/assistant_input_field_header_font"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/transport" android:text="@string/transport"
android:textAllCaps="true" /> android:textAllCaps="true" />
<RadioGroup <com.google.android.material.radiobutton.MaterialRadioButton
android:layout_width="match_parent" android:checked="@{viewModel.transport == TransportType.Udp}"
android:onClick="@{() -> viewModel.setTransport(TransportType.Udp)}"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:layout_margin="5dp"
android:orientation="horizontal"> android:textColor="?attr/primaryTextColor"
android:text="@string/transport_udp" />
<RadioButton <com.google.android.material.radiobutton.MaterialRadioButton
android:checked="@{viewModel.transport == TransportType.Udp}" android:checked="@{viewModel.transport == TransportType.Tcp}"
android:onClick="@{() -> viewModel.setTransport(TransportType.Udp)}" android:onClick="@{() -> viewModel.setTransport(TransportType.Tcp)}"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp" android:layout_margin="5dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:text="@string/transport_udp" /> android:text="@string/transport_tcp" />
<RadioButton <com.google.android.material.radiobutton.MaterialRadioButton
android:checked="@{viewModel.transport == TransportType.Tcp}" android:checked="@{viewModel.transport == TransportType.Tls}"
android:onClick="@{() -> viewModel.setTransport(TransportType.Tcp)}" android:onClick="@{() -> viewModel.setTransport(TransportType.Tls)}"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp" android:layout_margin="5dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:text="@string/transport_tcp" /> android:text="@string/transport_tls" />
<RadioButton </RadioGroup>
android:checked="@{viewModel.transport == TransportType.Tls}"
android:onClick="@{() -> viewModel.setTransport(TransportType.Tls)}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:textColor="?attr/primaryTextColor"
android:text="@string/transport_tls" />
</RadioGroup> </LinearLayout>
</LinearLayout>
</GridLayout>
<TextView <TextView
android:onClick="@{() -> viewModel.createProxyConfig()}" android:onClick="@{() -> viewModel.createProxyConfig()}"

View file

@ -106,30 +106,41 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<EditText <com.google.android.material.textfield.TextInputLayout
assistantPhoneNumberPrefixValidation="@{true}" android:layout_width="100dp"
android:text="@={viewModel.prefix}"
android:background="@drawable/resizable_text_field"
android:textColor="@color/black_color"
android:inputType="phone"
android:layout_marginRight="10dp"
android:gravity="center"
android:layout_width="65dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/international_prefix" android:layout_marginRight="10dp"
android:maxLines="1"/> android:hint="@string/international_prefix">
<EditText <com.google.android.material.textfield.TextInputEditText
assistantPhoneNumberValidation="@{true}" assistantPhoneNumberPrefixValidation="@{true}"
errorMessage="@={viewModel.phoneNumberError}" android:text="@={viewModel.prefix}"
android:text="@={viewModel.phoneNumber}" android:imeOptions="actionDone"
android:background="@drawable/resizable_text_field" android:singleLine="true"
android:textColor="@color/black_color" android:inputType="phone"
android:inputType="phone" android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/phone_number" android:hint="@string/phone_number">
android:maxLines="1"/>
<com.google.android.material.textfield.TextInputEditText
assistantPhoneNumberValidation="@{true}"
errorMessage="@={viewModel.phoneNumberError}"
android:text="@={viewModel.phoneNumber}"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="phone"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>
@ -154,18 +165,24 @@
</LinearLayout> </LinearLayout>
<EditText <com.google.android.material.textfield.TextInputLayout
assistantUsernameValidation="@{true}"
errorMessage="@={viewModel.usernameError}"
android:text="@={viewModel.username}"
android:visibility="@{viewModel.useUsername ? View.VISIBLE : View.GONE}" android:visibility="@{viewModel.useUsername ? View.VISIBLE : View.GONE}"
android:background="@drawable/resizable_text_field"
android:textColor="@color/black_color"
android:inputType="text|textNoSuggestions"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/username" android:hint="@string/username">
android:maxLines="1"/>
<com.google.android.material.textfield.TextInputEditText
assistantUsernameValidation="@{true}"
errorMessage="@={viewModel.usernameError}"
android:text="@={viewModel.username}"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="text|textNoSuggestions"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>

View file

@ -116,30 +116,41 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/select_country"> android:layout_below="@id/select_country">
<EditText <com.google.android.material.textfield.TextInputLayout
assistantPhoneNumberPrefixValidation="@{true}" android:layout_width="100dp"
android:background="@drawable/resizable_text_field"
android:textColor="@color/black_color"
android:inputType="phone"
android:text="@={viewModel.prefix}"
android:layout_marginRight="10dp"
android:gravity="center"
android:layout_width="65dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/international_prefix" android:layout_marginRight="10dp"
android:maxLines="1"/> android:hint="@string/international_prefix">
<EditText <com.google.android.material.textfield.TextInputEditText
assistantPhoneNumberValidation="@{true}" assistantPhoneNumberPrefixValidation="@{true}"
errorMessage="@={viewModel.phoneNumberError}" android:text="@={viewModel.prefix}"
android:text="@={viewModel.phoneNumber}" android:imeOptions="actionDone"
android:background="@drawable/resizable_text_field" android:singleLine="true"
android:textColor="@color/black_color" android:inputType="phone"
android:inputType="phone" android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/phone_number" android:hint="@string/phone_number">
android:maxLines="1"/>
<com.google.android.material.textfield.TextInputEditText
assistantPhoneNumberValidation="@{true}"
errorMessage="@={viewModel.phoneNumberError}"
android:text="@={viewModel.phoneNumber}"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="phone"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>

View file

@ -87,16 +87,21 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<EditText <com.google.android.material.textfield.TextInputLayout
android:text="@={viewModel.code}"
android:background="@drawable/resizable_text_field"
android:textColor="@color/black_color"
android:inputType="number"
android:gravity="center_vertical|center_horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/assistant_confirmation_code" android:hint="@string/assistant_confirmation_code">
android:maxLines="1"/>
<com.google.android.material.textfield.TextInputEditText
android:text="@={viewModel.code}"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="number"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<TextView <TextView
android:onClick="@{() -> viewModel.finish()}" android:onClick="@{() -> viewModel.finish()}"

View file

@ -52,25 +52,23 @@
android:paddingTop="10dp" android:paddingTop="10dp"
android:text="@string/assistant_remote_provisioning_desc" /> android:text="@string/assistant_remote_provisioning_desc" />
<TextView <com.google.android.material.textfield.TextInputLayout
android:text="@string/assistant_remote_provisioning_url"
style="@style/assistant_input_field_header_font"
android:textAllCaps="true"
android:paddingTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<EditText
errorMessage="@={viewModel.urlError}"
urlConfirmationValidation="@{true}"
android:text="@={viewModel.urlToFetch}"
android:background="@drawable/resizable_text_field"
android:textColor="@color/black_color"
android:inputType="textUri"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/assistant_remote_provisioning_url" android:hint="@string/assistant_remote_provisioning_url">
android:maxLines="1"/>
<com.google.android.material.textfield.TextInputEditText
errorMessage="@={viewModel.urlError}"
urlConfirmationValidation="@{true}"
android:text="@={viewModel.urlToFetch}"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="textUri"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<TextView <TextView
android:onClick="@{() -> viewModel.fetchAndApply()}" android:onClick="@{() -> viewModel.fetchAndApply()}"

View file

@ -79,15 +79,23 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp"> android:layout_margin="10dp">
<EditText <com.google.android.material.textfield.TextInputLayout
android:text="@={viewModel.subject}"
android:enabled="@{viewModel.meAdmin}"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="wrap_content"
android:gravity="center" android:paddingRight="5dp"
android:hint="@string/chat_room_group_info_subject_hint" android:hint="@string/chat_room_group_info_subject_hint">
android:inputType="textEmailSubject"
android:paddingRight="5dp" /> <com.google.android.material.textfield.TextInputEditText
android:text="@={viewModel.subject}"
android:enabled="@{viewModel.meAdmin}"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="textEmailSubject"
android:background="@color/transparent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
</RelativeLayout> </RelativeLayout>

View file

@ -47,7 +47,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/settings_clear_input" android:layout_toLeftOf="@id/settings_clear_input"
android:layout_marginTop="15dp" android:layout_marginTop="5dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:enabled="@{enabled ?? true}" android:enabled="@{enabled ?? true}"

View file

@ -30,7 +30,7 @@
<string name="phone_number">Phone number</string> <string name="phone_number">Phone number</string>
<string name="phone_numbers">Phone numbers</string> <string name="phone_numbers">Phone numbers</string>
<string name="select_your_country">Select your country</string> <string name="select_your_country">Select your country</string>
<string name="international_prefix">International phone number prefix</string> <string name="international_prefix">Prefix</string>
<string name="assistant_choose_country">Choose a country</string> <string name="assistant_choose_country">Choose a country</string>
<string name="username">Username</string> <string name="username">Username</string>
<string name="password">Password</string> <string name="password">Password</string>

View file

@ -62,7 +62,7 @@
<!-- Assistant related --> <!-- Assistant related -->
<style name="assistant_input_field_header_font" parent="@android:style/TextAppearance.Medium"> <style name="assistant_input_field_header_font" parent="@android:style/TextAppearance.Medium">
<item name="android:textColor">?attr/primarySubtextLightColor</item> <item name="android:textColor">?attr/primaryTextColor</item>
<item name="android:textSize">13sp</item> <item name="android:textSize">13sp</item>
</style> </style>