Skip to content

Commit 3b37e22

Browse files
authored
Fix Edit Bookmark and Authentication dialog theming (#793)
* added new style for TextInputLayout * authentication dialog should also match the proper theming
1 parent 676cd64 commit 3b37e22

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

app/src/main/res/layout/edit_bookmark.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
android:layout_height="match_parent"
2121
android:paddingTop="20dp">
2222

23-
2423
<com.google.android.material.textfield.TextInputLayout
2524
android:id="@+id/bookmarkTitleInputContainer"
2625
android:layout_width="match_parent"
27-
android:layout_height="wrap_content"
26+
android:layout_height="60dp"
2827
android:layout_marginStart="20dp"
2928
android:layout_marginEnd="20dp"
29+
style="@style/TextInputLayoutTheme"
3030
app:layout_constraintEnd_toEndOf="parent"
3131
app:layout_constraintStart_toStartOf="parent"
3232
app:layout_constraintTop_toTopOf="parent">
3333

34-
<EditText
34+
<com.google.android.material.textfield.TextInputEditText
3535
android:id="@+id/titleInput"
3636
android:layout_width="match_parent"
3737
android:layout_height="wrap_content"
@@ -43,12 +43,13 @@
4343
<com.google.android.material.textfield.TextInputLayout
4444
android:id="@+id/bookmarkUrlInputContainer"
4545
android:layout_width="match_parent"
46-
android:layout_height="wrap_content"
46+
android:layout_height="60dp"
4747
android:layout_marginStart="20dp"
4848
android:layout_marginEnd="20dp"
49+
style="@style/TextInputLayoutTheme"
4950
app:layout_constraintTop_toBottomOf="@id/bookmarkTitleInputContainer">
5051

51-
<EditText
52+
<com.google.android.material.textfield.TextInputEditText
5253
android:id="@+id/urlInput"
5354
android:layout_width="match_parent"
5455
android:layout_height="wrap_content"

app/src/main/res/layout/http_authentication.xml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,58 +15,60 @@
1515
-->
1616

1717
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
18-
xmlns:app="http://schemas.android.com/apk/res-auto"
19-
android:layout_width="match_parent"
20-
android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools"
21-
android:paddingTop="20dp">
22-
18+
xmlns:app="http://schemas.android.com/apk/res-auto"
19+
xmlns:tools="http://schemas.android.com/tools"
20+
android:layout_width="match_parent"
21+
android:layout_height="match_parent"
22+
android:paddingTop="20dp">
2323

2424
<TextView
2525
android:id="@+id/httpAuthInformationText"
2626
android:layout_width="match_parent"
2727
android:layout_height="wrap_content"
28-
android:layout_marginTop="8dp"
2928
android:layout_marginStart="20dp"
29+
android:layout_marginTop="8dp"
3030
android:layout_marginEnd="20dp"
3131
app:layout_constraintTop_toTopOf="parent" />
3232

3333
<com.google.android.material.textfield.TextInputLayout
3434
android:id="@+id/httpAuthUsernameContainer"
3535
android:layout_width="match_parent"
36-
android:layout_height="wrap_content"
36+
android:layout_height="60dp"
37+
style="@style/TextInputLayoutTheme"
3738
android:layout_marginStart="20dp"
38-
android:layout_marginEnd="20dp"
3939
android:layout_marginTop="20dp"
40+
android:layout_marginEnd="20dp"
4041
app:layout_constraintTop_toBottomOf="@id/httpAuthInformationText">
4142

42-
<EditText
43+
<com.google.android.material.textfield.TextInputEditText
4344
android:id="@+id/usernameInput"
4445
android:layout_width="match_parent"
4546
android:layout_height="wrap_content"
47+
android:autofillHints="username"
4648
android:hint="@string/authenticationDialogUsernameHint"
47-
android:inputType="text"
4849
android:importantForAutofill="yes"
49-
android:autofillHints="username"
50+
android:inputType="text"
5051
tools:ignore="UnusedAttribute" />
5152

5253
</com.google.android.material.textfield.TextInputLayout>
5354

5455
<com.google.android.material.textfield.TextInputLayout
5556
android:id="@+id/httpAuthPasswordContainer"
5657
android:layout_width="match_parent"
57-
android:layout_height="wrap_content"
58+
android:layout_height="60dp"
59+
style="@style/TextInputLayoutTheme"
5860
android:layout_marginStart="20dp"
5961
android:layout_marginEnd="20dp"
6062
app:layout_constraintTop_toBottomOf="@id/httpAuthUsernameContainer">
6163

62-
<EditText
64+
<com.google.android.material.textfield.TextInputEditText
6365
android:id="@+id/passwordInput"
6466
android:layout_width="match_parent"
6567
android:layout_height="wrap_content"
68+
android:autofillHints="password"
6669
android:hint="@string/authenticationDialogPasswordHint"
67-
android:inputType="textWebPassword"
6870
android:importantForAutofill="yes"
69-
android:autofillHints="password"
71+
android:inputType="textWebPassword"
7072
tools:ignore="UnusedAttribute" />
7173

7274
</com.google.android.material.textfield.TextInputLayout>

app/src/main/res/values/themes.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@
192192
<item name="android:colorForeground">?attr/settingsSwitchBackgroundColor</item>
193193
</style>
194194

195+
<style name="TextInputLayoutTheme" parent="Widget.Design.TextInputLayout">
196+
<item name="colorControlActivated">@color/cornflowerBlue</item>
197+
<item name="colorControlNormal">@color/cornflowerBlue</item>
198+
<item name="colorControlHighlight">@color/cornflowerBlue</item>
199+
<item name="android:textColor">@color/grayish</item>
200+
<item name="android:textColorSecondary">@color/grayish</item>
201+
<item name="android:textColorHint">@color/grayish</item>
202+
</style>
203+
195204
<style name="AutoCompleteTextViewStyle" parent="Widget.AppCompat.AutoCompleteTextView">
196205
<item name="android:textCursorDrawable">@drawable/text_cursor</item>
197206
<item name="android:textColorHint">?attr/omnibarHintColor</item>

0 commit comments

Comments
 (0)