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
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:hint="@string/international_prefix">
<com.google.android.material.textfield.TextInputEditText
assistantPhoneNumberPrefixValidation="@{true}" assistantPhoneNumberPrefixValidation="@{true}"
android:text="@={viewModel.prefix}" android:text="@={viewModel.prefix}"
android:background="@drawable/resizable_text_field" android:imeOptions="actionDone"
android:textColor="@color/black_color" android:singleLine="true"
android:inputType="phone" android:inputType="phone"
android:layout_marginRight="10dp" android:background="@color/transparent_color"
android:gravity="center" android:layout_width="match_parent"
android:layout_width="65dp" android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:hint="@string/international_prefix"
android:maxLines="1"/>
<EditText </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/phone_number">
<com.google.android.material.textfield.TextInputEditText
assistantPhoneNumberValidation="@{true}" assistantPhoneNumberValidation="@{true}"
errorMessage="@={viewModel.phoneNumberError}" errorMessage="@={viewModel.phoneNumberError}"
android:text="@={viewModel.phoneNumber}" android:text="@={viewModel.phoneNumber}"
android:background="@drawable/resizable_text_field" android:imeOptions="actionDone"
android:textColor="@color/black_color" android:singleLine="true"
android:inputType="phone" android:inputType="phone"
android:background="@color/transparent_color"
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:maxLines="1"/> </com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>
@ -154,89 +157,69 @@
</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"/>
</com.google.android.material.textfield.TextInputLayout>
<TextView <TextView
android:onClick="@{forgotPasswordClickListener}" android:onClick="@{forgotPasswordClickListener}"
android:textColor="?attr/accentColor" android:textColor="?attr/accentColor"
android:textSize="8sp" android:textSize="8sp"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right" android:layout_gravity="right"
android:gravity="center" android:gravity="right"
android:paddingTop="5dp" android:paddingTop="6dp"
android:text="@string/assistant_login_forgotten_password" /> android:text="@string/assistant_login_forgotten_password" />
</LinearLayout> </LinearLayout>
</RelativeLayout>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="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"
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/search_country"
android:imeOptions="actionDone"
android:singleLine="true"
android:inputType="textPersonName" android:inputType="textPersonName"
android:hint="@string/assistant_choose_country" android:background="@color/transparent_color"
android:textColor="@color/black_color" android:layout_width="match_parent"
android:textCursorDrawable="@null" /> 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_height="match_parent"
android:columnCount="1">
<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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/username" android:hint="@string/username">
android:textAllCaps="true" />
<EditText <com.google.android.material.textfield.TextInputEditText
assistantUsernameValidation="@{true}" assistantUsernameValidation="@{true}"
errorMessage="@={viewModel.usernameError}" errorMessage="@={viewModel.usernameError}"
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="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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/email" android:hint="@string/email">
android:textAllCaps="true" />
<EditText <com.google.android.material.textfield.TextInputEditText
errorMessage="@={viewModel.emailError}" errorMessage="@={viewModel.emailError}"
emailConfirmationValidation="@{true}" emailConfirmationValidation="@{true}"
android:text="@={viewModel.email}" android:text="@={viewModel.email}"
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|textEmailAddress" android:inputType="text|textEmailAddress"
android:maxLines="1" android:background="@color/transparent_color"
android:hint="@string/email" 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="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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/password" android:hint="@string/password">
android:textAllCaps="true" />
<EditText <com.google.android.material.textfield.TextInputEditText
errorMessage="@={viewModel.passwordError}" errorMessage="@={viewModel.passwordError}"
passwordConfirmationValidation="@{passwordConfirmation}" passwordConfirmationValidation="@{passwordConfirmation}"
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"/>
</LinearLayout> </com.google.android.material.textfield.TextInputLayout>
<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
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:text="@string/assistant_confirm_password" android:hint="@string/assistant_confirm_password">
android:textAllCaps="true" />
<EditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/password_confirmation" android:id="@+id/password_confirmation"
errorMessage="@={viewModel.passwordConfirmationError}" errorMessage="@={viewModel.passwordConfirmationError}"
android:text="@={viewModel.passwordConfirmation}" android:text="@={viewModel.passwordConfirmation}"
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/assistant_confirm_password" android:layout_width="match_parent"
android:textColor="@color/black_color" /> android:layout_height="wrap_content"/>
</LinearLayout> </com.google.android.material.textfield.TextInputLayout>
</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,141 +53,91 @@
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_height="match_parent"
android:columnCount="1">
<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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/username" android:hint="@string/username">
android:textAllCaps="true" />
<EditText <com.google.android.material.textfield.TextInputEditText
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="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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/password" android:hint="@string/password">
android:textAllCaps="true" />
<EditText <com.google.android.material.textfield.TextInputEditText
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"/>
</LinearLayout> </com.google.android.material.textfield.TextInputLayout>
<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
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:text="@string/domain" android:hint="@string/domain">
android:textAllCaps="true" />
<EditText <com.google.android.material.textfield.TextInputEditText
android:text="@={viewModel.domain}" android:text="@={viewModel.domain}"
android:layout_width="match_parent" android:imeOptions="actionDone"
android:layout_height="wrap_content" android:singleLine="true"
android:background="@drawable/resizable_text_field"
android:inputType="textUri" android:inputType="textUri"
android:maxLines="1" android:background="@color/transparent_color"
android:hint="@string/domain" 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="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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/assistant_display_name_optional" android:hint="@string/assistant_display_name_optional">
android:textAllCaps="true" />
<EditText <com.google.android.material.textfield.TextInputEditText
android:text="@={viewModel.displayName}" android:text="@={viewModel.displayName}"
android:layout_width="match_parent" android:imeOptions="actionDone"
android:layout_height="wrap_content" android:singleLine="true"
android:background="@drawable/resizable_text_field"
android:inputType="textPersonName" android:inputType="textPersonName"
android:maxLines="1" android:background="@color/transparent_color"
android:hint="@string/assistant_display_name_optional" android:layout_width="match_parent"
android:textColor="@color/black_color" /> android:layout_height="wrap_content"/>
</LinearLayout> </com.google.android.material.textfield.TextInputLayout>
<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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/transport" android:orientation="vertical">
android:textAllCaps="true" />
<RadioGroup <RadioGroup
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="10dp"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
<RadioButton <TextView
style="@style/assistant_input_field_header_font"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/transport"
android:textAllCaps="true" />
<com.google.android.material.radiobutton.MaterialRadioButton
android:checked="@{viewModel.transport == TransportType.Udp}" android:checked="@{viewModel.transport == TransportType.Udp}"
android:onClick="@{() -> viewModel.setTransport(TransportType.Udp)}" android:onClick="@{() -> viewModel.setTransport(TransportType.Udp)}"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -195,7 +146,7 @@
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:text="@string/transport_udp" /> android:text="@string/transport_udp" />
<RadioButton <com.google.android.material.radiobutton.MaterialRadioButton
android:checked="@{viewModel.transport == TransportType.Tcp}" android:checked="@{viewModel.transport == TransportType.Tcp}"
android:onClick="@{() -> viewModel.setTransport(TransportType.Tcp)}" android:onClick="@{() -> viewModel.setTransport(TransportType.Tcp)}"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -204,7 +155,7 @@
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:text="@string/transport_tcp" /> android:text="@string/transport_tcp" />
<RadioButton <com.google.android.material.radiobutton.MaterialRadioButton
android:checked="@{viewModel.transport == TransportType.Tls}" android:checked="@{viewModel.transport == TransportType.Tls}"
android:onClick="@{() -> viewModel.setTransport(TransportType.Tls)}" android:onClick="@{() -> viewModel.setTransport(TransportType.Tls)}"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -217,8 +168,6 @@
</LinearLayout> </LinearLayout>
</GridLayout>
<TextView <TextView
android:onClick="@{() -> viewModel.createProxyConfig()}" android:onClick="@{() -> viewModel.createProxyConfig()}"
android:enabled="@{viewModel.loginEnabled, default=false}" android:enabled="@{viewModel.loginEnabled, default=false}"

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
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:hint="@string/international_prefix">
<com.google.android.material.textfield.TextInputEditText
assistantPhoneNumberPrefixValidation="@{true}" assistantPhoneNumberPrefixValidation="@{true}"
android:text="@={viewModel.prefix}" android:text="@={viewModel.prefix}"
android:background="@drawable/resizable_text_field" android:imeOptions="actionDone"
android:textColor="@color/black_color" android:singleLine="true"
android:inputType="phone" android:inputType="phone"
android:layout_marginRight="10dp" android:background="@color/transparent_color"
android:gravity="center" android:layout_width="match_parent"
android:layout_width="65dp" android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:hint="@string/international_prefix"
android:maxLines="1"/>
<EditText </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/phone_number">
<com.google.android.material.textfield.TextInputEditText
assistantPhoneNumberValidation="@{true}" assistantPhoneNumberValidation="@{true}"
errorMessage="@={viewModel.phoneNumberError}" errorMessage="@={viewModel.phoneNumberError}"
android:text="@={viewModel.phoneNumber}" android:text="@={viewModel.phoneNumber}"
android:background="@drawable/resizable_text_field" android:imeOptions="actionDone"
android:textColor="@color/black_color" android:singleLine="true"
android:inputType="phone" android:inputType="phone"
android:background="@color/transparent_color"
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:maxLines="1"/> </com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>
@ -154,18 +165,24 @@
</LinearLayout> </LinearLayout>
<EditText <com.google.android.material.textfield.TextInputLayout
android:visibility="@{viewModel.useUsername ? View.VISIBLE : View.GONE}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/username">
<com.google.android.material.textfield.TextInputEditText
assistantUsernameValidation="@{true}" assistantUsernameValidation="@{true}"
errorMessage="@={viewModel.usernameError}" errorMessage="@={viewModel.usernameError}"
android:text="@={viewModel.username}" android:text="@={viewModel.username}"
android:visibility="@{viewModel.useUsername ? View.VISIBLE : View.GONE}" android:imeOptions="actionDone"
android:background="@drawable/resizable_text_field" android:singleLine="true"
android:textColor="@color/black_color"
android:inputType="text|textNoSuggestions" android:inputType="text|textNoSuggestions"
android:background="@color/transparent_color"
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:maxLines="1"/> </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
assistantPhoneNumberPrefixValidation="@{true}"
android:text="@={viewModel.prefix}"
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>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/phone_number">
<com.google.android.material.textfield.TextInputEditText
assistantPhoneNumberValidation="@{true}" assistantPhoneNumberValidation="@{true}"
errorMessage="@={viewModel.phoneNumberError}" errorMessage="@={viewModel.phoneNumberError}"
android:text="@={viewModel.phoneNumber}" android:text="@={viewModel.phoneNumber}"
android:background="@drawable/resizable_text_field" android:imeOptions="actionDone"
android:textColor="@color/black_color" android:singleLine="true"
android:inputType="phone" android:inputType="phone"
android:background="@color/transparent_color"
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:maxLines="1"/> </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_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"
android:hint="@string/assistant_remote_provisioning_url">
<EditText <com.google.android.material.textfield.TextInputEditText
errorMessage="@={viewModel.urlError}" errorMessage="@={viewModel.urlError}"
urlConfirmationValidation="@{true}" urlConfirmationValidation="@{true}"
android:text="@={viewModel.urlToFetch}" android:text="@={viewModel.urlToFetch}"
android:background="@drawable/resizable_text_field" android:imeOptions="actionDone"
android:textColor="@color/black_color" android:singleLine="true"
android:inputType="textUri" android:inputType="textUri"
android:background="@color/transparent_color"
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:maxLines="1"/> </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:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingRight="5dp"
android:hint="@string/chat_room_group_info_subject_hint">
<com.google.android.material.textfield.TextInputEditText
android:text="@={viewModel.subject}" android:text="@={viewModel.subject}"
android:enabled="@{viewModel.meAdmin}" android:enabled="@{viewModel.meAdmin}"
android:layout_width="match_parent" android:imeOptions="actionDone"
android:layout_height="40dp" android:singleLine="true"
android:gravity="center"
android:hint="@string/chat_room_group_info_subject_hint"
android:inputType="textEmailSubject" android:inputType="textEmailSubject"
android:paddingRight="5dp" /> 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>